BNB Smart Chain
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
BNB Smart Chain
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
For forensic work on a single BSC transaction, trace_replayTransaction is the sharpest tool in the namespace. It re-runs one historical transaction against the block state it executed in and returns whatever you ask for through traceTypes: the trace call tree, the vmTrace opcode stream, the stateDiff, or any mix of the three. Direct it to chain ID 56 at https://bsc.therpc.io/YOUR_API_KEY. The stateDiff is where forensics happens. It tags every touched account with =, +, -, or *{from,to}, so you can read off exactly how each balance, nonce, code blob, and storage slot moved. That replay against original state is what makes it heavy, and what ties it to a trace-enabled archive node that still keeps the history.
| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | transactionHash | string | 是 | Hash of the transaction to replay. |
| 2 | traceTypes | array | 是 | One or more of `"trace"`, `"vmTrace"`, `"stateDiff"`. At least one value is required. |
| 类型 | 描述 |
|---|---|
| object | `{output, trace?, stateDiff?, vmTrace?}` — `trace` is the call tree, `stateDiff` maps each affected address to balance/nonce/code/storage diffs using `=` (unchanged), `+` (created), `-` (deleted), `*{from,to}` (modified), `vmTrace` is the Parity-format opcode trace. |
Try it live in the BNB Smart Chain playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32601 | Method not found | trace namespace not enabled or not supported by this client (primarily OpenEthereum/Nethermind/Erigon). |
-32602 | Invalid params | Transaction hash is missing/malformed or traceTypes is empty or contains unknown values. |
-32000 | transaction not found | Transaction does not exist or archive trace data is unavailable for that block. |
vmTrace on a complex transaction produces enormous output, so reach for trace or stateDiff when you do not need opcode detail.vmTrace shape is Parity-specific. Do not confuse it with the structLog format that Geth's debug_traceTransaction returns.参数
0x-prefixed 32-byte hash
["trace"] | ["trace","vmTrace","stateDiff"]