erigon
Erigon-Specific Methods for Optimized Data Access
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.apiflag 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_getHeaderByNumberanderigon_getHeaderByHashcan be faster as they skip transaction and uncle dataThe
erigon_getLatestLogsmethod includes advanced pagination to handle large result sets efficiently
Enhanced Features
erigon_getLatestLogssupportsignoreTopicsOrderfor flexible topic matchingerigon_getLogsreturns enhanced ErigonLog objects with additional metadata like timestampserigon_getBlockByTimestampuses 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
Returns
Object
Contains genesis hash and fork information
genesis
DATA, 32 BYTES - The genesis block hash
heightForks
ARRAY - Array of block numbers where height-based forks occur
timeForks
ARRAY - 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
blockNumber
QUANTITY (optional)
Block number to query. If omitted, returns latest executed block number
Example
Returns
QUANTITY
The block number as hexadecimal
erigon_getHeaderByNumber
Returns a block header by block number, ignoring transaction and uncle data for potentially faster response times.
Parameters
blockNumber
QUANTITY|TAG
Block number or "latest", "earliest", "pending"
Example
Returns
Object
Block 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
blockHash
DATA, 32 BYTES
Hash of the block
Example
Returns
Object
Block 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
timestamp
QUANTITY
Unix timestamp
fullTx
Boolean
If true, include full transaction objects; if false, only transaction hashes
Example
Returns
Object
Block object matching closest to the timestamp
erigon_getBalanceChangesInBlock
Returns all account balance changes that occurred within a specific block.
Parameters
blockNrOrHash
QUANTITY|TAG|HASH
Block number, tag, or block hash
Example
Returns
Object
Mapping 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
blockHash
DATA, 32 BYTES
Hash of the block
Example
Returns
Array
Array 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
filter
Object
Filter criteria including fromBlock, toBlock, address, topics, and blockHash
Example
Returns
Array
Array 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
filter
Object
Filter criteria object
logOptions
Object
Options including logCount, blockCount, and ignoreTopicsOrder
Example
Returns
Array
Array of ErigonLog objects in descending chronological order
erigon_getBlockReceiptsByBlockHash
Returns all transaction receipts for a canonical block by block hash.
Parameters
blockHash
DATA, 32 BYTES
Hash of the canonical block
Example
Returns
Array
Array 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
Returns
Array
Array of NodeInfo objects containing peer and node metadata
Last updated
Was this helpful?