Docs

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)

Bash
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_unsubscribeFinalisedHeads is also available and functionally identical.
  • WebSocket-only; cannot be called over HTTP.