rootSubscribe

Subscribe to receive notification anytime a new root is set 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": "rootSubscribe"
}

Response Example:

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

Notification Format

The notification provides the latest root slot number.

Example Notification:

{
  "jsonrpc": "2.0",
  "method": "rootNotification",
  "params": {
    "result": 42,
    "subscription": 0
  }
}

Last updated