childstate_getKeysPaged - JSON-RPC Method
Description
Returns child storage keys in deterministic batches. This method is preferable when the child trie contains many entries and you need to iterate safely without overloading the RPC server.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
childStorageKey | string | Yes | Hex-encoded child trie identifier |
prefix | string | Yes | Hex-encoded key prefix |
count | number | Yes | Maximum number of keys to return |
startKey | string | null | No | Key to start from (exclusive), use null for the first page |
blockHash | string | null | No | Optional block hash for historical reads |
Request Example
{
"jsonrpc": "2.0",
"method": "childstate_getKeysPaged",
"params": [
"0x3a6368696c645f73746f726167653a5f6578616d706c65",
"0x",
64,
null,
null
],
"id": 1
}
Response Example
{
"jsonrpc": "2.0",
"result": [],
"id": 1
}
Usage Notes
- Repeat the call with
startKey
set to the last key returned until an empty array is received. - Combine with
childstate_getStorage
to fetch the values belonging to each key. - Some public RPC endpoints may restrict access to child storage for security reasons; in that case the call returns an empty list.