rootSubscribe

WSSSubscriptionsOperator+

Emits a notification each time the validator advances its root (permanently finalized) slot.

WSSwss://ws-newyork.constant-k.com:1337/ws?api-key=YOUR_API_KEY

A slot becomes root once Agave has settled it so it can never be rolled back. rootSubscribe fires once per root advance, far less often than slotSubscribe, which fires on every processed slot regardless of finality.

The call takes no parameters, and the notification's result is the new root slot number, unlike accountNotification, programNotification or logsNotification, which wrap value in a context object.

PlansOperator and above
FreeNot included
OperatorIncluded
Blade RunnerIncluded
NexusIncluded

Parameters

This method takes no parameters.

Result

resultinteger

The subscription id, returned once in the initial RPC response. Passed to rootUnsubscribe, it cancels the stream.

Notifications

Updates arrive as rootNotification messages on the same socket. The newly-rooted slot number itself — a bare integer, not wrapped in a context/value object.

params.resultinteger

The new root slot.

Unsubscribe

rootUnsubscribe, called with the subscription id, stops the notifications and returns true once the subscription is removed.

rootUnsubscribe request
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "rootUnsubscribe",
  "params": [23003808]
}

Notes

  • WebSocket access is included on the Operator plan and above; it is not available on Free.
  • Concurrent connections are capped per API key: 10 on Operator, 50 on Blade Runner, 100 on Nexus.
  • Subscribe and unsubscribe calls draw from the same global per-plan request-rate limit as HTTP calls: 50 req/s on Operator, 200 req/s on Blade Runner, 500 req/s on Nexus.
  • Only subscription methods (the *Subscribe / *Unsubscribe family) are accepted on the WebSocket endpoint; standard request/response RPC methods must go over HTTPS instead.
  • A getHealth request sent over the open socket on a regular interval serves as a keepalive; connections that go quiet can be dropped by intermediate load balancers.
  • Each region has its own WebSocket hostname, for example wss://ws-newyork.constant-k.com:1337/ws?api-key=YOUR_API_KEY; every region is listed on the Endpoints page.
  • Captured live from wss://api.mainnet-beta.solana.com.