githubEdit

debug_traceBlockByHash - Celo

Example code for the debug_traceBlockByHash JSON-RPC method. Complete guide on how to use debug_traceBlockByHash JSON-RPC in GetBlock Web3 documentation.

This method traces all transactions in a block by its hash on the Celo network. Similar to debug_traceBlockByNumber but uses block hash for identification.

Parameters

Parameter
Type
Required
Description

blockHash

string

Yes

32-byte block hash

options

object

No

Tracer configuration options

Request Example

curl -X POST https://go.getblock.io/<ACCESS-TOKEN>/ \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": "getblock.io",
  "method": "debug_traceBlockByHash",
  "params": [
    "0x4e3a3754410177e6937ef1f84bba68ea139e8d1a2258c5f85db9f1cd715a1bdd",
    {"tracer": "callTracer"}
  ]
}'

Response Example

Response Definition

Field
Type
Description

result

array

Array of transaction traces

Use Cases

  • Debug specific block by hash

  • Verify block execution

  • Analyze historical blocks

  • Build block tracing tools

Error Handling

Error Code
Description

-32602

Invalid params

-32603

Internal error

null result

Block not found

Last updated

Was this helpful?