OSDN Git Service

init chain
authorHAOYUatHZ <haoyu@protonmail.com>
Fri, 2 Aug 2019 03:02:47 +0000 (11:02 +0800)
committerHAOYUatHZ <haoyu@protonmail.com>
Fri, 2 Aug 2019 03:02:47 +0000 (11:02 +0800)
docs/precog/README.md
docs/precog/sql_dump/federation_shema.sql [moved from docs/precog/sql_dump/placeholder with 100% similarity]
toolbar/precog/database/orm/chain.go [new file with mode: 0644]
toolbar/precog/database/orm/placeholder [deleted file]

index c6819c5..923f1c9 100644 (file)
@@ -5,7 +5,54 @@ Keep monitoring (leader & candidate) consensus nodes status in vapor network.
 ## Init
 
 ### Database Scheme
+[federation_shema.sql](./sql_dump/federation_shema.sql)
 
 ### Config
 
 ## API
+
++ [/chain-status](#chain-status)
++ [/list-nodes](#list-nodes)
+
+### /chain-status
+
+__method:__ POST
+
+__example response:__
+```
+{
+    "best_height": 1024,
+    "policy": {
+        "confirmations": 150,
+        "lantency_ms": 500
+    } 
+}
+```
+
+### /list-nodes
+
+__method:__ POST
+
+__example response:__
+```
+{
+    [
+        {
+            "alias": "cobo",
+            "pubkey": "...",
+            "best_height": 1023,
+            "lantency_ms": 300,
+            "active_minutes": 4096
+        },
+        {
+            "alias": "matpool",
+            "pubkey": "...",
+            "best_height": 1024,
+            "lantency_ms": 299,
+            "active_minutes": 4097
+        }
+    ] 
+}
+```
+
+
diff --git a/toolbar/precog/database/orm/chain.go b/toolbar/precog/database/orm/chain.go
new file mode 100644 (file)
index 0000000..3ddfb45
--- /dev/null
@@ -0,0 +1,5 @@
+package orm
+
+type Chain struct {
+       BestHeight uint64
+}
diff --git a/toolbar/precog/database/orm/placeholder b/toolbar/precog/database/orm/placeholder
deleted file mode 100644 (file)
index e69de29..0000000