WebSocket Methods
blockSubscribe Solana RPC Method
Subscribe to receive notification anytime a new block is confirmed
or finalized
.
This subscription is considered unstable and is only available if the validator was started with the --rpc-pubsub-enable-block-subscription
flag. The format of this subscription may change in the future.
Endpoints
Websockets are available on mainnet and devnet with the following URLs:
- Mainnet
wss://mainnet.helius-rpc.com/?api-key=<API_KEY>
- Devnet
wss://devnet.helius-rpc.com/?api-key=<API_KEY>
Websockets have a 10-minute inactivity timer; implementing health checks and sending pings every minute is heavily recommended to keep the websocket connection alive.
Authorizations
Body
Response
Subscription id (needed to unsubscribe)
Notification Format
The notification will be an object with the following fields:
slot: <u64>
- The corresponding slot.err: <object|null>
- Error if something went wrong publishing the notification otherwise null.block: <object|null>
- A block object as seen in thegetBlock
RPC HTTP method.