ViNo-community/vite-node-bot

Add command for Node Name

Closed this issue · 2 comments

Add command for Node Name

https://docs.vite.org/go-vite/api/rpc/net.html#net-nodeinfo

Input

{
	"jsonrpc": "2.0",
	"id": 3,
	"method": "net_nodeInfo",
	"params": null
}

Output

{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "name": "vite-sbp-0",
    "netId": 1,
    "address": "0.0.0.0:8483",
    "peerCount": 2,
    "peers": [
      {
        "name": "vite-sbp-1",
        "height": 726575,
        "address": "119.28.221.175:8483",
        "createAt": "2019-05-31 03:05:09"
      },
      {
        "name": "vite-full-node",
        "height": 726576,
        "address": "117.50.66.76:8483",
        "createAt": "2019-05-31 12:33:44"
      },
    ]
  }
}

vtest!node

Vite Node Test Bot
BOT
— Today at 11:10 PM
Name: node1
ID: cba28403700a8182883f3a2eaae23aecceb27de41c0ea0c2b68b1ca33142924a
Net ID 9
Peer Count: 2
[11:10 PM]
Peer #1
Name: node3
Height: 8947176
Address 127.0.0.1:58778
Time Created: 2021-06-16 15:01:57
[11:10 PM]
Peer #2
Name: node2
Height: 8947176
Address 127.0.0.1:8802
Time Created: 2021-06-16 15:01:57