debug_traceBlockByHash
Traces all transactions in a block on Avalanche by block hash.
Archive Node Required
This method requires an archive node. It is not available on full nodes.
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
blockHash | DATA | Yes | 32-byte block hash |
tracerConfig | Object | No | Tracer configuration |
Request#
{
"jsonrpc": "2.0",
"method": "debug_traceBlockByHash",
"params": ["0xb40d80aebafa6c7598ca8bc978354fa1c44f34b08c3f328882b714cb533615bb", {"tracer": "callTracer"}],
"id": 1
}
Code Examples#
- cURL
- JavaScript
curl -X POST https://api-avalanche-mainnet-archive.n.dwellir.com/YOUR_API_KEY/ext/bc/C/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceBlockByHash",
"params": ["0xb40d80aebafa6c7598ca8bc978354fa1c44f34b08c3f328882b714cb533615bb", {"tracer": "callTracer"}],
"id": 1
}'
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://api-avalanche-mainnet-archive.n.dwellir.com/YOUR_API_KEY/ext/bc/C/rpc');
const blockHash = '0xb40d80aebafa6c7598ca8bc978354fa1c44f34b08c3f328882b714cb533615bb';
const traces = await provider.send('debug_traceBlockByHash', [blockHash, { tracer: 'callTracer' }]);
console.log('Transaction traces:', traces.length);
Related Methods#
debug_traceBlockByNumber- Trace by numberdebug_traceTransaction- Trace single transaction