TriportRPC

slotSubscribe

Last updated:

slotSubscribe is the cluster's heartbeat: it takes no parameters and pushes a slotNotification every time the serving node processes a new slot — roughly every 400 ms on a healthy cluster. Each notification carries three numbers: slot (the slot just processed), parent (the slot it builds on), and root (the newest rooted slot the node knows, i.e. the finalized watermark trailing a few dozen slots behind the tip).

It replaces polling getSlot in any latency-sensitive loop. Common uses: driving a "current slot" ticker in an explorer or dashboard; timestamping events from other subscriptions on the same socket; measuring your own pipeline lag by comparing the streamed tip against the slots your data arrives at; building blockhash-expiry countdowns for pending transactions; and acting as an application-level liveness signal — if slot notifications stall for more than a couple of seconds, the node or your connection is in trouble, which makes this the cheapest health probe a WebSocket session can carry.

Interpret the stream carefully. Slots arrive at the node's processed level, so the sequence tracks the tip of the fork the node is currently on — it is not a finality signal. The slot sequence is not guaranteed to be strictly consecutive from the client's point of view: skipped slots (leaders that produced no block) and minor fork switches mean you may observe gaps, and parent is how you stitch the true chain together. If you need to know when slots become final rather than merely processed, subscribe to rootSubscribe instead, or watch the root field here. For fine-grained per-slot lifecycle events (shreds received, banks frozen, dead slots), the heavier slotsUpdatesSubscribe exists. As with all Pub/Sub streams, a reconnect requires a fresh slotSubscribe; stop the stream with slotUnsubscribe.

Parameters

This method takes no parameters.

Returns

slotSubscribe return value
FieldType
resultobject

Examples

curl https://triport.io/sol \
  -X POST -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <api-key>' \
  -d '{"id":1,"method":"slotSubscribe","params":[],"jsonrpc":"2.0"}'
const res = await fetch("https://triport.io/sol", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
  body: JSON.stringify({
  "id": 1,
  "method": "slotSubscribe",
  "params": [],
  "jsonrpc": "2.0"
}),
});
const data = await res.json();
import requests
resp = requests.post(
    "https://triport.io/sol",
    headers={"Authorization": "Bearer <api-key>"},
    json={"id":1,"method":"slotSubscribe","params":[],"jsonrpc":"2.0"},
)
print(resp.json())

Usage

  1. Transport: WebSocket.
  2. Networks: mainnet, devnet, testnet.
  3. Credit cost: 1 per call.

FAQ

What does slotSubscribe do?
Subscribes to slot progression and streams a notification each time the node processes a new slot.
How many credits does slotSubscribe cost?
slotSubscribe costs 1 credit(s) per call on Triport by default.
Is slotSubscribe available over WebSocket?
Yes, slotSubscribe supports WebSocket.