curl --request POST \
--url https://nd-954-882-037.p2pify.com/66f812de2a6724a75a51f60dd6f2a154 \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "debug_accountRange",
"params": [
"latest",
"0x0000000000000000000000000000000000000000000000000000000000000000",
10,
true,
true,
false
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}curl --request POST \
--url https://nd-954-882-037.p2pify.com/66f812de2a6724a75a51f60dd6f2a154 \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "debug_accountRange",
"params": [
"latest",
"0x0000000000000000000000000000000000000000000000000000000000000000",
10,
true,
true,
false
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {}
}arbtrace_* methods instead.blockNrOrHash — the block number in hex format or block tag (latest, earliest, pending, safe, finalized), or block hash.start — the start key hash for pagination, encoded as hex bytes. Use 0x0000000000000000000000000000000000000000000000000000000000000000 to start from the beginning.maxResults — the maximum number of accounts to return. Capped at 256.nocode — if true, excludes contract bytecode from the result.nostorage — if true, excludes storage data from the result.incompletes — if true, includes accounts without known addresses.result — an object containing the state dump:
root — the state root hash of the block.accounts — a map of account addresses to account data:
balance — the account balance in Wei.nonce — the account nonce.root — the storage root hash.codeHash — the hash of the account’s contract code.code — the contract bytecode (omitted if nocode is true).storage — the account’s storage slots (omitted if nostorage is true).address — the account address.next — the next key hash for pagination. Use this value as the start parameter in the next call to continue iterating.debug_accountRange code examplesconst ethers = require('ethers');
const NODE_URL = "YOUR_CHAINSTACK_ENDPOINT";
const provider = new ethers.JsonRpcProvider(NODE_URL);
const debugAccountRange = async () => {
const result = await provider.send("debug_accountRange", [
"latest",
"0x0000000000000000000000000000000000000000000000000000000000000000",
10,
true,
true,
false
]);
console.log(result);
};
debugAccountRange();
debug_accountRange method is useful for building state explorers and performing state audits. By paginating through all accounts at a specific block, developers can analyze the distribution of balances, identify contracts, and inspect the state trie structure. The pagination support via the start and next parameters allows iterating over the full account set without loading the entire state into memory.Was this page helpful?