The slotsUpdatesSubscribe
method in Solana allows developers to receive real-time notifications about slot updates including timing information. This subscription-based method provides more detailed updates about slot processing compared to slotSubscribe
.
result
- An integer subscription id (needed to unsubscribe)
subscription
- An object containing detailed slot information:
slot
- The current slot height
timestamp
- The current estimated production time (as Unix timestamp) of the slot
type
- The type of slot update:
"firstShredReceived"
- The first shred of the slot was received"completed"
- The slot was completed"createdBank"
- The bank for the slot was created"frozen"
- The bank for the slot was frozen"dead"
- The bank for the slot was marked as dead"optimisticConfirmation"
- The slot was optimistically confirmed"root"
- The slot was rootedslotsUpdatesSubscribe
code examplesnpm install -g wscat
$ wscat -c YOUR_CHAINSTACK_WEBSOCKET_ENDPOINT
# Wait for the connection to be established
Connected (press CTRL+C to quit)
> {"jsonrpc":"2.0","id":1,"method":"slotsUpdatesSubscribe"}
slotsUpdatesSubscribe
method is valuable for applications that need detailed monitoring of the Solana blockchain’s slot processing. Common use cases include:
Was this page helpful?