node_getNodes
获取节点信息。
Parameters
无
Returns
[<PeerInfo>]
- PeerInfo对象字段如下
id
:<number>
- 该节点id。ip
:<string>
- 该节点IP地址。port
:<number>
- 该节点的grpc端口号。namespace
:<string>
- 该节点所在分区。hash
:<string>
- 该节点哈希值。hostname
:<string>
- 节点主机名。isPrimary
:<bool>
- 表示该节点是否为主节点。isvp
:<bool>
- 表示该节点是否为VP节点。status
:<number>
- 表示该节点的状态,值为0
表示节点处于Alive状态,值为1
表示节点处于Pending状态,值为2
表示节点处于Stop状态。delay
:<number>
- 表示该节点与本节点的延迟时间(单位ns),若为0,则为本节点。
Example
- # Request
- curl -X POST --data '{"jsonrpc": "2.0", "namespace":"global", "method": "node_getNodes", "params": [],"id":1}'
- # Response
- {
- "jsonrpc": "2.0",
- "namespace": "global",
- "id": 1,
- "code": 0,
- "message": "SUCCESS",
- "result": [
- {
- "id": 1,
- "ip": "127.0.0.1",
- "port": "50011",
- "namespace": "global",
- "hash": "fa34664ec14727c34943045bcaba9ef05d2c48e06d294c15effc900a5b4b663a",
- "hostname": "node1",
- "isPrimary": true,
- "isvp": true,
- "status": 0,
- "delay": 0
- },
- {
- "id": 2,
- "ip": "127.0.0.1",
- "port": "50012",
- "namespace": "global",
- "hash": "c82a71a88c58540c62fc119e78306e7fdbe114d9b840c47ab564767cb1c706e2",
- "hostname": "node2",
- "isPrimary": false,
- "isvp": true,
- "status": 0,
- "delay": 347529
- },
- {
- "id": 3,
- "ip": "127.0.0.1",
- "port": "50013",
- "namespace": "global",
- "hash": "0c89dc7d8bdf45d1fed89fdbac27463d9f144875d3d73795f64f35dc204480fd",
- "hostname": "node3",
- "isPrimary": false,
- "isvp": true,
- "status": 0,
- "delay": 369554
- },
- {
- "id": 4,
- "ip": "127.0.0.1",
- "port": "50014",
- "namespace": "global",
- "hash": "34d299742260716bab353995fe98727004b5c27bde52489f61de093176e82088",
- "hostname": "node4",
- "isPrimary": false,
- "isvp": true,
- "status": 0,
- "delay": 430356
- }
- ]
- }
当前内容版权归 Hyperchain 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Hyperchain .