WebSocket Overview
Subscribe to real-time Solana blockchain events using the WebSocket RPC interface.
Endpoint
text
wss://ws.sol.cubestech.onlineAuthenticate with the x-api-key header on connect.
Quick Connect
bash
wscat -c wss://ws.sol.cubestech.online -H "x-api-key: YOUR_API_KEY"Subscription Pattern
All WebSocket subscriptions follow a three-step lifecycle:
- Subscribe - Send a
*Subscriberequest to start receiving notifications. The response contains a subscription ID. - Receive - Notifications are pushed to your client as events occur on chain.
- Unsubscribe - Send a
*Unsubscriberequest with the subscription ID to stop receiving notifications.