Quickstart

Yellowstone gRPC Quickstart

Connect to Yellowstone gRPC and receive confirmed slot updates.

Use Yellowstone gRPC for filtered, low-latency Solana updates.

Install the TypeScript client

npm install @triton-one/yellowstone-grpc

Pin the package version in your lockfile. Yellowstone request fields change between releases.

Subscribe to slots

import Client, {  CommitmentLevel,} from "@triton-one/yellowstone-grpc" const client = new Client(  "https://grpc.nln.clr3.org:443",  process.env.NLN_API_KEY,  { grpcMaxDecodingMessageSize: 64 * 1024 * 1024 },) await client.connect()const stream = await client.subscribe() stream.on("data", (update) => {  if (update.slot) {    console.log(update.slot.slot, update.slot.status)  }}) stream.on("error", (error) => {  console.error(error)}) stream.write({  slots: {    confirmedSlots: { filterByCommitment: true },  },  accounts: {},  transactions: {},  transactionsStatus: {},  blocks: {},  blocksMeta: {},  entry: {},  accountsDataSlice: [],  commitment: CommitmentLevel.CONFIRMED,})

The SDK sends its token argument as x-token. The NoLimitNodes gateway also accepts x-api-key metadata in raw gRPC clients.

Test with grpcurl

Yellowstone reflection is not available on every gateway connection. Download the Yellowstone proto and pass the local file.

grpcurl \  -H "x-api-key: YOUR_API_KEY" \  -import-path ./proto \  -proto geyser.proto \  -d '{"commitment":"CONFIRMED"}' \  grpc.nln.clr3.org:443 \  geyser.Geyser/GetSlot