consensus_unsubscribe - Tempo

Example code for the consensus_unsubscribe JSON-RPC method. Complete guide on how to use consensus_unsubscribe JSON-RPC in GetBlock Web3 documentation.

Cancels an existing consensus subscription created with consensus_subscribe. WebSocket-only and validator-only.

Parameters

Parameter
Type
Required
Description

subscriptionId

string

Yes

Subscription ID returned by consensus_subscribe

Request Example

# WebSocket-only method. Use wscat (or similar) to connect first:
wscat -c 'wss://go.getblock.io/<ACCESS-TOKEN>/'

# Then send:
{"jsonrpc": "2.0", "method": "consensus_unsubscribe", "params": ["0x9cef478923ff08bf67fde6c64013158d"], "id": "getblock.io"}

Response Example

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": true
}

Response Parameters

Field
Type
Description

result

boolean

true if the subscription was cancelled, false if it did not exist

Use Cases

  • Cleanup in long-running consensus-monitoring services

  • Resetting subscriptions after a relayer pivots roles

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32601

Method not found

Method does not exist or is not enabled on this node

429

Too Many Requests

Rate limit exceeded for your plan

-32601

Method not found

Validator-only method — not exposed on shared infrastructure

SDK Integration

Was this helpful?