Overview
OrbitFlare supports persistent WebSocket connections for real-time Solana data. WebSocket subscriptions push updates to your client as they occur on-chain — no polling required. WebSocket endpoints use thewss:// scheme with the same region codes as the HTTP API:
Connecting
Idle connections are eventually dropped without a close frame, so your client sees close code
1006. Send a WebSocket ping frame every 20 to 30 seconds to keep a connection open.Subscription Methods
accountSubscribe
Receive updates whenever a specific account’s lamport balance or data changes.logsSubscribe
Receive transaction log messages in real time. Optionally filter to a specific program.slotSubscribe
Receive a notification each time a slot is processed.signatureSubscribe
Receive a one-time notification when a specific transaction signature reaches a given commitment level.programSubscribe
Receive updates for all accounts owned by a specific program.blockSubscribe
Receive full block data as each block is confirmed. Requires an add-on — contact support to enable.rootSubscribe
Receive the highest confirmed root slot each time it advances.Unsubscribing
Each subscription method has a correspondingUnsubscribe method. Pass the subscription ID returned in the initial subscription response.
accountUnsubscribe, logsUnsubscribe, slotUnsubscribe, signatureUnsubscribe, programUnsubscribe, blockUnsubscribe, rootUnsubscribe.
Keepalive
Idle connections are eventually dropped without a close frame. Send a WebSocket protocol ping frame every 20 to 30 seconds. A JSON-RPC message such as{"method": "ping"} does not work: Solana has no ping method, so the server replies with -32601 Method not found.
Reconnection
Implement automatic reconnection with exponential backoff for production applications:Connection Limits
WebSocket connections share the same per-IP limit as gRPC connections. See Authentication & Limits for details.See Also
HTTP RPC API
JSON-RPC 2.0 request format, batch requests, and all available methods.
Error Codes
HTTP status codes, JSON-RPC errors, and how to handle them.