Skip to main content
Tempo API method that returns a detailed trace of a transaction’s execution. This is useful for debugging failed transactions or understanding contract behavior.

Parameters

  • transactionHash — the hash of the transaction to trace
  • tracerConfig — (optional) tracer configuration object:
    • tracer — tracer type (e.g., callTracer, prestateTracer)
    • timeout — (optional) timeout for the trace

Response

  • result — the trace result object, format depends on the tracer used

debug_traceTransaction code examples

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

const traceTransaction = async (txHash) => {
    const trace = await provider.send("debug_traceTransaction", [
      txHash,
      { tracer: "callTracer" }
    ]);
    console.log(JSON.stringify(trace, null, 2));
  };

traceTransaction("0xb3e821e696897b02283b7b2d602941b1d3cb08448d3a204bab05955215fc2035");