RPC Endpoints
NodeTrace provides access to Ethereum Archive nodes through standard JSON-RPC endpoints. All standard Ethereum methods are supported.
Base URL
https://eth.nodetrace.xyz/rpc
Request Format
All requests must be POST requests with a JSON body following the JSON-RPC 2.0 specification:
{
"jsonrpc": "2.0",
"method": "method_name",
"params": [...],
"id": 1
}
Supported Methods
Reading Blockchain Data
eth_blockNumber- Get latest block numbereth_getBlockByHash- Get block by hasheth_getBlockByNumber- Get block by numbereth_getTransactionByHash- Get transaction detailseth_getTransactionReceipt- Get transaction receipteth_getBalance- Get account balanceeth_getCode- Get contract codeeth_getStorageAt- Get storage valueeth_call- Execute a call without creating a transactioneth_estimateGas- Estimate gas for a transactioneth_gasPrice- Get current gas priceeth_getLogs- Get event logs
Network Information
eth_chainId- Get chain ID (1 for mainnet)eth_protocolVersion- Get protocol versioneth_syncing- Get sync status
Debug Methods (Archive Node Features)
debug_traceTransaction- Trace transaction executiondebug_traceCall- Trace a calldebug_traceBlockByNumber- Trace all transactions in a blockdebug_traceBlockByHash- Trace all transactions in a block
Additional Methods
All standard Ethereum JSON-RPC methods are supported. For a complete list, see the Ethereum JSON-RPC Specification.
Archive Node Specific Features
As an Archive node provider, NodeTrace allows you to query historical blockchain data at any block height. This is particularly useful for:
Historical Balance Queries
Get the balance of an account at any point in history:
# Balance at block 1,000,000
curl -X POST https://eth.nodetrace.xyz/rpc/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"eth_getBalance",
"params":["0x407d73d8a49eeb85d32cf465507dd71d507100c1", "0xf4240"],
"id":1
}'
Historical Contract State
Query contract state at any block:
# Get storage at specific block
curl -X POST https://eth.nodetrace.xyz/rpc/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"eth_getStorageAt",
"params":["0x...", "0x0", "0xf4240"],
"id":1
}'
Error Responses
NodeTrace returns standard JSON-RPC error responses:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32602,
"message": "Invalid params"
}
}
Common error codes:
-32700: Parse error-32600: Invalid request-32601: Method not found-32602: Invalid params-32603: Internal error-32000: Server error (includes rate limiting)
Web3 Library Examples
Web3.js
const Web3 = require('web3');
// Using API key in URL path
const web3 = new Web3(
new Web3.providers.HttpProvider('https://eth.nodetrace.xyz/rpc/YOUR_API_KEY')
);
// Get latest block number
const blockNumber = await web3.eth.getBlockNumber();
console.log('Latest block:', blockNumber);
Ethers.js
const { ethers } = require('ethers');
// Using API key in URL path
const provider = new ethers.JsonRpcProvider(
'https://eth.nodetrace.xyz/rpc/YOUR_API_KEY'
);
// Get latest block number
const blockNumber = await provider.getBlockNumber();
console.log('Latest block:', blockNumber);
Viem
import { createPublicClient, http } from 'viem';
import { mainnet } from 'viem/chains';
// Using API key in URL path
const client = createPublicClient({
chain: mainnet,
transport: http('https://eth.nodetrace.xyz/rpc/YOUR_API_KEY'),
});
// Get latest block number
const blockNumber = await client.getBlockNumber();
console.log('Latest block:', blockNumber);
Best Practices
- Batch Requests: Combine multiple calls into a single request to reduce API calls
- Cache Responses: Cache immutable data like historical blocks and transactions
- Handle Rate Limits: Implement exponential backoff when hitting rate limits
- Use Appropriate Block Parameters: Use specific block numbers instead of "latest" when possible for better caching
Need Help?
- Check our Authentication Guide for API key setup
- View code examples for common use cases
- Join our community for support