Docs

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.

Cancels an in-progress operation (body fetch, runtime call, or storage query) within an active chainHead_v1_follow subscription. Operations started by chainHead_v1_body, chainHead_v1_call, or chainHead_v1_storage return an operationId; pass that ID to this method to cancel the operation and free server resources.

Parameters

ParameterTypeRequiredDescription
followSubscriptionstringYesThe subscription ID from chainHead_v1_follow.
operationIdstringYesThe operation ID returned when the operation was started.

Response

FieldTypeDescription
resultnullConfirms the operation has been stopped.

Returns an error if the subscription or operation ID is invalid, or if the operation has already completed.

Code Examples

Use Cases

  • Timeout handling -- Cancel an operation that is taking too long to complete, such as a large storage query.
  • Resource management -- Stop unnecessary operations to stay within the server's concurrent operation limits.
  • Graceful error recovery -- Cancel a stalled operation and retry with different parameters or at a different block.

Notes

  • This method is part of the new JSON-RPC v2 chain head specification.
  • Only operations that have been started (returned "started" with an operationId) can be stopped.
  • chainHead_v1_header returns results synchronously and does not use the operation pattern, so it cannot be stopped with this method.
  • This method is experimental and may not be enabled on public shared RPC endpoints.