getConsensusStatus
返回指定群组内的共识状态信息
参数
groupID
:unsigned int
- 群组ID
返回值
object
- 共识状态信息。- 当共识机制为PBFT时(PBFT详细设计参考PBFT设计文档),字段如下:
accountType
:unsigned int
- 账户类型allowFutureBlocks
:bool
- 允许未来块标志cfgErr
:bool
- 配置错误标志connectedNodes
:unsigned int
- 连接的节点数consensusedBlockNumber
:unsigned int
- 下一个共识的最新块高currentView
:unsigned int
- 当前视图groupId
:unsigned int
- 群组IDhighestblockHash
:string
- 最新块哈希highestblockNumber
:unsigned int
- 最新区块高度leaderFailed
:bool
- leader失败标志max_faulty_leader
:unsigned int
- 最大容错节点数sealer.index
:string
- 节点序号为index的nodeIdnode index
:unsigned int
- 节点的序号nodeId
:string
- 节点的IDnodeNum
:unsigned int
- 节点的数omitEmptyBlock
:bool
- 忽略空块标志位protocolId
:unsigned int
- 协议ID号toView
:unsigned int
- 目前到达的view值prepareCache_blockHash
:string
- prepareCache哈希prepareCache_height
:int
- prepareCache高度prepareCache_idx
:unsigned int
- prepareCache序号prepareCache_view
:unsigned int
- prepareCache视图rawPrepareCache_blockHash
:string
- rawPrepareCache哈希rawPrepareCache_height
:int
- rawPrepareCache高度rawPrepareCache_idx
:unsigned int
- rawPrepareCache序号rawPrepareCache_view
:unsigned int
- rawPrepareCache视图committedPrepareCache_blockHash
:string
- committedPrepareCache哈希committedPrepareCache_height
:int
- committedPrepareCache高度committedPrepareCache_idx
:unsigned int
- committedPrepareCache序号committedPrepareCache_view
:unsigned int
- committedPrepareCache视图futureCache_blockHash
:string
-futureCache哈希futureCache_height
:int
- futureCache高度futureCache_idx
:unsigned int
- futureCache序号signCache_cachedSize
:unsigned int
- signCache_cached大小commitCache_cachedSize
:unsigned int
- commitCache_cached大小viewChangeCache_cachedSize
:unsigned int
- viewChangeCache_cached大小
- 当共识机制为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":4,
- "currentView":153,
- "groupId":1,
- "highestblockHash":"0x98e186095a88f7b1b4cd02e3c405f031950577626dab55b639e024b9f2f8788b",
- "highestblockNumber":3,
- "leaderFailed":false,
- "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":264,
- "toView":153
- },
- {
- "prepareCache_blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
- "prepareCache_height":-1,
- "prepareCache_idx":"65535",
- "prepareCache_view":"9223372036854775807"
- },
- {
- "rawPrepareCache_blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
- "rawPrepareCache_height":-1,
- "rawPrepareCache_idx":"65535",
- "rawPrepareCache_view":"9223372036854775807"
- },
- {
- "committedPrepareCache_blockHash":"0x2e4c63cfac7726691d1fe436ec05a7c5751dc4150d724822ff6c36a608bb39f2",
- "committedPrepareCache_height":3,
- "committedPrepareCache_idx":"2",
- "committedPrepareCache_view":"60"
- },
- {
- "futureCache_blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
- "futureCache_height":-1,
- "futureCache_idx":"65535",
- "futureCache_view":"9223372036854775807"
- },
- {
- "signCache_cachedSize":"0"
- },
- {
- "commitCache_cachedSize":"0"
- },
- {
- "viewChangeCache_cachedSize":"0"
- }
- ]
- }
- // 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 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 FISCO BCOS .