QBFT Methods
The QBFT
API methods provide access to the QBFT consensus engine.
Note
The QBFT
API methods are not enabled by default for JSON-RPC. To enable the QBFT
API methods, use the --rpc-http-api
or --rpc-ws-api
options.
qbft_discardValidatorVote
qbft_discardValidatorVote
Discards a proposal to add or remove a validator with the specified address.
Parameters
address
: string - 20-byte address of proposed validator
Returns
result
: boolean - indicates if the proposal is discarded
qbft_getPendingVotes
qbft_getPendingVotes
Returns votes cast in the current epoch.
Parameters
None
Returns
result
: map of strings to booleans - map of account addresses to corresponding boolean values indicating the vote for each account; if true
, the vote is to add a validator. If false
, the proposal is to remove a validator.
qbft_getSignerMetrics
qbft_getSignerMetrics
Provides the following validator metrics for the specified range:
Number of blocks from each validator
Block number of the last block proposed by each validator (if any proposed in the specified range)
All validators present in the last block of the range
Parameters
fromBlockNumber
: string - integer representing a block number or the string tagearliest
as described in Block ParametertoBlockNumber
: string - integer representing a block number or one of the string tagslatest
orpending
, as described in Block Parameter
If you specify:
No parameters, the call provides metrics for the last 100 blocks, or all blocks if there are less than 100 blocks.
Only the first parameter, the call provides metrics for all blocks from the block specified to the latest block.
Returns
result
: array of objects - list of validator objects
Note
The proposer of the genesis block has address 0x0000000000000000000000000000000000000000
.
qbft_getValidatorsByBlockHash
qbft_getValidatorsByBlockHash
Lists the validators defined in the specified block.
Parameters
block
: string - 32-byte block hash
Returns
result
: array of strings - list of validator addresses
qbft_getValidatorsByBlockNumber
qbft_getValidatorsByBlockNumber
Lists the validators defined in the specified block.
Parameters
blockNumber
: string - integer representing a block number or one of the string tagslatest
,earliest
, orpending
, as described in Block Parameter
Returns
result
: array of strings - list of validator addresses
qbft_proposeValidatorVote
qbft_proposeValidatorVote
Proposes to add or remove a validator with the specified address.
Parameters
address
: string - account addressproposal
: boolean -true
to propose adding validator orfalse
to propose removing validator
Returns
Last updated