💎 Ethereum

debug_traceBlockByNumber RPC Method

The debug_traceBlockByNumber returns traces for a full block, for all transactions in the block.


You can use debug_traceBlockByNumber with no fee here 👉 chainnodes.org (opens in a new tab)


  • blockNumber or Tag - Block number as hexadecimal or the Tag ("latest", "earliest", "pending", "safe" or "finalized").

"Safe" and "finalized" are only availible on Ethereum and Arbitrum One chains. Read block parameter description (opens in a new tab).

  • tracer object - [REQUIRED] - with :

    • The type of tracer - String - It might be callTracer or prestateTracer

      • callTracer - The calltracer keeps track of all call frames, including depth 0 calls, that are made during a transaction.

      • prestateTracer - The prestateTracer replays the transaction and tracks every part of state that occured during the transaction.

    • tracerConfig - The object to specify the configurations of the tracer

      • onlyTopCall - When set to true, this will only trace the primary (top-level) call and not any sub-calls. It eliminates the additional processing for each call frame.

Please note! tracer object parameter is REQUIRED. Leaving the tracer object paramener empty will end in a TIMEOUT ERROR.


callTracer response

type of the callType of the call
fromThe transaction sender.
toThe address of the transaction recipient.
gasThe gas included in the transaction by the sender.
transaction valueThe actual value per gas deducted from the sender's account.
gasUsedThe total used gas by the call. Encoded as hexadecimal.
inputThe optional input data sent with the transaction, usually used to interact with smart contracts.
outputThe return value of the call, encoded as a hexadecimal string.
errorAn error message in case the execution failed.
callsA list of sub-calls made by the contract during the call, each represented as a nested call frame object.
revertReasonThe reason why the transaction was reverted, returned by the smart contract if any.

prestateTracer response

  • smart contract address — The address of the smart contract associated with the result.

    • balance — The balance of the contract, expressed in wei and encoded as a hexadecimal string.

    • code — The bytecode of the contract, encoded as a hexadecimal string.

    • nonce — The nonce of the account associated with the contract, represented as an unsigned integer.

    • storage — A map of key-value pairs representing the storage slots of the contract. The keys and values are both encoded as hexadecimal strings.


POST https://<network>.chainnodes.org/YOUR-API-KEY


💡 Confusing?

Ask our experienced blockchain developers in Telegram

  • HTTPS POST Request with a JSON RPC call in the body
  • Replace YOUR-API-KEY with the API key from your Chainnodes.org Dashboard
  • You can use a different supported network by replacing mainnet
curl https://mainnet.chainnodes.org/YOUR-API-KEY \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"method":"debug_traceBlockByNumber","params":["latest", {"tracer": "callTracer"}],"id":1,"jsonrpc":"2.0"}'


{"jsonrpc": "2.0",
    "id": 1,
    "result": [
            "result": {
                "from": "0x64bbde373e909501de1309231336761adeaa07d5",
                "gas": "0x4b26c",
                "gasUsed": "0x2a421",
                "to": "0xa57bd00134b2850b2a1c55860c9e9ea100fdd6cf",
                "calls": [
                        "from": "0xa57bd00134b2850b2a1c55860c9e9ea100fdd6cf",
                        "gas": "0x49451", 

Need RPC API keys?

Get 12.5M archival requests for free today.