Docs

chainHead_v1_call - Bittensor RPC Method

Execute a runtime API call on a block within a chain head follow subscription on Bittensor using the new JSON-RPC v2 spec.

Executes a runtime API function against the state of a block that is pinned by an active chainHead_v1_follow subscription. This allows you to call any runtime API (such as Metadata_metadata, AccountNonceApi_account_nonce, or custom Bittensor runtime APIs) at a specific block known to the follow subscription.

Parameters

ParameterTypeRequiredDescription
followSubscriptionstringYesThe subscription ID from chainHead_v1_follow.
hashstringYesHex-encoded block hash. Must be pinned by the follow subscription.
functionstringYesRuntime API function name (e.g. "Metadata_metadata").
callParametersstringYesHex-encoded SCALE-encoded input parameters. Use "0x" for no arguments.

Response

The direct RPC response returns a MethodResponse object:

FieldTypeDescription
result.result"started" or "limitReached""started" includes an operationId; "limitReached" means the node refused to start another operation
result.operationIdstringOperation ID used to correlate follow-up events when the response is "started"

Once started, the follow subscription emits operationCallDone with the SCALE-encoded output.

Code Examples

Use Cases

  • Live metadata tracking -- Fetch runtime metadata at each new block to detect runtime upgrades on Bittensor in real time.
  • Nonce resolution -- Call AccountNonceApi_account_nonce at the latest block to get the correct nonce for transaction submission.
  • Custom runtime queries -- Invoke Bittensor-specific runtime APIs to query subnet information, neuron data, or stake details at a known block.

Notes

  • Requires an active chainHead_v1_follow subscription with the block hash pinned.
  • The callParameters must be SCALE-encoded. Use a codec library to encode them.
  • This method is experimental and may not be enabled on public shared RPC endpoints.
  • Use chainHead_v1_stopOperation to cancel an in-progress call.