chainHead_v1_header - Bittensor RPC Method
Get the block header for a block within a chain head follow subscription on Bittensor using the new JSON-RPC v2 spec.
Returns the SCALE-encoded header of a block that is pinned by an active chainHead_v1_follow subscription. Unlike chainHead_v1_body and chainHead_v1_call, this method returns the result directly (not as a streamed operation), making it the fastest way to inspect block metadata within the follow API.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
followSubscription | string | Yes | The subscription ID from chainHead_v1_follow. |
hash | string | Yes | Hex-encoded block hash. Must be pinned by the follow subscription. |
Response
| Field | Type | Description |
|---|---|---|
result | string | Hex-encoded SCALE-encoded block header for the requested pinned block. |
The decoded header contains:
| Field | Description |
|---|---|
parentHash | Hash of the parent block. |
number | Block number. |
stateRoot | State trie root after this block. |
extrinsicsRoot | Root of the extrinsics trie. |
digest | Consensus digest logs (BABE slots, GRANDPA data, etc.). |
Code Examples
Use Cases
- Block number tracking -- Decode the header to get the block number for display or indexing as each new block arrives.
- State root verification -- Verify the state root for light-client proofs or cross-chain bridges.
- Parent chain traversal -- Follow
parentHashlinks to walk back through recent blocks within the follow window.
Notes
- This is a synchronous response (not an operation-based flow), so results are returned immediately.
- The block hash must be pinned by the follow subscription. Querying an unpinned or unknown hash returns an error.
- This method is experimental and may not be enabled on public shared RPC endpoints.
Related Methods
chainHead_v1_follow-- Start the follow subscription (required first)chainHead_v1_body-- Get the block body for a pinned blockchainHead_v1_call-- Execute a runtime call at a pinned blockarchive_v1_header-- Get headers for arbitrary historical blockschain_getHeader-- Legacy method to get a block header
chainHead_v1_follow - Bittensor RPC Method
Start following the chain head to receive new blocks and finality notifications on Bittensor using the new JSON-RPC v2 spec.
chainHead_v1_stopOperation - Bittensor RPC Method
Cancel an in-progress operation within a chain head follow subscription on Bittensor using the new JSON-RPC v2 spec.