Skip to main content
POST
trace_replayTransaction
curl --request POST \
  --url https://rpc.testnet.tempo.xyz/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "trace_replayTransaction",
  "params": [
    "0xb3e821e696897b02283b7b2d602941b1d3cb08448d3a204bab05955215fc2035",
    [
      "trace"
    ]
  ],
  "id": 1
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": {}
}
Tempo API method that replays a specific transaction and returns detailed execution traces. This is useful for debugging transaction behavior with customizable trace options.

Parameters

  • transactionHash — the hash of the transaction to replay
  • traceTypes — array of trace types to include:
    • trace — basic execution trace
    • vmTrace — full VM execution trace
    • stateDiff — state changes

Response

  • result — trace result object:
    • output — return data from the transaction
    • trace — array of trace objects (if requested)
    • vmTrace — VM execution trace (if requested)
    • stateDiff — state differences (if requested)

trace_replayTransaction code examples

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

const replayTransaction = async (txHash) => {
    // Replay with all trace types
    const result = await provider.send("trace_replayTransaction", [
      txHash,
      ["trace", "stateDiff"]
    ]);

    console.log("Transaction Output:", result.output);
    console.log("Traces:", result.trace?.length || 0);

    if (result.trace) {
      for (const trace of result.trace) {
        const callType = trace.action.callType || trace.type;
        const to = trace.action.to || "Contract Creation";
        console.log(`  ${callType}: ${trace.action.from} -> ${to}`);
      }
    }

    if (result.stateDiff) {
      console.log("\nState changes:");
      for (const [address, diff] of Object.entries(result.stateDiff)) {
        console.log(`  ${address}:`);
        if (diff.balance) {
          console.log(`    Balance: ${diff.balance['*']?.from || 'new'} -> ${diff.balance['*']?.to || diff.balance['+']}`);
        }
      }
    }
  };

replayTransaction("0xb3e821e696897b02283b7b2d602941b1d3cb08448d3a204bab05955215fc2035");

Body

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

Transaction hash and trace types array

id
integer
default:1

Response

200 - application/json

Replayed transaction trace

jsonrpc
string
id
integer
result
object

Trace result object with output, trace, vmTrace, and stateDiff