Skip to main content
POST
debug_traceBlockByNumber
curl --request POST \
  --url https://tempo-moderato.core.chainstack.com/a25a421add2280d53fdbc23417055501/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "debug_traceBlockByNumber",
  "params": [
    "latest",
    {
      "tracer": "callTracer"
    }
  ],
  "id": 1
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": [
    {}
  ]
}
Tempo API method that returns detailed traces for all transactions in a block specified by block number. This is useful for analyzing all contract interactions within a specific block.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • blockNumber — the block number (hex) or tag (latest, earliest, pending)
  • tracerConfig — (optional) tracer configuration object:
    • tracer — tracer type (e.g., callTracer, prestateTracer)
    • timeout — (optional) timeout for the trace
    • tracerConfig — (optional) tracer-specific configuration

Response

  • result — array of trace objects, one for each transaction in the block. The format depends on the tracer used.
For callTracer, each trace contains:
  • from — sender address
  • to — recipient address
  • gas — gas provided
  • gasUsed — gas consumed
  • input — call data
  • output — return data
  • calls — nested array of internal calls
  • type — call type (CALL, DELEGATECALL, etc.)

debug_traceBlockByNumber code examples

const ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);

const traceBlock = async (blockNumber) => {
    const traces = await provider.send("debug_traceBlockByNumber", [
      blockNumber,
      { tracer: "callTracer" }
    ]);

    console.log(`Block contains ${traces.length} transaction traces`);
    for (let i = 0; i < traces.length; i++) {
      const trace = traces[i].result;
      console.log(`\nTx ${i}: ${trace.from} -> ${trace.to}`);
      console.log(`  Type: ${trace.type}, Gas Used: ${trace.gasUsed}`);
      if (trace.calls) {
        console.log(`  Internal calls: ${trace.calls.length}`);
      }
    }
  };

traceBlock("latest");

Body

application/json
jsonrpc
string
default:2.0
method
string
default:debug_traceBlockByNumber
params
any[]

Block number and optional tracer config

id
integer
default:1

Response

200 - application/json

Array of transaction traces

jsonrpc
string
id
integer
result
object[]

Array of trace objects for each transaction

Last modified on January 28, 2026