### /chain-status
-__method:__ POST
-
-__example response:__
-```
-{
- "best_height": 1024,
- "policy": {
- "confirmations": 150,
- "required_lantency_ms": 500
- }
-}
-```
-
### /list-nodes
__method:__ POST
[
{
"alias": "cobo",
- "pubkey": "b928e46bb01e834fdf167185e31b15de7cc257af8bbdf17f9c7fefd5bb97b306d048b6bc0da2097152c1c2ff38333c756a543adbba7030a447dcc776b8ac64ef",
+ "public_key": "b928e46bb01e834fdf167185e31b15de7cc257af8bbdf17f9c7fefd5bb97b306d048b6bc0da2097152c1c2ff38333c756a543adbba7030a447dcc776b8ac64ef",
"host": "vapornode.cobo.com",
"port": 123,
"best_height": 1023,
},
{
"alias": "matpool",
- "pubkey": "0f8669abbd3cc0a167156188e428f940088d5b2f36bb3449df71d2bdc5e077814ea3f68628eef279ed435f51ee26cff00f8bd28fabfd500bedb2a9e369f5c825",
+ "public_key": "0f8669abbd3cc0a167156188e428f940088d5b2f36bb3449df71d2bdc5e077814ea3f68628eef279ed435f51ee26cff00f8bd28fabfd500bedb2a9e369f5c825",
"host": "vapornode.matpool.io",
"port": 321,
"best_height": 1024,
```
+### /get-node-statistics
\ No newline at end of file
"bootstrap_nodes" : [
{
"alias" : "matpool",
- "pubkey" : "0f8669abbd3cc0a167156188e428f940088d5b2f36bb3449df71d2bdc5e077814ea3f68628eef279ed435f51ee26cff00f8bd28fabfd500bedb2a9e369f5c825",
+ "public_key" : "0f8669abbd3cc0a167156188e428f940088d5b2f36bb3449df71d2bdc5e077814ea3f68628eef279ed435f51ee26cff00f8bd28fabfd500bedb2a9e369f5c825",
"host": "vapornode.matpool.io",
"port": 321,
}
USE `precog`;
-# Dump of table chains
-# ------------------------------------------------------------
-
-CREATE TABLE `chains` (
- `id` tinyint(1) NOT NULL AUTO_INCREMENT,
- `best_height` int(11) DEFAULT '0',
- `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-LOCK TABLES `chains` WRITE;
-UNLOCK TABLES;
-
-
# Dump of table nodes
# ------------------------------------------------------------
CREATE TABLE `nodes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`alias` varchar(128) NOT NULL DEFAULT '',
- `pub_key` char(128) NOT NULL DEFAULT '',
+ `public_key` char(128) NOT NULL DEFAULT '',
`host` varchar(128) NOT NULL DEFAULT '',
`port` smallint unsigned NOT NULL DEFAULT '0',
`best_height` int(11) DEFAULT '0',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
- UNIQUE KEY `pub_key` (`pub_key`),
+ UNIQUE KEY `public_key` (`public_key`),
UNIQUE KEY `host_port` (`host`,`port`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
}
type Node struct {
- Alias string `json:"alias"`
- PubKey chainkd.XPub `json:"pubkey"`
- Host string `json:"host"`
- Port uint16 `json:"port"`
+ Alias string `json:"alias"`
+ PublicKey chainkd.XPub `json:"public_key"`
+ Host string `json:"host"`
+ Port uint16 `json:"port"`
}
type API struct {
+++ /dev/null
-package orm
-
-import (
- "time"
-)
-
-type Chain struct {
- BestHeight uint64
- CreatedAt time.Time
- UpdatedAt time.Time
-}
type Node struct {
Alias string
- PubKey string
+ PublicKey string
Host string
Port uint16
BestHeight uint64
return json.Marshal(&struct {
Alias string `json:"alias"`
- PubKey string `json:"pubkey"`
+ PublicKey string `json:"public_key"`
Host string `json:"host"`
Port uint16 `json:"port"`
BestHeight uint64 `json:"best_height"`
Status string `json:"status"`
}{
Alias: n.Alias,
- PubKey: n.PubKey,
+ PublicKey: n.PublicKey,
Host: n.Host,
Port: n.Port,
BestHeight: n.BestHeight,
func (m *monitor) updateBootstrapNodes() {
for _, node := range m.cfg.Nodes {
ormNode := &orm.Node{
- PubKey: node.PubKey.String(),
+ PublicKey: node.PublicKey.String(),
Alias: node.Alias,
Host: node.Host,
Port: node.Port,
ActiveBeginTime: time.Now(),
}
- if err := m.db.Where(&orm.Node{PubKey: ormNode.PubKey}).
+ if err := m.db.Where(&orm.Node{PublicKey: ormNode.PublicKey}).
Assign(&orm.Node{
Alias: node.Alias,
Host: node.Host,