chainHead_v1_body - Bittensor RPC Method
Retrieve a block body within an active chain head follow subscription on Bittensor using the new JSON-RPC v2 spec.
Retrieves the block body (list of extrinsics) for a block that is part of an active chainHead_v1_follow subscription. The block must have been reported by the follow subscription -- you cannot query arbitrary historical blocks. This method is part of the new JSON-RPC v2 chain head specification designed for efficient real-time chain tracking.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
followSubscription | string | Yes | The subscription ID returned by chainHead_v1_follow. |
hash | string | Yes | Hex-encoded block hash. Must be a block reported by the follow subscription. |
Response
The direct RPC response returns a MethodResponse object:
| Field | Type | Description |
|---|---|---|
result.result | "started" or "limitReached" | "started" includes an operationId; "limitReached" means the node refused to start another operation |
result.operationId | string | Operation ID used to correlate follow-up events when the response is "started" |
Once started, the follow subscription emits operationBodyDone with the block body payload.
Code Examples
Use Cases
- Real-time indexing -- Fetch block bodies as new blocks arrive to index Bittensor extrinsics in real-time.
- Transaction monitoring -- Inspect the extrinsics in each new block to detect specific transactions (transfers, subnet registrations, staking operations).
- Block explorer backends -- Serve block body data to users as new blocks are produced.
Notes
- Requires an active
chainHead_v1_followsubscription. The block hash must be pinned (reported) by that subscription. - This method is experimental and may not be enabled on public shared RPC endpoints.
- Use
chainHead_v1_stopOperationto cancel an in-progress body fetch.
Related Methods
chainHead_v1_follow-- Start following the chain head (required before using this method)chainHead_v1_header-- Get the header for a followed blockchainHead_v1_call-- Execute a runtime call on a followed blockchainHead_v1_unfollow-- Stop the follow subscriptionarchive_v1_body-- Get block body for arbitrary historical blockschain_getBlock-- Legacy method to retrieve a full block