Solana
Solana
Solana
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
slotSubscribe opens a Solana PubSub subscription that pushes a small notification — { parent, root, slot } — every time the node processes a new slot. Solana advances a slot roughly every 400ms under Proof-of-History, so this is a steady, lightweight heartbeat of the chain's leading edge, useful on a network whose fees are paid in SOL. The matching JSON-RPC endpoint is https://solana.therpc.io/YOUR_API_KEY, and you stop the stream by passing the returned subscription id to slotUnsubscribe.
getSlot.root field advance to see finalization keep pace with the leading slot.此方法不需要任何参数,传入空数组 [] 即可。
| 类型 | 描述 |
|---|---|
| integer | A numeric subscription id. slotNotification pushes { parent, root, slot }. |
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
processed slots, which are not yet finalized and can be skipped or rolled back — if you need a settled view, map slots to a commitment yourself or follow rootSubscribe instead.wss PubSub connection, and you stop it by passing the subscription id to slotUnsubscribe.