OSDN Git Service

fix
[bytom/vapor.git] / docs / precog / README.md
1 # Precognitive
2
3 Keep monitoring (leader & candidate) consensus nodes status in vapor network.
4
5 ## Init
6
7 ### Database Schema
8 [precognitive_schema.sql](./sql_dump/precognitive_schema.sql)
9
10 ### Config
11 run with [config_example.json](docs/precognitive/config_example.json)
12 ```
13 go run cmd/precognitive/main.go docs/precognitive/config_example.json
14 ```
15
16 ## API
17
18 + [/list-nodes](#list-nodes)
19
20 ### /list-nodes
21
22 __method:__ POST
23
24 ```
25 curl -X POST 127.0.0.1:3009/api/v1/list-nodes -d '{}'
26 ```
27
28 __example response:__
29 ```
30 {
31     [
32         {
33             "alias": "cobo",
34             "public_key": "b928e46bb01e834fdf167185e31b15de7cc257af8bbdf17f9c7fefd5bb97b306d048b6bc0da2097152c1c2ff38333c756a543adbba7030a447dcc776b8ac64ef",
35             "host": "vapornode.cobo.com",
36             "port": 123,
37             "best_height": 1023,
38             "lantency_ms": 300,
39             "active_minutes": 4096,
40             "status": "healthy"
41         },
42         {
43             "alias": "matpool",
44             "public_key": "0f8669abbd3cc0a167156188e428f940088d5b2f36bb3449df71d2bdc5e077814ea3f68628eef279ed435f51ee26cff00f8bd28fabfd500bedb2a9e369f5c825",
45             "host": "vapornode.matpool.io",
46             "port": 321,
47             "best_height": 1024,
48             "lantency_ms": 299,
49             "active_minutes": 4097,
50             "status": "healthy"
51         }
52     ] 
53 }
54 ```
55
56
57 ### /get-node-statistics