Skip to main content
POST
debug_traceBlockByHash
curl --request POST \
  --url https://rpc.testnet.tempo.xyz/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "debug_traceBlockByHash",
  "params": [
    "0x1c3830dd03a362ba82e82017a5f4e361c12fc43b64a1e4ebd2902f0c313cad7e",
    {
      "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 hash. This is useful for analyzing all contract interactions within a specific block.

Parameters

  • blockHash — the hash of the block to trace
  • 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_traceBlockByHash code examples

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

const traceBlockByHash = async (blockHash) => {
    const traces = await provider.send("debug_traceBlockByHash", [
      blockHash,
      { 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}`);
    }
  };

traceBlockByHash("0x1c3830dd03a362ba82e82017a5f4e361c12fc43b64a1e4ebd2902f0c313cad7e");

Body

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

Block hash 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