BNB Smart Chain
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
BNB Smart Chain
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
debug_traceTransaction takes one already-mined transaction and replays it instruction by instruction, rebuilding the exact EVM state of the block where it landed and emitting a step-by-step record of execution. That is visibility no plain read method can offer. BNB Smart Chain (BSC) is a PoSA network with roughly three-second blocks where BNB pays gas and BEP-20 tokens flow through venues like PancakeSwap and Venus, so most traces here mean unpicking a DeFi interaction. Point the call at the JSON-RPC endpoint https://bsc.therpc.io/YOUR_API_KEY on chain ID 56. Re-running against historical state is heavy, so it wants a debug-enabled archive node.
callTracer to study how the transaction moved value.prestateTracer for a security post-mortem after an exploit.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | transactionHash | string | 是 | Hash of the transaction to trace. |
| 2 | options | object | 否 | Tracer configuration object. |
| 类型 | 描述 |
|---|---|
| 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 BNB Smart Chain playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-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. |
callTracer, or just turn off the stack and storage dumps in the options object.参数
0x-prefixed 32-byte hash
omit for default struct-log tracer