> ## 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_traceTransaction | Tempo

> Tempo API method that returns a detailed trace of a transaction's execution. Reference for debug_traceTransaction on Tempo via Chainstack.

Tempo API method that returns a detailed trace of a transaction's execution. This is useful for debugging failed transactions or understanding contract behavior.

## Parameters

* `transactionHash` — the hash of the transaction to trace
* `tracerConfig` — (optional) tracer configuration object:
  * `tracer` — tracer type (e.g., `callTracer`, `prestateTracer`)
  * `timeout` — (optional) timeout for the trace

## Response

* `result` — the trace result object, format depends on the tracer used

## `debug_traceTransaction` code examples

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

  const traceTransaction = async (txHash) => {
      const trace = await provider.send("debug_traceTransaction", [
        txHash,
        { tracer: "callTracer" }
      ]);
      console.log(JSON.stringify(trace, null, 2));
    };

  traceTransaction("0xb3e821e696897b02283b7b2d602941b1d3cb08448d3a204bab05955215fc2035");
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3

  node_url = "CHAINSTACK_NODE_URL"
  web3 = Web3(Web3.HTTPProvider(node_url))

  result = web3.provider.make_request("debug_traceTransaction", [
      "0xb3e821e696897b02283b7b2d602941b1d3cb08448d3a204bab05955215fc2035",
      {"tracer": "callTracer"}
  ])
  print(result['result'])
  ```

  ```bash cURL theme={"system"}
  curl -X POST "CHAINSTACK_NODE_URL" \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "method": "debug_traceTransaction",
      "params": ["0xb3e821e696897b02283b7b2d602941b1d3cb08448d3a204bab05955215fc2035", {"tracer": "callTracer"}],
      "id": 1
    }'
  ```
</CodeGroup>


## OpenAPI

````yaml openapi/tempo_node_api/debug_and_trace/debug_traceTransaction.json POST /
openapi: 3.0.0
info:
  title: debug_traceTransaction Tempo example
  version: 1.0.0
  description: This is an API example for debug_traceTransaction for Tempo.
servers:
  - url: https://tempo-mainnet.core.chainstack.com/c3ce2925b51f1ed18719fe8a23bbdccf
security: []
paths:
  /:
    post:
      tags:
        - Debug and trace
      summary: debug_traceTransaction
      operationId: tempo-debug-traceTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: debug_traceTransaction
                params:
                  type: array
                  items: {}
                  default:
                    - >-
                      0xb3e821e696897b02283b7b2d602941b1d3cb08448d3a204bab05955215fc2035
                    - {}
                  description: Transaction hash and optional tracer config
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: Transaction trace
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object
                    description: Trace result object

````