debug_traceCall
Traces a call without creating a transaction on Astar.
Archive Node Required
This method requires an archive node. It is not available on full nodes.
Use Cases#
- Transaction simulation - Debug before sending
- Gas analysis - Analyze gas usage per opcode
- Contract debugging - Step through execution for cross-chain DeFi, multi-VM smart contracts, and XCM-enabled interoperability with Ethereum and Cosmos
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
call | Object | Yes | Call object (same as eth_call) |
blockNumber | QUANTITY|TAG | Yes | Block number or tag |
tracerConfig | Object | No | Tracer configuration |
Request#
{
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [
{
"to": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"data": "0x70a08231000000000000000000000000"
},
"latest",
{}
],
"id": 1
}
Code Examples#
- cURL
- JavaScript
curl -X POST https://api-astar.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [
{"to": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", "data": "0x70a08231000000000000000000000000"},
"latest",
{"tracer": "callTracer"}
],
"id": 1
}'
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://api-astar.n.dwellir.com/YOUR_API_KEY');
const trace = await provider.send('debug_traceCall', [
{ to: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY', data: '0x70a08231000000000000000000000000' },
'latest',
{ tracer: 'callTracer' }
]);
console.log('Trace:', trace);
Related Methods#
eth_call- Execute call without tracedebug_traceTransaction- Trace actual transaction