Ethereum
Prêt à utiliser cela en production ?
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
Ethereum
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
debug_traceTransaction takes the hash of a transaction already mined on Ethereum mainnet (chain ID 1, native coin ETH) and replays it opcode by opcode. The node rebuilds the exact EVM state as it stood at the start of that transaction — all earlier transactions in its block applied first — then re-runs it and records every instruction, stack frame, gas cost, and storage write along the way. It's the canonical tool for answering "what actually happened inside this transaction." Default output is the struct (opcode) logger, but callTracer and prestateTracer give you a call tree or a pre-execution state map instead. Send requests to https://ethereum.therpc.io/YOUR_API_KEY; older transactions need a debug-enabled archive node.
REVERT opcode — far more precise than a generic "execution reverted" string when a Uniswap swap or token transfer fails on chain.SSTORE or external call dominated the bill, so you know where optimizing actually pays off against the EIP-1559 base fee.callTracer, mapping every nested call across the sandwich or arbitrage that the transaction triggered.prestateTracer — the exact input you need to reproduce an exploit in a forked environment for a security post-mortem.| # | Nom | Type | Obligatoire | Description |
|---|---|---|---|---|
| 1 | transactionHash | string | Oui | Hash of the transaction to trace. |
| 2 | options | object | Non | Tracer configuration object. |
| Type | Description |
|---|---|
| object | With the default tracer: `{gas, failed, returnValue, structLogs[]}` where each structLog entry contains `{pc, op, gas, gasCost, depth, stack?, memory?, storage?}`. With callTracer: a nested call-tree object. With prestateTracer: a pre-execution account/storage map. |
Try it live in the Ethereum playground.
| Code | Message | Cause |
|---|---|---|
-32601 | Method not found | debug namespace is not enabled on the node (requires --http.api=debug or equivalent). |
-32602 | Invalid params | Transaction hash is missing, malformed, or the options object contains unknown fields. |
-32000 | transaction not found | The transaction hash does not exist on the chain or the node lacks archive state for that block. |
transaction not found unless you hit an archive node.callTracer for a compact tree, or disable stack and storage in the options object when you only need the call shape.Paramètres
0x-prefixed 32-byte hash
omit for default struct-log tracer