Skip to main content

rootSubscribe RPC Method

Loading...

Updated on
May 01, 2026

rootSubscribe RPC Method

As of May 1, 2026, this WebSocket method is billed based on metered data usage: 0.1 MB = 15 API credits. Learn more about WebSocket billing.

Parameters

This method does not accept any parameters

Returns

result
integer
Loading...
Notification Format:
Loading...
slot
Loading...
Request
1
import { createSolanaRpcSubscriptions } from '@solana/kit';
2
3
const rpcSubscriptions = createSolanaRpcSubscriptions('');
4
5
async function main() {
6
const abortController = new AbortController();
7
8
const subscription = await rpcSubscriptions
9
.rootNotifications()
10
.subscribe({ abortSignal: abortController.signal });
11
12
try {
13
for await (const notification of subscription) {
14
console.log("Updated root info: ", notification);
15
}
16
} catch (e) {
17
console.error("Error in root subscription:", e);
18
} finally {
19
abortController.abort();
20
console.log('Unsubscribed from root changes');
21
}
22
}
23
24
main().catch(console.error);
1
import { createSolanaRpcSubscriptions } from '@solana/kit';
2
3
const rpcSubscriptions = createSolanaRpcSubscriptions('');
4
5
async function main() {
6
const abortController = new AbortController();
7
8
const subscription = await rpcSubscriptions
9
.rootNotifications()
10
.subscribe({ abortSignal: abortController.signal });
11
12
try {
13
for await (const notification of subscription) {
14
console.log("Updated root info: ", notification);
15
}
16
} catch (e) {
17
console.error("Error in root subscription:", e);
18
} finally {
19
abortController.abort();
20
console.log('Unsubscribed from root changes');
21
}
22
}
23
24
main().catch(console.error);
Response
1
{
2
"jsonrpc": "2.0",
3
"result": 0,
4
"id": 1
5
}
1
{
2
"jsonrpc": "2.0",
3
"result": 0,
4
"id": 1
5
}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free