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
| Parameter | Type | Required | Description |
|---|---|---|---|
followSubscription | string | Yes | The subscription ID from chainHead_v1_follow. |
operationId | string | Yes | The operation ID returned when the operation was started. |
Response
| Field | Type | Description |
|---|---|---|
result | null | Confirms 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 anoperationId) can be stopped. chainHead_v1_headerreturns 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.
Related Methods
chainHead_v1_follow-- Start the follow subscriptionchainHead_v1_continue-- Resume a paused operation instead of stopping itchainHead_v1_unfollow-- Stop the entire follow subscription (also stops all operations)archive_v1_stopStorage-- Stop an archive storage operation
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.
chainHead_v1_storage - Bittensor RPC Method
Query storage keys and values at a block within a chain head follow subscription on Bittensor using the new JSON-RPC v2 spec.