gRPC examples
Copy-paste Yellowstone gRPC subscription code for accounts, transactions, and slots in TypeScript, Rust, Python, and grpcurl.
// updated 2026-06-04
Working code to connect to Supanode gRPC and subscribe to streams.
Prerequisites
- A Supanode account on a plan with gRPC (FOCUS, BUILD, GROW, or PROFESSIONAL).
- Your IPs registered in the allowlist via Telegram (gRPC uses IP allowlist authentication).
- Your gRPC endpoint - default Frankfurt:
fra.supanode.xyz:10013for TLS orfra.supanode.xyz:10010for plaintext. - Yellowstone gRPC client library for your language.
Don't have an account yet? Get a 48-hour free trial - contact us on Telegram: @supanode_tgs.
Test connection
Before writing code, verify your endpoint is reachable using grpcurl:
grpcurl fra.supanode.xyz:10013 geyser.Geyser/GetVersion
If you see a version number in the response, your connection works.
Basic subscribe example
Subscribes to all successful transactions involving a specific program. The Python example generates its stubs from the Yellowstone gRPC geyser.proto.
import Client, { CommitmentLevel, SubscribeRequest } from "@triton-one/yellowstone-grpc";
const client = new Client(
"fra.supanode.xyz:10013",
undefined,
{ "grpc.max_receive_message_length": 64 * 1024 * 1024 }
);
const stream = await client.subscribe();
const request: SubscribeRequest = {
commitment: CommitmentLevel.CONFIRMED,
accounts: {},
slots: {},
transactions: {
myFilter: {
vote: false,
failed: false,
accountInclude: ["YOUR_PROGRAM_ID"],
accountExclude: [],
accountRequired: [],
},
},
transactionsStatus: {},
blocks: {},
blocksMeta: {},
entry: {},
accountsDataSlice: [],
};
stream.write(request);
stream.on("data", (data) => {
if (data.transaction) {
console.log(`Transaction: ${data.transaction.signature}`);
}
});
Production tips
-
Reconnection with exponential backoff. Network blips happen. Implement retry logic that starts at 1 second and backs off to 30 seconds. On
429or503errors, always back off before retrying. -
Ping/pong for keepalive. Yellowstone server sends ping every 15 seconds. Most client libraries handle this automatically.
-
Use
accountsDataSliceto reduce bandwidth. If you only need part of an account's data, specifyaccountsDataSlice: [{offset: 0, length: 40}]. -
Choose commitment level wisely.
processedis fastest but can revert.confirmedis the practical default for trading.finalizedadds ~13 seconds of latency. -
Handle stream restart gracefully. When your stream restarts, you'll miss events during downtime. Design your application to recover from this.