JAZ Chain
  • Guide
    • Products
    • Network
      • Endpoints
      • Metamask
      • Faucet
    • Glossary
    • Node Setup
      • Requirements
      • Installation
        • Using Command
        • Using Docker
      • Rotate session keys
      • Set session keys
      • Bind unique-node-nft
      • Claim Rewards
    • Run a tracing node
      • Run a Tracing Node
      • Additional Flags
      • Using a tracing Node
  • Build
    • Ethereum API
      • Libiaries
      • Dev Environments
      • Debug && Trace
        • Debug
        • Txpool
          • Trace Module
      • Gas
    • Substrate API
Powered by GitBook
On this page
  1. Build
  2. Ethereum API
  3. Debug && Trace

Debug

PreviousDebug && TraceNextTxpool

Last updated 2 years ago

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

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"}]
  }'
Geth's debug API guidelines
debug_traceTransaction (opens new window)
debug_traceBlockByNumber (opens new window)
debug_traceBlockByHash (opens new window)