state_callAt - Bittensor RPC Method
Execute a runtime API call at a specific block hash on Bittensor.
Executes a runtime API function with SCALE-encoded parameters at a specific block hash. This is a variant of state_call that requires an explicit block hash, making it useful for historical queries. You can invoke any runtime API function exposed by the Bittensor runtime, such as Metadata_metadata, AccountNonceApi_account_nonce, or TransactionPaymentApi_query_info.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
method | string | Yes | Runtime API function name (e.g. "Metadata_metadata", "AccountNonceApi_account_nonce"). |
data | string | Yes | Hex-encoded SCALE-encoded call parameters. Use "0x" for functions that take no arguments. |
blockHash | string | Yes | Hex-encoded block hash to execute the call against. |
Response
| Field | Type | Description |
|---|---|---|
result | string | Hex-encoded SCALE-encoded return value. Must be decoded according to the runtime API's return type. |
Code Examples
Use Cases
- Historical metadata -- Retrieve the runtime metadata as it existed at a past block to correctly decode storage and extrinsics from that era.
- Fee estimation at past blocks -- Call
TransactionPaymentApi_query_infoat historical blocks to analyze fee trends over time. - Cross-version analysis -- Compare runtime API outputs across different blocks to track how Bittensor subnet parameters or staking rules evolved.
Notes
- The
dataparameter must be SCALE-encoded. Use a library such as@polkadot/typesorparity-scale-codecto encode input and decode output. - Requires an archive node for historical block hashes. Non-archive nodes only retain recent state.
- This method is equivalent to
state_callwith an explicit block hash parameter.
Related Methods
state_call-- Runtime API call at the latest or a specified blockarchive_v1_call-- Runtime call via the new JSON-RPC v2 archive APIchainHead_v1_call-- Runtime call within a follow subscriptionstate_getMetadata-- Shortcut for fetching runtime metadata