chainHead_v1_unfollow - Bittensor RPC Method
Stop following the chain head and clean up a follow subscription on Bittensor using the new JSON-RPC v2 spec.
Stops a chain head follow subscription that was started with chainHead_v1_follow. This cancels all in-progress operations, unpins all blocks, and frees all server-side resources associated with the subscription. Always call this method when you are done following the chain head to avoid resource leaks.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
followSubscription | string | Yes | The subscription ID returned by chainHead_v1_follow. |
Response
| Field | Type | Description |
|---|---|---|
result | boolean | Indicates whether the follow subscription was successfully stopped. No further events will be delivered. |
Code Examples
Use Cases
- Graceful shutdown -- Clean up the follow subscription before disconnecting your WebSocket client.
- Subscription rotation -- Stop the current subscription and start a new one (e.g. after a
stopevent indicating too many pinned blocks). - Resource management -- Free server resources when your application no longer needs real-time block notifications.
Notes
- After calling
unfollow, the subscription ID becomes invalid and all associated operations are cancelled. - If the server already sent a
stopevent, the subscription is already terminated, but callingunfollowis still safe and recommended for clean client-side state management. - This method is experimental and may not be enabled on public shared RPC endpoints.
Related Methods
chainHead_v1_follow-- Start a new follow subscriptionchainHead_v1_stopOperation-- Stop a single operation without ending the subscriptionchain_unsubscribeNewHeads-- Legacy unsubscribe from new block headerschain_unsubscribeFinalizedHeads-- Legacy unsubscribe from finalized headers