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

Getters

These methods retrieve bad blocks and raw, RLP-encoded blocks, headers, receipts, and transactions.

debug_getBadBlocks

Returns a list of invalid blocks. This is used to detect and analyze consensus flaws.

Parameters

  • None

Returns

  • List of block objects.

    • number: quantity, integer - Block number. null when block is pending.

    • hash: data, 32 bytes - Hash of the block. null when block is pending.

    • parentHash: data, 32 bytes - Hash of the parent block.

    • nonce: data, 8 bytes - Hash of the generated proof of work. null when block is pending.

    • sha3Uncles: data, 32 bytes - SHA3 of the uncle's data in the block.

    • logsBloom: data, 256 bytes - Bloom filter for the block logs. null when block is pending.

    • transactionsRoot: data, 32 bytes - Root of the transaction trie for the block.

    • stateRoot: data, 32 bytes - Root of the final state trie for the block.

    • receiptsRoot: data, 32 bytes - Root of the receipts trie for the block.

    • miner: data, 20 bytes - Address to pay mining rewards to.

    • difficulty: quantity, integer - Difficulty for this block.

    • totalDifficulty: quantity, integer - Total difficulty of the chain until this block. This field is only returned for pre-merge (Proof of Work) blocks. This value will always be 0 for an uncle block.

    • extraData: data - Extra data field for this block. The first 32 bytes is vanity data you can set using the --miner-extra-data command line option. Stores extra data when used with IBFT.

    • size: quantity, integer - Size of block in bytes.

    • gasLimit: quantity - Maximum gas allowed in this block.

    • gasUsed: quantity - Total gas used by all transactions in this block.

    • timestamp: quantity - Hex-encoded Unix timestamp (in seconds) for block assembly.

    • transactions: array - Array of transaction objects, or 32 byte transaction hashes depending on the specified boolean parameter.

      • accessList: array - (Optional) List of addresses and storage keys the transaction plans to access. Used in ACCESS_LIST transactions and may be used in EIP1559 transactions.

      • blockHash: data, 32 bytes - Hash of the block containing this transaction. null when transaction is pending.

      • blockNumber: quantity - Block number of the block containing this transaction. null when transaction is pending.

      • blockTimestamp: quantity - Hex-encoded Unix timestamp (in seconds) of the block containing this transaction. null when transaction is pending.

      • chainId: quantity - Chain ID.

      • from: data, 20 bytes - Address of the sender.

      • gas: quantity - Gas provided by the sender.

      • gasPrice: quantity - (Optional) Gas price, in Wei, provided by the sender. Used only in non-EIP1559 transactions.

      • maxPriorityFeePerGas: quantity, integer - (Optional) Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Used only in EIP1559 transactions.

      • maxFeePerGas: quantity, integer - (Optional) Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Used only in EIP1559 transactions.

      • hash: data, 32 bytes - Hash of the transaction.

      • input: data - Data sent with the transaction to create or invoke a contract.

      • nonce: quantity - Number of transactions made by the sender before this one.

      • to: data, 20 bytes - Address of the receiver. null if a contract creation transaction.

      • transactionIndex: quantity, integer - Index position of the transaction in the block. null when transaction is pending.

      • transactionType: string - Transaction type.

      • value: quantity - Value transferred, in Wei.

      • v: quantity - ECDSA Recovery ID.

      • r: data, 32 bytes - ECDSA signature r.

      • s: data, 32 bytes - ECDSA signature s.

    • uncles: array - Array of uncle hashes.

    • baseFeePerGas: quantity - The block's base fee per gas. This field is empty for blocks created before EIP-1559.

Example

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

debug_getRawBlock

Returns the RLP encoding of 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

  • RLP-encoded block object.

    • number: quantity, integer - Block number. null when block is pending.

    • hash: data, 32 bytes - Hash of the block. null when block is pending.

    • parentHash: data, 32 bytes - Hash of the parent block.

    • nonce: data, 8 bytes - Hash of the generated proof of work. null when block is pending.

    • sha3Uncles: data, 32 bytes - SHA3 of the uncle's data in the block.

    • logsBloom: data, 256 bytes - Bloom filter for the block logs. null when block is pending.

    • transactionsRoot: data, 32 bytes - Root of the transaction trie for the block.

    • stateRoot: data, 32 bytes - Root of the final state trie for the block.

    • receiptsRoot: data, 32 bytes - Root of the receipts trie for the block.

    • miner: data, 20 bytes - Address to pay mining rewards to.

    • difficulty: quantity, integer - Difficulty for this block.

    • totalDifficulty: quantity, integer - Total difficulty of the chain until this block. This field is only returned for pre-merge (Proof of Work) blocks. This value will always be 0 for an uncle block.

    • extraData: data - Extra data field for this block. The first 32 bytes is vanity data you can set using the --miner-extra-data command line option. Stores extra data when used with IBFT.

    • size: quantity, integer - Size of block in bytes.

    • gasLimit: quantity - Maximum gas allowed in this block.

    • gasUsed: quantity - Total gas used by all transactions in this block.

    • timestamp: quantity - Hex-encoded Unix timestamp (in seconds) for block assembly.

    • transactions: array - Array of transaction objects, or 32 byte transaction hashes depending on the specified boolean parameter.

      • accessList: array - (Optional) List of addresses and storage keys the transaction plans to access. Used in ACCESS_LIST transactions and may be used in EIP1559 transactions.

      • blockHash: data, 32 bytes - Hash of the block containing this transaction. null when transaction is pending.

      • blockNumber: quantity - Block number of the block containing this transaction. null when transaction is pending.

      • blockTimestamp: quantity - Hex-encoded Unix timestamp (in seconds) of the block containing this transaction. null when transaction is pending.

      • chainId: quantity - Chain ID.

      • from: data, 20 bytes - Address of the sender.

      • gas: quantity - Gas provided by the sender.

      • gasPrice: quantity - (Optional) Gas price, in Wei, provided by the sender. Used only in non-EIP1559 transactions.

      • maxPriorityFeePerGas: quantity, integer - (Optional) Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Used only in EIP1559 transactions.

      • maxFeePerGas: quantity, integer - (Optional) Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Used only in EIP1559 transactions.

      • hash: data, 32 bytes - Hash of the transaction.

      • input: data - Data sent with the transaction to create or invoke a contract.

      • nonce: quantity - Number of transactions made by the sender before this one.

      • to: data, 20 bytes - Address of the receiver. null if a contract creation transaction.

      • transactionIndex: quantity, integer - Index position of the transaction in the block. null when transaction is pending.

      • transactionType: string - Transaction type.

      • value: quantity - Value transferred, in Wei.

      • v: quantity - ECDSA Recovery ID.

      • r: data, 32 bytes - ECDSA signature r.

      • s: data, 32 bytes - ECDSA signature s.

    • uncles: array - Array of uncle hashes.

    • baseFeePerGas: quantity - The block's base fee per gas. This field is empty for blocks created before EIP-1559.

Example

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

debug_getRawHeader

Returns the RLP encoding of the header of 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

  • RLP-encoded block header or error.

Example

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

debug_getRawReceipts

Returns the RLP encoding of the transaction receipts of 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

  • Array of RLP-encoded transaction receipts.

    • blockHash: data, 32 bytes - Hash of block containing this transaction.

    • blockNumber: quantity - Block number of block containing this transaction.

    • blockTimestamp: quantity - Hex-encoded unix timestamp (in seconds) of the block that includes this transaction.

    • contractAddress: data, 20 bytes - Contract address created, if contract creation transaction, otherwise, null. A failed contract creation transaction still produces a contract address value.

    • cumulativeGasUsed: quantity - Total amount of gas used by previous transactions in the block and this transaction.

    • effectiveGasPrice: quantity - The actual value per gas deducted from the sender's account.

    • from: data, 20 bytes - Address of the sender.

    • gasUsed: quantity - Amount of gas used by this specific transaction.

    • logs: array - Array of log objects generated by this transaction.

      • removed: tag - true if log removed because of a chain reorganization. false if a valid log.

      • logIndex: quantity, integer - Log index position in the block. null when log is pending.

      • transactionIndex: quantity, integer - Index position of the starting transaction for the log. null when log is pending.

      • transactionHash: data, 32 bytes - Hash of the starting transaction for the log. null when log is pending.

      • blockHash: data, 32 bytes - Hash of the block that includes the log. null when log is pending.

      • blockNumber: quantity - Number of block that includes the log. null when log is pending.

      • blockTimestamp: quantity - Hex-encoded unix timestamp (in seconds) of the block that includes the log.

      • address: data, 20 bytes - Address the log originated from.

      • data: data - Non-indexed arguments of the log.

      • topics: array of data, 32 bytes each - Event signature hash and 0 to 3 indexed log arguments.

    • logsBloom: data, 256 bytes - Bloom filter for light clients to quickly retrieve related logs.

    • status: quantity - Either 0x0 (failure), 0x1 (success), or 0x2 (invalid).

    • to: data, 20 bytes - Address of the receiver, if sending ether, otherwise, null.

    • transactionHash: data, 32 bytes - Hash of the transaction.

    • transactionIndex: quantity, integer - Index position of transaction in the block.

    • transactionType: string - Transaction type.

    • revertReason: string - ABI-encoded string that displays the reason for reverting the transaction. Only available if revert reason is enabled.

    • type: quantity - Transaction type, 0x00 for legacy transactions, 0x01 for access list types, 0x02 for dynamic fees, and 0x03 for blob transactions.

    • root: data, 32 bytes - Pre-Byzantium transactions return this field instead of status. Post-transaction state root.

Example

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

debug_getRawTransaction

Returns the RLP encoding of the specified transaction.

Parameters

  • transaction: string - 32-byte transaction hash.

Returns

  • RLP-encoded transaction object.

    • accessList: array - (Optional) List of addresses and storage keys the transaction plans to access. Used in ACCESS_LIST transactions and may be used in EIP1559 transactions.

    • blockHash: data, 32 bytes - Hash of the block containing this transaction. null when transaction is pending.

    • blockNumber: quantity - Block number of the block containing this transaction. null when transaction is pending.

    • blockTimestamp: quantity - Hex-encoded Unix timestamp (in seconds) of the block containing this transaction. null when transaction is pending.

    • chainId: quantity - Chain ID.

    • from: data, 20 bytes - Address of the sender.

    • gas: quantity - Gas provided by the sender.

    • gasPrice: quantity - (Optional) Gas price, in Wei, provided by the sender. Used only in non-EIP1559 transactions.

    • maxPriorityFeePerGas: quantity, integer - (Optional) Maximum fee, in Wei, the sender is willing to pay per gas above the base fee. Used only in EIP1559 transactions.

    • maxFeePerGas: quantity, integer - (Optional) Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. Used only in EIP1559 transactions.

    • hash: data, 32 bytes - Hash of the transaction.

    • input: data - Data sent with the transaction to create or invoke a contract.

    • nonce: quantity - Number of transactions made by the sender before this one.

    • to: data, 20 bytes - Address of the receiver. null if a contract creation transaction.

    • transactionIndex: quantity, integer - Index position of the transaction in the block. null when transaction is pending.

    • transactionType: string - Transaction type.

    • value: quantity - Value transferred, in Wei.

    • v: quantity - ECDSA Recovery ID.

    • r: data, 32 bytes - ECDSA signature r.

    • s: data, 32 bytes - ECDSA signature s.

Example

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