Skip to main content
Start with block metadata to verify the connection without downloading full blocks. The helper below is reused by the other Yellowstone guides.

Install and configure

Use Node.js 20 or later. These examples target @triton-one/yellowstone-grpc 7.0.1. Keep the .mts extension when running them with tsx.

Create the subscription helper

Save this as stream.mts. It fills in the required request maps, replies to server pings, and closes the stream when the consumer exits. Disconnects are surfaced to the caller.
stream.mts

Receive block metadata

blocks.mts
Each row contains a slot, blockhash, and executed transaction count. Stop with Ctrl+C. If nothing arrives, check the token and endpoint in the authentication guide.

Read the payload correctly

Public keys and signatures arrive as bytes; encode them with base58 for display. The client represents protobuf 64-bit integers as strings. Keep raw balances as strings or BigInt until formatting them.

Account updates

Transactions

Reliability and performance