curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "debug_traceBlockByNumber",
"params": [
"latest",
{
"tracer": "callTracer"
}
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": [
{}
]
}curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "debug_traceBlockByNumber",
"params": [
"latest",
{
"tracer": "callTracer"
}
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": [
{}
]
}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 tracetracerConfig — (optional) tracer-specific configurationresult — array of trace objects, one for each transaction in the block. The format depends on the tracer used.callTracer, each trace contains:
from — sender addressto — recipient addressgas — gas providedgasUsed — gas consumedinput — call dataoutput — return datacalls — nested array of internal callstype — call type (CALL, DELEGATECALL, etc.)debug_traceBlockByNumber code examplesconst 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");
Was this page helpful?