For AI agents: a documentation index is available at /llms.txt. Markdown versions of pages are available by appending .md to any documentation URL.
Skip to main content

IBFT methods

The IBFT API methods provide access to the IBFT 2.0 consensus engine.

note

The IBFT API is not enabled by default for JSON-RPC. Enable it using the --rpc-http-api or --rpc-ws-api option.

ibft_discardValidatorVote

Discards a proposal to add or remove a validator with the specified address.

Parameters

  • address: string - 20-byte address of the proposed validator.

Returns

  • Indicates if the proposal is discarded.

Example

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "ibft_discardValidatorVote",
"params": [
"0xef1bfb6a12794615c9b0b5a21e6741f01e570185"
],
"id": 1
}'

ibft_getPendingVotes

Returns votes cast in the current epoch.

Parameters

  • None

Returns

  • Account addresses mapped to boolean values indicating the vote for each account. true is a vote to add a validator; false is a vote to remove a validator.

Example

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "ibft_getPendingVotes",
"params": [],
"id": 1
}'

ibft_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 - (Optional) Hexadecimal integer representing a block number, or one of the string tags latest, earliest, pending, finalized, or safe, as described in block parameter.

  • toBlockNumber: string - (Optional) Hexadecimal integer representing a block number, or one of the string tags latest, earliest, pending, finalized, or safe, as described in block parameter.

note

pending returns the same value as latest.

If you specify:

  • No parameters, the call provides metrics for the last 100 blocks, or all blocks if there are fewer than 100 blocks.
  • Only the first parameter, the call provides metrics for all blocks from the specified block to the latest block.

Returns

  • List of validator objects.

    • address: string - Address of the validator.

      note

      The proposer of the genesis block has address 0x0000000000000000000000000000000000000000.

    • proposedBlockCount: string - Hexadecimal integer representing the number of blocks proposed by the validator in the specified range.

    • lastProposedBlockNumber: string - Hexadecimal integer representing the block number of the last block proposed by the validator in the specified range.

Example

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "ibft_getSignerMetrics",
"params": [
"0x1",
"0x64"
],
"id": 1
}'

ibft_getValidatorsByBlockHash

Lists the validators defined in the specified block.

Parameters

  • block: string - 32-byte block hash.

Returns

  • List of validator addresses.

Example

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "ibft_getValidatorsByBlockHash",
"params": [
"0xbae7d3feafd743343b9a4c578cab5e5d65eb735f6855fb845c00cab356331256"
],
"id": 1
}'

ibft_getValidatorsByBlockNumber

Lists the validators defined in the specified block.

Parameters

  • blockNumber: string - Hexadecimal integer representing a block number, or one of the string tags latest, earliest, pending, finalized, or safe, as described in block parameter.

    note

    pending returns the same value as latest.

Returns

  • List of validator addresses.

Example

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "ibft_getValidatorsByBlockNumber",
"params": [
"latest"
],
"id": 1
}'

ibft_proposeValidatorVote

Proposes to add or remove a validator with the specified address.

Parameters

  • address: string - Account address.

  • proposal: boolean - true to propose adding a validator, or false to propose removing a validator.

Returns

  • true

Example

curl -X POST http://127.0.0.1:8545/ \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "ibft_proposeValidatorVote",
"params": [
"0x42d4287eac8078828cf5f3486cfe601a275a49a5",
true
],
"id": 1
}'