Debug
Last updated
Last updated
The debug RPC implementations follow :
- requires the hash of the transaction to be traced
- requires the block number of the block to be traced and an additional parameter that sets the tracer to callTracer
(i.e. {"tracer": "callTracer"}
)
- requires the hash of the block to be traced and an additional parameter that sets the tracer to callTracer
(i.e. {"tracer": "callTracer"}
)
As optional parameters for the supported debug methods, you can provide the following:
disableStorage(boolean) -- (default: false) Setting this to true disables storage capture
disableMemory(boolean) -- (default: false). Setting this to true disables memory capture
disableStack(boolean) -- (default: false). Setting this to true disables stack capture
Once you have a running tracing node, you can open another tab in your terminal where you can run curl commands and start to call any of the available JSON RPC methods. For example, for the debug_traceTransaction method, you can make the following JSON RPC request in your terminal (in this case, for the transaction hash 0x04978f83e778d715eb074352091b2159c0689b5ae2da2554e8fe8e609ab463bf
):
The node responds with the step-by-step replayed transaction information (response was cropped as it is quite long):
If you're using the debug_traceBlockByNumber or debug_traceBlockByHash methods, you will need to add {"tracer": "callTracer"} to the "params". The callTracer will only return transactions and subcalls. Otherwise, the tracer will attempt to default to raw, which is not supported at this time due to the heavy nature of the call. For example, for the debug_traceBlockByHash method, you can make the following JSON RPC request in your terminal (in this case, for the block hash 0x2633b66050c99d80f65fe96de6485fd407b87f0f59b485c33ab8f119e2c6f255
):