Solana RPC API手册

slotSubscribe

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

请求参数

None

响应结果

  • integer - subscription id (needed to unsubscribe)

示例代码

请求:

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

响应:

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

Notification Format:#

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