debug_traceTransaction

The debug_traceTransaction command allows users to see all traces of a given transaction. Trace mode is required for this command to return the correct results.

The traceTransaction debugging method will attempt to run the transaction exactly as it was executed on the network. It will replay any transaction that may have been executed before this one before it will finally attempt to execute the transaction that corresponds to the given hash.

Parameters

In addition to the hash of the transaction you may give it a secondary optional argument, which specifies the options for this specific call. The possible options are:

  • disableStorage: BOOL. Setting this to true will disable storage capture (default = false).

  • disableStack: BOOL. Setting this to true will disable stack capture (default = false).

  • enableMemory: BOOL. Setting this to true will enable memory capture (default = false).

  • enableReturnData: BOOL. Setting this to true will enable return data capture (default = false).

  • tracer: STRING. Setting this will enable JavaScript-based transaction tracing, described below. If set, the previous four arguments will be ignored.

  • timeout: STRING. Overrides the default timeout of 5 seconds for JavaScript-based tracing calls. Valid values are described here.

ClientMethod invocation

Go

debug.TraceTransaction(txHash common.Hash, logger *vm.LogConfig) (*ExecutionResult, error)

Console

debug.traceTransaction(txHash, [options])

RPC

{"method": "debug_traceTransaction", "params": [txHash, {}]}

Example

Request

curl https://eth-mainnet.blastapi.io/<project-id> \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"debug_traceTransaction","params":["0x9e63085271890a141297039b3b711913699f1ee4db1acb667ad7ce304772036b"],"id":1,"jsonrpc":"2.0"}'

Last updated