Corvus Labs

Solana WebSocket subscriptions

Subscribe to Solana PubSub over the Corvus WebSocket endpoint on port 8900 and rebuild subscriptions correctly after a disconnect.

Standard Solana PubSub lives at ws://<region>.corvus-labs.io:8900, in the same five metros as JSON-RPC: fra, ams, lon, nyc, tyo. Keep the ws:// scheme (transport security).

Subscriptions

You subscribe by sending a JSON-RPC 2.0 request over the socket:

{"jsonrpc":"2.0","id":1,"method":"slotSubscribe"}

The reply carries the subscription ID:

{"jsonrpc":"2.0","result":42,"id":1}

The ID is only meaningful on the socket that issued it, so keep your subscription intent (accounts, programs, commitment) separate from the IDs the server hands back.

The methods, notification shapes and commitment options are all standard Solana; the Solana WebSocket reference documents them.

Reconnecting

When the socket closes, the server drops every subscription that was on it. Nothing is redelivered and there's no cursor to pick up from.

  • PubSub sends nothing when nothing matches, so a quiet socket isn't a signal; use protocol pings for liveness.
  • Re-issue every *Subscribe call from your stored intent and swap in the IDs the new connection gives you.
  • Backfill from your last processed slot or signature over JSON-RPC before you trust the live stream again.

Which streaming interface?

NeedUse
Standard Solana PubSub, drop-in SDK compatibilityWebSocket, port 8900
Typed, filterable account/transaction/slot/block streamsYellowstone gRPC, port 10101
Pre-execution entry, transaction, and slot streamsaRPC, port 20202

WebSocket and Yellowstone gRPC run in the five Solana RPC metros; aRPC runs in all nine, so in some regions it's the only one of the three you can reach. Regions has the matrix.

Failure modes

A socket that opens and then closes without ever delivering a notification is an access problem: your egress IP isn't on the allowlist, or the tokenized path is wrong. See Access & authentication.

On this page