slotSubscribe

Subscribe to receive notification anytime a slot is processed by the validator

Parameters

None

No parameters are required for this method.


Result

Returns an <integer> representing the subscription ID. This ID is required to unsubscribe.


Code Sample

Request Example:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "slotSubscribe"
}

Response Example:

{
  "jsonrpc": "2.0",
  "result": 0,
  "id": 1
}

Notification Format

The notification is an object with the following fields:

  • parent (u64): The parent slot.

  • root (u64): The current root slot.

  • slot (u64): The newly set slot value.


Example Notification

{
  "jsonrpc": "2.0",
  "method": "slotNotification",
  "params": {
    "result": {
      "parent": 75,
      "root": 44,
      "slot": 76
    },
    "subscription": 0
  }
}

Last updated