chain_unsubscribeFinalizedHeads - Bittensor RPC Method
Cancel a finalized heads subscription on Bittensor via WebSocket.
Cancels a WebSocket subscription that was started with chain_subscribeFinalizedHeads. After calling this method, no further finalized block header notifications will be delivered for that subscription. Provide the numeric subscription ID that was returned when the subscription was created.
Code Examples
This method requires a WebSocket connection and is not available over HTTP.
WebSocket (wscat)
wscat -c wss://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY \
-x '{
"jsonrpc": "2.0",
"method": "chain_unsubscribeFinalizedHeads",
"params": ["SUBSCRIPTION_ID"],
"id": 1
}'Use Cases
- Subscription cleanup -- Cancel the finalized-heads subscription when your application (indexer, dashboard, alerting system) no longer needs finality notifications.
- Resource management -- Prevent server-side resource leaks in long-running WebSocket applications.
- Subscription rotation -- Stop one subscription before starting a fresh one after reconnection or reconfiguration.
Notes
- Always unsubscribe when done. Even though the server cleans up on disconnect, explicit unsubscription is best practice.
- The British spelling alias
chain_unsubscribeFinalisedHeadsis also available and functionally identical. - WebSocket-only; cannot be called over HTTP.
Related Methods
chain_subscribeFinalizedHeads-- Start the finalized-heads subscriptionchain_unsubscribeFinalisedHeads-- British spelling aliaschain_unsubscribeNewHeads-- Cancel a best-block header subscriptionchain_unsubscribeAllHeads-- Cancel an all-heads subscriptionchainHead_v1_unfollow-- Stop a v2 chain head follow subscription