Solana
Solana
Solana
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
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.Este método não aceita parâmetros. Passe um array vazio [].
| Tipo | Descrição |
|---|---|
| integer | A numeric subscription id. slotNotification pushes { parent, root, slot }. |
| Código | Mensagem | Causa |
|---|---|---|
-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.