curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "trace_replayBlockTransactions",
"params": [
"latest",
[
"trace"
]
],
"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": "trace_replayBlockTransactions",
"params": [
"latest",
[
"trace"
]
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": [
{}
]
}blockParameter — the block number (hex) or tag (latest, earliest, pending)traceTypes — array of trace types to include:
trace — basic execution tracevmTrace — full VM execution tracestateDiff — state changesresult — array of trace results, one per transaction:
output — return data from the transactiontrace — array of trace objects (if requested)vmTrace — VM execution trace (if requested)stateDiff — state differences (if requested)transactionHash — hash of the transactiontrace_replayBlockTransactions code examplesconst ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);
const replayBlock = async (blockNumber) => {
const results = await provider.send("trace_replayBlockTransactions", [
blockNumber,
["trace"]
]);
console.log(`Replayed ${results.length} transactions`);
for (let i = 0; i < results.length; i++) {
const result = results[i];
console.log(`\nTransaction ${i}: ${result.transactionHash}`);
console.log(` Output: ${result.output}`);
console.log(` Traces: ${result.trace?.length || 0}`);
if (result.trace && result.trace.length > 0) {
for (const trace of result.trace) {
const callType = trace.action.callType || trace.type;
console.log(` ${callType}: ${trace.action.from} -> ${trace.action.to || 'Create'}`);
}
}
}
};
replayBlock("latest");
Was this page helpful?