slotsUpdatesSubscribe

Subscribe to receive a notification from the validator on a variety of updates on every slot

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": "slotsUpdatesSubscribe"
}

Response Example:

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

Notification Format

The notification is an object with the following fields:

  • err (string | undefined): The error message. Present only if the update type is "dead".

  • parent (u64 | undefined): The parent slot. Present only if the update type is "createdBank".

  • slot (u64): The updated slot.

  • stats (object | undefined): Present only if the update type is "frozen". Contains the following fields:

    • maxTransactionsPerEntry (u64)

    • numFailedTransactions (u64)

    • numSuccessfulTransactions (u64)

    • numTransactionEntries (u64)

    • timestamp (i64): The Unix timestamp of the update in milliseconds.

  • type (string): The type of update. Possible values:

    • "firstShredReceived"

    • "completed"

    • "createdBank"

    • "frozen"

    • "dead"

    • "optimisticConfirmation"

    • "root"


Example Notification

{
  "jsonrpc": "2.0",
  "method": "slotsUpdatesNotification",
  "params": {
    "result": {
      "parent": 75,
      "slot": 76,
      "timestamp": 1625081266243,
      "type": "optimisticConfirmation"
    },
    "subscription": 0
  }
}

Last updated