Debug

The debug RPC implementations follow Geth's debug API guidelines:

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

Using the Debug API

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):

curl http://127.0.0.1:9933 -H "Content-Type:application/json;charset=utf-8" -d \
  '{
    "jsonrpc":"2.0",
    "id":1,
    "method":"debug_traceTransaction",
    "params": ["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):

curl http://127.0.0.1:9933 -H "Content-Type:application/json;charset=utf-8" -d \
  '{
    "jsonrpc":"2.0",
    "id":1,
    "method":"debug_traceBlockByHash",
    "params": ["0x2633b66050c99d80f65fe96de6485fd407b87f0f59b485c33ab8f119e2c6f255", {"tracer": "callTracer"}]
  }'

Last updated