> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Debug & Trace APIs

> Use debug and trace APIs on Chainstack to monitor, inspect, and replay EVM transactions for smart contract debugging and performance analysis.

## Overview

They provide detailed information about transactions, blocks, and smart contracts execution making it easier to identify and resolve issues within decentralized applications.

By using debug and trace APIs, developers can build more reliable and secure DApps with improved user experience and thus contribute to the overall health of a network.

<Info>
  ### Historical states limitations

  To debug and trace transactions, you need to have historical states on the node. Full nodes of different protocols can [store different amount of historical states](/docs/protocols-modes-and-types#modes). At the same time, archive nodes keep historical states for the *entire chain*.
</Info>

## Protocols with debug and trace APIs

### Ethereum

To enable debug and trace APIs on your Ethereum node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

#### Dedicated nodes

To enable debug and trace APIs on your dedicated Ethereum node, you must have a [paid plan](https://chainstack.com/pricing/). Dedicated nodes can be deployed either as the Geth or Erigon client implementation for the full and archive modes respectively, however, they slightly differ from each other:

* With a node running on Geth, only `debug_*`namespace is exposed.
* With a node running on Erigon, both `debug_*` and `trace_*`namespaces are exposed.

Learn how to [deploy your dedicated Ethereum node run on different clients](/reference/enable-debug-trace-apis-for-your-ethereum-node) with debug and trace APIs enabled.

For the full list of the available debug and trace API methods, see:

<CardGroup cols={2}>
  <Card title="Geth: debug namespace" href="https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug" icon="angle-right" horizontal iconType="solid" />

  <Card title="Erigon: RPC implementation status" href="https://github.com/ledgerwatch/erigon/blob/stable/cmd/rpcdaemon/README.md#rpc-implementation-status" icon="angle-right" horizontal iconType="solid" />
</CardGroup>

### Polygon

To enable debug and trace APIs on your Polygon node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

#### Dedicated nodes

To enable debug and trace APIs on your dedicated Polygon node, you must have a [paid plan](https://chainstack.com/pricing/). Dedicated nodes can be deployed either as the Bor or Erigon client implementation for the full and archive modes respectively, however, they slightly differ from each other:

* With a node running on Bor, only `debug_*`namespace is exposed.
* With a node running on Erigon, both `debug_*` and `trace_*`namespaces are exposed.

For the full list of the available debug and trace API methods, see: [Erigon: RPC implementation status](https://github.com/ledgerwatch/erigon/blob/stable/cmd/rpcdaemon/README.md#rpc-implementation-status)

### BNB Smart Chain

To enable debug and trace APIs on your BNB Smart Chain node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

#### Dedicated nodes

To enable debug and trace APIs on your dedicated BNB Smart Chain node, you must have a [paid plan](https://chainstack.com/pricing/). Dedicated nodes can be deployed either as the Geth or Erigon client implementation for the full and archive modes respectively, however, they slightly differ from each other:

* With a node running on Geth, only `debug_*`namespace is exposed.
* With a node running on Erigon, both `debug_*` and `trace_*`namespaces are exposed.

For the full list of the available debug and trace API methods, see:

<CardGroup cols={2}>
  <Card title="Geth: debug namespace" href="https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug" icon="angle-right" horizontal iconType="solid" />

  <Card title="Erigon: RPC implementation status" href="https://github.com/ledgerwatch/erigon/blob/stable/cmd/rpcdaemon/README.md#rpc-implementation-status" icon="angle-right" horizontal iconType="solid" />
</CardGroup>

### Base

To enable debug and trace APIs on your Base node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

### Avalanche

To enable debug and trace APIs on your Avalanche node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node in the [archive mode](/docs/protocols-modes-and-types#modes). Your node will run the AvalancheGo client, which is the Go language implementation of an Avalanche node. Avalanche offers an API interface identical to [Geth's API](https://geth.ethereum.org/docs/rpc/server), but with a limited set of services that include `debug_trace*`.

For a full list of the Geth debug API methods, see the [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug) section of the Geth documentation.

You can deploy a dedicated Avalanche node starting from a [paid plan](https://chainstack.com/pricing/).

### Arbitrum

To enable debug and trace APIs on your Arbitrum node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

#### Dedicated nodes

To enable debug and trace APIs on your dedicated Arbitrum node, you must have a [paid plan](https://chainstack.com/pricing/).

#### Available methods

Both global elastic and dedicated Arbitrum nodes with debug and trace APIs enabled will expose the `debug_*` and `arbtrace_*` methods.

Arbitrum uses the Nitro client (a Geth fork) and does not support the `trace_*` namespace. Instead, use the `arbtrace_*` methods for pre-Nitro blocks and `debug_*` methods for post-Nitro blocks.

Blocks older than 22,207,815 were added to the chain before the [Nitro migration](https://developer.arbitrum.io/migration/dapp_migration) and cannot be queried with Geth `debug_*` methods. Starting from block 22,207,815, Arbitrum migrated to Nitro which made Geth `debug_*` methods available for newer blocks.

Use the following `arbtrace_*` methods for calling on blocks prior to 22,207,815:

* arbtrace\_block
* arbtrace\_call
* arbtrace\_callMany
* arbtrace\_filter
* arbtrace\_get
* arbtrace\_replayBlockTransactions
* arbtrace\_replayTransaction
* arbtrace\_transaction

The following `debug_*` methods are available for blocks from 22,207,815 onward:

* debug\_traceBlockByHash
* debug\_traceBlockByNumber
* debug\_traceTransaction
* debug\_traceCall

For the full list of the available `debug_*` namespace methods, see [Geth documentation](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### zkSync Era

To enable debug and trace APIs on your zkSync Era node, you must deploy an node in the archive mode. The node will expose the `debug_*` API methods. A debug and trace node for zkSync Era is available starting from a [paid plan](https://chainstack.com/pricing/).

### Optimism

To enable debug and trace APIs on your Optimism node, deploy a [global node](/docs/global-elastic-node) with the debug & trace APIs enabled.

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### Scroll

To enable debug and trace APIs on your Optimism node, deploy a [global node](/docs/global-elastic-node) with the debug & trace APIs enabled.

### Ronin

To enable debug and trace APIs on your Optimism node, deploy a [global node](/docs/global-elastic-node) with the debug & trace APIs enabled.

### Gnosis Chain

To enable debug and trace APIs on your Gnosis Chain node, you must deploy a dedicated node in the full or archive mode. The node will expose the `debug_*` and `trace_*` API methods. A dedicated debug and trace node for Gnosis Chain is available starting from a [paid plan](https://chainstack.com/pricing/).

For the full list of the available debug and trace API methods, see [Nethermind documentation](https://docs.nethermind.io/nethermind/ethereum-client/json-rpc).

### Fantom

To enable debug and trace APIs on your Fantom node, you must deploy a dedicated node in the full or archive mode. The node will expose the `debug_*` API methods. A dedicated debug and trace node for Fantom is available starting from a [paid plan](https://chainstack.com/pricing/).

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### Hyperliquid

To enable debug and trace APIs on your Hyperliquid HyperEVM node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node](/docs/global-elastic-node).

Debug and trace APIs are available on both mainnet and testnet. The HyperEVM supports standard Ethereum debug and trace APIs, allowing you to debug smart contracts and trace transactions on Hyperliquid's EVM-compatible layer.

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### Sonic

To enable debug and trace APIs on your Sonic node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### Unichain

To enable debug and trace APIs on your Unichain node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### Berachain

To enable debug and trace APIs on your Berachain node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### Linea

To enable debug and trace APIs on your Linea node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### Mantle

To enable debug and trace APIs on your Mantle node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### Zora

To enable debug and trace APIs on your Zora node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### Blast

To enable debug and trace APIs on your Blast node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### Moonbeam

To enable debug and trace APIs on your Moonbeam node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### Celo

To enable debug and trace APIs on your Celo node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### Kaia

To enable debug and trace APIs on your Kaia node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

### opBNB

To enable debug and trace APIs on your opBNB node, you must have a [paid plan](https://chainstack.com/pricing/) and deploy the node as a [global node.](/docs/global-elastic-node)

For the full list of the available debug and trace API methods, see [Debug namespace](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug).

## Usage examples

You can debug and trace transactions by replaying them in the Ethereum Virtual Machine to get the execution details in the exact same way as they happened on the chain.

### debug\_traceBlockByNumber

Trace all transactions included in a block with `debug_traceBlockByNumber` in [block 14,976,695](https://etherscan.io/txsInternal?block=14976695):

<CodeGroup>
  ```bash cURL theme={"system"}
  curl 'YOUR_CHAINSTACK_ENDPOINT' \
  -H 'Content-Type: application/json' \
  -d '{"id": 1, "method": "debug_traceBlockByNumber", "params": ["0xE486B7", {"tracer": "callTracer"}]}'
  ```
</CodeGroup>

where

* `0xE486B7` — the number of the block to get the traces of included transactions. For Geth, you need to provide the block number in hex.
* YOUR\_CHAINSTACK\_ENDPOINT — your Chainstack node HTTPS endpoint. See [View node access and credentials](/docs/manage-your-node#view-node-access-and-credentials).

See a reverted transaction in the output:

<CodeGroup>
  ```Json JSON theme={"system"}
  "calls": [
    {
      "type": "DELEGATECALL",
      "from": "0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45",
      "to": "0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45",
      "gas": "0x38ed0",
      "gasUsed": "0x31147",
      "input": "0x472b43f30000000000000000000000000000000000000000000000000429d069189e00000000000000000000000000000000000000000000000000160d962fcdfd0bb02400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000b5ec97d9a8a9941a28a88084a1f670c62bd8bf40000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000b00b2e950d7ef8bdc49377c49676d1550deab982",
       "error": "execution reverted"
  ```
</CodeGroup>

### trace\_block

Trace all transactions included in a block with `trace_block` in [block 14,976,695](https://etherscan.io/txsInternal?block=14976695):

<CodeGroup>
  ```bash cURL theme={"system"}
  curl 'YOUR_CHAINSTACK_ENDPOINT' \
  -H 'Content-Type: application/json' \
  -d '{"id": 1, "method": "trace_block", "params": ["14976695"]}'
  ```
</CodeGroup>

where

* `14976695` — the number of the block to get the traces of included transactions
* YOUR\_CHAINSTACK\_ENDPOINT — your Chainstack node HTTPS endpoint. See [View node access and credentials](/docs/manage-your-node#view-node-access-and-credentials).

See a reverted transaction in the output:

<CodeGroup>
  ```Json JSON theme={"system"}
  "action": {
    "from": "0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45",
    "callType": "delegatecall",
    "gas": "0x38ed0",
    "input": "0x472b43f30000000000000000000000000000000000000000000000000429d069189e00000000000000000000000000000000000000000000000000160d962fcdfd0bb02400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000b5ec97d9a8a9941a28a88084a1f670c62bd8bf40000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000b00b2e950d7ef8bdc49377c49676d1550deab982",
    "to": "0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45",
    "value": "0x429d069189e0000"
    },
    "blockHash": "0x03a83bf066e81498804f26caf5d49e47820f6a0e92fd1c9cb7dc3b87bf46cf0f",
    "blockNumber": 14976695,
    "error": "Reverted"
  ```
</CodeGroup>

<Info>
  ### Advanced options on paid plans

  Dedicated nodes, archive nodes, debug & trace APIs are available starting from a [paid plan](https://chainstack.com/pricing/).
</Info>
