fetchConsensusState
Returns a Set of all the leaders with there address, voting power and priority.
This method does not require any arguments.
Parameter | Type | Description |
---|---|---|
params | array | An empty array [] as no parameters are required. |
Result
ConsensusDataWithBlock
Object that holds the inner data and the current block its valid for.
Data
: Address, (Address of the leader),Block
: Number, (block number in which this data is valid for)
Code Sample
curl "NODE_URL" -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 0,
"method": "consensus_fetchConsensusState",
"params": []
}
'
Response
{
"jsonrpc": "2.0",
"id": "0",
"result": {
"data": [
{
"peer_id": "0x23412341",
"voting_power": 213123,
"priority": -1231,
},
{
"peer_id": "0x111234",
"voting_power": 3123,
"priority": 231,
}
],
"block": 1243123
}
}