Parameters
None. This method does not accept any parameters.Response
-
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 rooted
-
slotsUpdatesSubscribe code examples
This example subscribes to detailed slot updates.
Note that subscriptions require a WebSocket connection and WebSocket cat for you to use this method in the console.Install WebSocket cat with:
npm install -g wscatUse case
TheslotsUpdatesSubscribe method is valuable for applications that need detailed monitoring of the Solana blockchain’s slot processing. Common use cases include:
- Performance monitoring: Track detailed slot processing times and states
- Debugging: Monitor slot processing stages for troubleshooting
- Chain health monitoring: Track slot completion and confirmation rates
- Analytics: Gather detailed metrics about blockchain performance
- Advanced timing: Coordinate operations based on specific slot states