debug_traceBlockByNumber
Traces all transactions in a block on XDC Network by block number.
Archive Node Required
This method requires an archive node. It is not available on full nodes.
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
blockNumber | QUANTITY|TAG | Yes | Block number or tag |
tracerConfig | Object | No | Tracer configuration |
Request#
{
"jsonrpc": "2.0",
"method": "debug_traceBlockByNumber",
"params": ["latest", {"tracer": "callTracer"}],
"id": 1
}
Code Examples#
- cURL
- JavaScript
curl -X POST https://api-xdc-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceBlockByNumber",
"params": ["latest", {"tracer": "callTracer"}],
"id": 1
}'
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://api-xdc-mainnet.n.dwellir.com/YOUR_API_KEY');
const traces = await provider.send('debug_traceBlockByNumber', ['latest', { tracer: 'callTracer' }]);
console.log('Transaction traces:', traces.length);
Related Methods#
debug_traceBlockByHash- Trace by hashdebug_traceTransaction- Trace single transaction