rootSubscribe
Last updated:
rootSubscribe streams the advance of the node's root — the highest slot
that has been finalized by supermajority vote and can never be rolled back.
It takes no parameters; each rootNotification carries a single integer, the
new root slot. Where slotSubscribe follows the
processed tip of the chain (fast, but on a fork that can still switch),
rootSubscribe follows the finalized trailing edge, typically a few dozen
slots — around 15–30 seconds — behind that tip.
This is the stream to build on when irreversibility is the trigger. Typical
consumers: exchange and payment backends that credit a deposit only once the
slot containing it is at or below the root; indexers that keep a reorg-safe
cursor and only persist data up to the rooted slot; bridges and settlement
systems that release an action when a Solana event becomes final; and
snapshot or ETL jobs that use root advancement as a safe high-water mark. The
pattern is always the same — record the slot your event landed in, then wait
for a rootNotification whose value is greater than or equal to it.
Expectations to calibrate: notifications are frequent (roots advance nearly
every slot on a healthy cluster) but the value can jump by several slots at a
time, so treat the stream as "root is now ≥ N", not as a per-slot tick.
The root is the serving node's local view; different nodes root at slightly
different moments, though never in a contradictory order. A stalled root
stream while slot notifications keep flowing is a meaningful cluster-health
signal (finality is lagging). And like every Pub/Sub subscription it lives
only within the current WebSocket session — resubscribe after a reconnect,
and use getSlot with finalized commitment to re-baseline. Stop the stream
with rootUnsubscribe.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://triport.io/sol \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"id":1,"method":"rootSubscribe","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": "rootSubscribe",
"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":"rootSubscribe","params":[],"jsonrpc":"2.0"},
)
print(resp.json())Usage
- Transport: WebSocket.
- Networks: mainnet, devnet, testnet.
- Credit cost: 1 per call.
FAQ
- What does rootSubscribe do?
- Subscribes to root changes and streams a notification each time the node sets a new root — the finalized watermark of the chain.
- How many credits does rootSubscribe cost?
- rootSubscribe costs 1 credit(s) per call on Triport by default.
- Is rootSubscribe available over WebSocket?
- Yes, rootSubscribe supports WebSocket.