debug_traceTransaction RPC Method

Replays a mined transaction and returns its execution traces.

Parameters#

stringrequired

32-byte transaction hash, hex-encoded.

objectrequired

Object that controls tracing behavior:

tracerstring

Tracer type to apply: callTracer or prestateTracer.

tracerConfigobjectoptional

Optional settings for the chosen tracer:

onlyTopCallbooleanoptional

If true, limits tracing to the outermost call frame only.

diffModebooleanoptional

If true, outputs state differences instead of full pre-state (prestateTracer only).

withLogbooleanoptional

If true, attaches event logs to the trace output.

Result#

object - The resulting trace data.

Code sample#

{
  "jsonrpc": "2.0",
  "method": "debug_traceTransaction",
  "params": [
    "0x0e07d8b53ed3d91314c80e53cf25bcde02084939395845cbb625b029d568135c",
    {
      "tracer": "callTracer"
    }
  ],
  "id": 1
}

Response#

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "type": "CALL",
    "from": "0x3cf412d970474804623bb4e3a42de13f9bca5436",
    "to": "0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45",
    "value": "0x0",
    "gas": "0x46a02",
    "gasUsed": "0x5208",
    "input": "0x5ae401dc...",
    "output": "0x"
  }
}
Try It