# Debug

To enable the debug route namespace, you need to modify the configuration and add the "debug" parameter as shown below:

```
[jsonrpc.http]
    enabled = true
    port = 10001
    host = "0.0.0.0"
    api = ["eth", "net", "web3", "txpool", "bor", "debug"]
```

### debug\_traceBlockByNumber[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#debug_traceblockbynumber) <a href="#debug_traceblockbynumber" id="debug_traceblockbynumber"></a>

Executes all transactions in the block specified by number with a tracer and returns the tracing result.

#### Parameters[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#parameters) <a href="#parameters" id="parameters"></a>

* QUANTITY|TAG - integer of a block number, or the string "latest"
* Object - The tracer options:
  * enableMemory: Boolean - (optional, default: false) The flag indicating enabling memory capture.
  * disableStack: Boolean - (optional, default: false) The flag indicating disabling stack capture.
  * disableStorage: Boolean - (optional, default: false) The flag indicating disabling storage capture.
  * enableReturnData: Boolean - (optional, default: false) The flag indicating enabling return data capture.
  * timeOut: String - (optional, default: "5s") The timeout for cancellation of execution.

#### Returns[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#returns) <a href="#returns" id="returns"></a>

Array - Array of trace objects with the following fields:

* failed: Boolean - the tx is successful or not
* gas: QUANTITY - the total consumed gas in the tx
* returnValue: DATA - the return value of the executed contract call
* structLogs: Array - the trace result of each step with the following fields:
  * pc: QUANTITY - the current index in bytecode
  * op: String - the name of current executing operation
  * gas: QUANTITY - the available gas ßin the execution
  * gasCost: QUANTITY - the gas cost of the operation
  * depth: QUANTITY - the number of levels of calling functions
  * error: String - the error of the execution
  * stack: Array - array of values in the current stack
  * memory: Array - array of values in the current memory
  * storage: Object - mapping of the current storage
  * refund: QUANTITY - the total of current refund value

#### Example[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#example) <a href="#example" id="example"></a>

```
curl  https://node1-mainnet.maalscan.io -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_traceBlockByNumber","params":["latest"],"id":1}'
```

### debug\_traceBlockByHash[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#debug_traceblockbyhash) <a href="#debug_traceblockbyhash" id="debug_traceblockbyhash"></a>

Executes all transactions in the block specified by block hash with a tracer and returns the tracing result.

#### Parameters[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#parameters-1) <a href="#parameters-1" id="parameters-1"></a>

* DATA , 32 Bytes - Hash of a block.
* Object - The tracer options. See debug\_traceBlockByNumber for more details.

#### Returns[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#returns-1) <a href="#returns-1" id="returns-1"></a>

Array - Array of trace objects. See debug\_traceBlockByNumber for more details.

#### Example[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#example-1) <a href="#example-1" id="example-1"></a>

```
curl  https://node1-mainnet.maalscan.io -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_traceBlockByHash","params":["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae"],"id":1}'
```

### debug\_traceBlock[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#debug_traceblock) <a href="#debug_traceblock" id="debug_traceblock"></a>

Executes all transactions in the block given from the first argument with a tracer and returns the tracing result.

#### Parameters[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#parameters-2) <a href="#parameters-2" id="parameters-2"></a>

* DATA - RLP Encoded block bytes
* Object - The tracer options. See debug\_traceBlockByNumber for more details.

#### Returns[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#returns-2) <a href="#returns-2" id="returns-2"></a>

Array - Array of trace objects. See debug\_traceBlockByNumber for more details.

#### Example[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#example-2) <a href="#example-2" id="example-2"></a>

```
curl  https://node1-mainnet.maalscan.io -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_traceBlock","params":["0xf9...."],"id":1}'
```

### debug\_traceTransaction[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#debug_tracetransaction) <a href="#debug_tracetransaction" id="debug_tracetransaction"></a>

Executes the transaction specified by transaction hash with a tracer and returns the tracing result.

#### Parameters[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#parameters-3) <a href="#parameters-3" id="parameters-3"></a>

* DATA , 32 Bytes - Hash of a transaction.
* Object - The tracer options. See debug\_traceBlockByNumber for more details.

#### Returns[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#returns-3) <a href="#returns-3" id="returns-3"></a>

Object - Trace object. See debug\_traceBlockByNumber for more details.

#### Example[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#example-3) <a href="#example-3" id="example-3"></a>

```
curl  https://node1-mainnet.maalscan.io -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params":["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae"],"id":1}'
```

### debug\_traceCall[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#debug_tracecall) <a href="#debug_tracecall" id="debug_tracecall"></a>

Executes a new message call with a tracer and returns the tracing result.

#### Parameters[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#parameters-4) <a href="#parameters-4" id="parameters-4"></a>

* Object - The transaction call object
  * from: DATA, 20 Bytes - (optional) The address the transaction is sent from.
  * to: DATA, 20 Bytes - The address the transaction is directed to.
  * gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution. eth\_call consumes zero gas, but this parameter may be needed by some executions.
  * gasPrice: QUANTITY - (optional) Integer of the gasPrice used for each paid gas
  * value: QUANTITY - (optional) Integer of the value sent with this transaction
  * data: DATA - (optional) Hash of the method signature and encoded parameters. For details see Ethereum Contract ABI in the Solidity documentation
* QUANTITY|TAG - integer block number, or the string "latest"
* Object - The tracer options. See debug\_traceBlockByNumber for more details.

#### Returns[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#returns-4) <a href="#returns-4" id="returns-4"></a>

Object - Trace object. See debug\_traceBlockByNumber for more details.

#### Example[​](https://wiki.polygon.technology/docs/supernets/api/json-rpc-debug/#example-4) <a href="#example-4" id="example-4"></a>

```
curl  https://node1-mainnet.maalscan.io -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"debug_traceCall","params":[{"to": "0x1234", "data": "0x1234"}, "latest", {}],"id":1}'
```
