Skip to main content
Version: v3.3

erigon

Erigon provides several specialized RPC namespaces that extend beyond the standard Ethereum JSON-RPC API. These namespaces offer optimized access to blockchain data and expose Erigon-specific functionality that takes advantage of the node's unique architecture and data structures. The primary Erigon-specific namespace is erigon_ which offer extended blockchain data access methods.

These methods must be explicitly enabled using the --http.api flag when starting the RPC daemon.

Namespace Availability

  • The erigon_ namespace is enabled by default in the RPC daemon and must be explicitly included in the --http.api flag if customizing enabled namespaces.

Performance Considerations

  • Erigon-specific methods are optimized for Erigon's architecture and often provide better performance than standard equivalents
  • Methods like erigon_getHeaderByNumber and erigon_getHeaderByHash can be faster as they skip transaction and uncle data
  • The erigon_getLatestLogs method includes advanced pagination to handle large result sets efficiently

Enhanced Features

  • erigon_getLatestLogs supports ignoreTopicsOrder for flexible topic matching
  • erigon_getLogs returns enhanced ErigonLog objects with additional metadata like timestamps
  • erigon_getBlockByTimestamp uses binary search for efficient timestamp-based block lookup

See more details here about implementation status.


erigon_forks

Returns the genesis block hash and a sorted list of all fork block numbers for the current chain configuration.

Parameters

None

Example

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

Returns

TypeDescription
ObjectContains genesis hash and fork information
genesisDATA, 32 BYTES - The genesis block hash
heightForksARRAY - Array of block numbers where height-based forks occur
timeForksARRAY - Array of timestamps where time-based forks occur

erigon_blockNumber

Returns the latest executed block number. Unlike eth_blockNumber, this method can accept a specific block number parameter and returns the latest executed block rather than the fork choice head after the merge.

Parameters

ParameterTypeDescription
blockNumberQUANTITY (optional)Block number to query. If omitted, returns latest executed block number

Example

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

Returns

TypeDescription
QUANTITYThe block number as hexadecimal

erigon_getHeaderByNumber

Returns a block header by block number, ignoring transaction and uncle data for potentially faster response times.

Parameters

ParameterTypeDescription
blockNumberQUANTITY|TAGBlock number or "latest", "earliest", "pending"

Example

curl -s --data '{"jsonrpc":"2.0","method":"erigon_getHeaderByNumber","params":["0x1b4"],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545

Returns

TypeDescription
ObjectBlock header object with all header fields

erigon_getHeaderByHash

Returns a block header by block hash, ignoring transaction and uncle data for potentially faster response times.

Parameters

ParameterTypeDescription
blockHashDATA, 32 BYTESHash of the block

Example

curl -s --data '{"jsonrpc":"2.0","method":"erigon_getHeaderByHash","params":["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545

Returns

TypeDescription
ObjectBlock header object with all header fields

erigon_getBlockByTimestamp

Returns a block by timestamp using binary search to find the closest block to the specified timestamp.

Parameters

ParameterTypeDescription
timestampQUANTITYUnix timestamp
fullTxBooleanIf true, include full transaction objects; if false, only transaction hashes

Example

curl -s --data '{"jsonrpc":"2.0","method":"erigon_getBlockByTimestamp","params":["0x5ddf2094", false],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545

Returns

TypeDescription
ObjectBlock object matching closest to the timestamp

erigon_getBalanceChangesInBlock

Returns all account balance changes that occurred within a specific block.

Parameters

ParameterTypeDescription
blockNrOrHashQUANTITY|TAG|HASHBlock number, tag, or block hash

Example

curl -s --data '{"jsonrpc":"2.0","method":"erigon_getBalanceChangesInBlock","params":["0x1b4"],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545

Returns

TypeDescription
ObjectMapping of addresses to their new balance values

erigon_getLogsByHash

Returns an array of arrays of logs generated by transactions in a block given by block hash.

Parameters

ParameterTypeDescription
blockHashDATA, 32 BYTESHash of the block

Example

curl -s --data '{"jsonrpc":"2.0","method":"erigon_getLogsByHash","params":["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545

Returns

TypeDescription
ArrayArray of arrays of log objects, one array per transaction

erigon_getLogs

Returns an array of logs matching a given filter object with enhanced filtering capabilities.

Parameters

ParameterTypeDescription
filterObjectFilter criteria including fromBlock, toBlock, address, topics, and blockHash

Example

curl -s --data '{"jsonrpc":"2.0","method":"erigon_getLogs","params":[{"fromBlock":"0x1","toBlock":"0x2","address":"0x8888f1f195afa192cfee860698584c030f4c9db1"}],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545

Returns

TypeDescription
ArrayArray of ErigonLog objects with enhanced metadata

erigon_getLatestLogs

Returns the latest logs matching a filter criteria in descending order with advanced pagination and topic matching options.

Parameters

ParameterTypeDescription
filterObjectFilter criteria object
logOptionsObjectOptions including logCount, blockCount, and ignoreTopicsOrder

Example

curl -s --data '{"jsonrpc":"2.0","method":"erigon_getLatestLogs","params":[{"address":"0x8888f1f195afa192cfee860698584c030f4c9db1"},{"logCount":100,"ignoreTopicsOrder":true}],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545

Returns

TypeDescription
ArrayArray of ErigonLog objects in descending chronological order

erigon_getBlockReceiptsByBlockHash

Returns all transaction receipts for a canonical block by block hash.

Parameters

ParameterTypeDescription
blockHashDATA, 32 BYTESHash of the canonical block

Example

curl -s --data '{"jsonrpc":"2.0","method":"erigon_getBlockReceiptsByBlockHash","params":["0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2"],"id":"1"}' -H "Content-Type: application/json" -X POST http://localhost:8545

Returns

TypeDescription
ArrayArray of receipt objects for all transactions in the block

erigon_nodeInfo

Returns a collection of metadata known about the host node and connected peers.

Parameters

None

Example

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

Returns

TypeDescription
ArrayArray of NodeInfo objects containing peer and node metadata