getConsensusStatus
返回指定群组内的共识状态信息
参数
groupID
:unsigned int
- 群组ID
返回值
object
- 共识状态信息。- 当共识机制为PBFT时(PBFT详细设计参考PBFT设计文档),字段如下:
accountType
:unsigned int
- 节点类型,0表示观察节点,1表示共识节点allowFutureBlocks
:bool
- 允许未来块标志,当前为truecfgErr
:bool
- 表明节点是否出错,true表示节点已经异常connectedNodes
:unsigned int
- 连接的节点数consensusedBlockNumber
:unsigned int
- 当前正在共识的区块高度currentView
:unsigned int
- 当前视图groupId
:unsigned int
- 群组IDhighestblockHash
:string
- 最新块哈希highestblockNumber
:unsigned int
- 最新区块高度leaderFailed
:bool
- leader失败标志,若为false,节点可能正在处理超时max_faulty_leader
:unsigned int
- 最大容错节点数nodeNum
:unsigned int
- 节点的数node_index
:unsigned int
- 共识节点索引nodeId
:string
- 节点的IDomitEmptyBlock
:bool
- 忽略空块标志位,为trueprotocolId
:unsigned int
- 协议ID号sealer.index
:string
- 指定索引index
对应的共识节点nodeIDtoView
:unsigned int
- 目前到达的view值- 与本节点相连的所有共识节点nodeID和视图view信息
- 当共识机制为Raft时(Raft详细设计参考Raft设计文档),字段如下:
accountType
:unsigned int
- 账户类型allowFutureBlocks
:bool
- 允许未来块标志cfgErr
:bool
- 配置错误标志consensusedBlockNumber
:unsigned int
- 下一个共识的最新块高groupId
:unsigned int
- 群组IDhighestblockHash
:string
- 最新块哈希highestblockNumber
:unsigned int
- 最新区块高度leaderId
:string
- leader的nodeIdleaderIdx
:unsigned int
- leader的序号max_faulty_leader
:unsigned int
- 最大容错节点数sealer.index
:string
- 节点序号为index的nodeIdnode index
:unsigned int
- 节点的indexnodeId
:string
- 节点的IDnodeNum
:unsigned int
- 节点的数omitEmptyBlock
:bool
- 忽略空块标志位protocolId
:unsigned int
- 协议ID号
- 示例
// Request PBFT
curl -X POST --data '{"jsonrpc":"2.0","method":"getConsensusStatus","params":[1],"id":1}' http://127.0.0.1:8545 |jq
// Result
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"accountType": 1,
"allowFutureBlocks": true,
"cfgErr": false,
"connectedNodes": 3,
"consensusedBlockNumber": 38207,
"currentView": 54477,
"groupId": 1,
"highestblockHash": "0x19a16e8833e671aa11431de589c866a6442ca6c8548ba40a44f50889cd785069",
"highestblockNumber": 38206,
"leaderFailed": false,
"max_faulty_leader": 1,
"nodeId": "f72648fe165da17a889bece08ca0e57862cb979c4e3661d6a77bcc2de85cb766af5d299fec8a4337eedd142dca026abc2def632f6e456f80230902f93e2bea13",
"nodeNum": 4,
"node_index": 3,
"omitEmptyBlock": true,
"protocolId": 65544,
"sealer.0": "6a99f357ecf8a001e03b68aba66f68398ee08f3ce0f0147e777ec77995369aac470b8c9f0f85f91ebb58a98475764b7ca1be8e37637dd6cb80b3355749636a3d",
"sealer.1": "8a453f1328c80b908b2d02ba25adca6341b16b16846d84f903c4f4912728c6aae1050ce4f24cd9c13e010ce922d3393b846f6f5c42f6af59c65a814de733afe4",
"sealer.2": "ed483837e73ee1b56073b178f5ac0896fa328fc0ed418ae3e268d9e9109721421ec48d68f28d6525642868b40dd26555c9148dbb8f4334ca071115925132889c",
"sealer.3": "f72648fe165da17a889bece08ca0e57862cb979c4e3661d6a77bcc2de85cb766af5d299fec8a4337eedd142dca026abc2def632f6e456f80230902f93e2bea13",
"toView": 54477
},
[
{
"nodeId": "6a99f357ecf8a001e03b68aba66f68398ee08f3ce0f0147e777ec77995369aac470b8c9f0f85f91ebb58a98475764b7ca1be8e37637dd6cb80b3355749636a3d",
"view": 54474
},
{
"nodeId": "8a453f1328c80b908b2d02ba25adca6341b16b16846d84f903c4f4912728c6aae1050ce4f24cd9c13e010ce922d3393b846f6f5c42f6af59c65a814de733afe4",
"view": 54475
},
{
"nodeId": "ed483837e73ee1b56073b178f5ac0896fa328fc0ed418ae3e268d9e9109721421ec48d68f28d6525642868b40dd26555c9148dbb8f4334ca071115925132889c",
"view": 54476
},
{
"nodeId": "f72648fe165da17a889bece08ca0e57862cb979c4e3661d6a77bcc2de85cb766af5d299fec8a4337eedd142dca026abc2def632f6e456f80230902f93e2bea13",
"view": 54477
}
]
]
}
// Request Raft
curl -X POST --data '{"jsonrpc":"2.0","method":"getConsensusStatus","params":[1],"id":1}' http://127.0.0.1:8545 |jq
// Result
{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"accountType": 1,
"allowFutureBlocks": true,
"cfgErr": false,
"consensusedBlockNumber": 1,
"groupId": 1,
"highestblockHash": "0x4765a126a9de8d876b87f01119208be507ec28495bef09c1e30a8ab240cf00f2",
"highestblockNumber": 0,
"leaderId": "d5b3a9782c6aca271c9642aea391415d8b258e3a6d92082e59cc5b813ca123745440792ae0b29f4962df568f8ad58b75fc7cea495684988e26803c9c5198f3f8",
"leaderIdx": 3,
"max_faulty_leader": 1,
"sealer.0": "29c34347a190c1ec0c4507c6eed6a5bcd4d7a8f9f54ef26da616e81185c0af11a8cea4eacb74cf6f61820292b24bc5d9e426af24beda06fbd71c217960c0dff0",
"sealer.1": "41285429582cbfe6eed501806391d2825894b3696f801e945176c7eb2379a1ecf03b36b027d72f480e89d15bacd43462d87efd09fb0549e0897f850f9eca82ba",
"sealer.2": "87774114e4a496c68f2482b30d221fa2f7b5278876da72f3d0a75695b81e2591c1939fc0d3fadb15cc359c997bafc9ea6fc37345346acaf40b6042b5831c97e1",
"sealer.3": "d5b3a9782c6aca271c9642aea391415d8b258e3a6d92082e59cc5b813ca123745440792ae0b29f4962df568f8ad58b75fc7cea495684988e26803c9c5198f3f8",
"node index": 1,
"nodeId": "41285429582cbfe6eed501806391d2825894b3696f801e945176c7eb2379a1ecf03b36b027d72f480e89d15bacd43462d87efd09fb0549e0897f850f9eca82ba",
"nodeNum": 4,
"omitEmptyBlock": true,
"protocolId": 267
}
]
}
当前内容版权归 fisco-bcos.org 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 fisco-bcos.org .