🛠️ debug_traceBlockByNumber
RPC Method (Base Chain)
The debug_traceBlockByNumber
method returns a complete trace of everything that happened in a block — every internal call, revert, and gas used by every transaction.
đź’ˇ
You can use debug_traceBlockByNumber with no fee 👉 chainnodes.org (opens in a new tab)
Parameters
blockNumber or Tag
— The block you want to trace. You can use a hexadecimal number like"0xA12BC"
or a keyword:"latest"
– the most recent block"earliest"
– the very first block"pending"
– not yet confirmed"safe"
or"finalized"
– only available on Ethereum and Arbitrum One
đź§ Read more about block parameters (opens in a new tab)
-
tracer object
— [REQUIRED] This tells the RPC how to trace the block.-
tracer
(string) — What kind of trace:callTracer
: Shows all internal function calls, value transfers, etc.prestateTracer
: Tracks account balances, storage, and state changes touched by the block
-
tracerConfig
(object, optional) — Additional options:onlyTopCall
: Iftrue
, only includes top-level calls (ignores nested ones)
-
đźš«
Important: You must include the tracer object
.
Leaving it empty will cause a timeout error.
What You’ll Get
callTracer
response
Field | Description |
---|---|
type of the call | Type of call (e.g. CALL, DELEGATECALL) |
from | Who made the call |
to | Who received the call |
gas | Gas sent |
gasUsed | Gas used |
transaction value | ETH (or token) sent |
input | Data sent (calldata) |
output | What came back |
error | Error message (if any) |
calls | Nested calls list |
revertReason | Why the transaction reverted (if any) |
prestateTracer
response
contract address
balance
— In weicode
— Contract bytecodenonce
— Account noncestorage
— Map of key-value pairs (hex-encoded)
Request
POST https://base-mainnet.chainnodes.org/YOUR-API-KEY
Example
đź’ˇ 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 Dashboard (opens in a new tab) - You can use a different supported network by replacing
base-mainnet
curl https://base-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"}'
Body
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"result": {
"from": "0x64bbde373e909501de1309231336761adeaa07d5",
"gas": "0x4b26c",
"gasUsed": "0x2a421",
"to": "0xa57bd00134b2850b2a1c55860c9e9ea100fdd6cf",
"input":
"0x1cff79cd000000000000000000000000f424018c3d4473e014c1def44171772059f2d720000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001042fdc7315000000000000000000000000f232d640a5700724748464ba8bd8bed21db609a600000000000000000000000000c83aecc790e8a4453e5dd3b0b4b3680501a7a700000000000000000000000056178a0d5f301baf6cf3e1cd53d9863437345bf900000000000000000000000000000000000000000000c4f6b375a9560f1dc9700000000000000000000000000000000000000000003e09de2596099e2b000000000000000000000000000000000000000000000000000000000061c7edb4810f00000000000000000000000000000000000000000000000000000000616a30c2330000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"calls": [
{
"from": "0xa57bd00134b2850b2a1c55860c9e9ea100fdd6cf",
"gas": "0x49451"
// ...
}
]
}
}
]
}
Need RPC API keys?
Get 12.5M archival requests for free today.