Skip to content

Latest commit

 

History

342 Commits

Folders and files

Solana Stream SDK

Solana Stream SDK: Rust or TypeScript. Built for speed. Green crystal module with a metal plate.

Real-time Solana data for Rust and TypeScript.

Build indexers, monitors, and event-driven applications with Geyser gRPC, Shreds gRPC, or UDP Shreds. One open-source repository with SDKs, working clients, and protocol migration guides.

Rust crate TypeScript package Apache-2.0

Choose a stream · Quick start · Documentation · Releases

Choose your stream

Stream Best for Language Working example
Geyser gRPC Structured transactions, accounts, slots, and blocks with server-side filters and resilient subscriptions Rust / TypeScript Rust · TypeScript
Shreds gRPC Receiving and decoding shred-derived entries over a gRPC connection Rust / TypeScript Rust · TypeScript
UDP Shreds Packet-level Solana data for latency-sensitive custom processing, where packet loss and incomplete data can be handled Rust Receiver · Integration guide

New to Solana streams? Start with Geyser gRPC. It offers structured updates and supported subscription filters. Choose Shreds when you need the lower-level data path and understand the trade-offs.

This repository contains client libraries and examples, not a hosted data service. Bring a compatible stream endpoint or UDP forwarding source. ERPC is one option; other compatible providers can be used.

Quick start

1. TypeScript: run the Geyser client

Requires Node.js 22+ and pnpm. The source workspace uses pnpm 11.

git clone https://github.com/ValidatorsDAO/solana-stream.git
cd solana-stream
pnpm install

cp client/geyser-ts/.env.example client/geyser-ts/.env
# Set GEYSER_ENDPOINT and SOLANA_RPC_ENDPOINT; add X_TOKEN if your provider requires it.

pnpm -F @validators-dao/solana-stream-sdk build
pnpm -F geyser-ts dev

The example includes reconnect handling, stream resumption, bounded processing, and transaction/account handlers. Configuration and application hooks.

For an existing TypeScript project, install the published library with pnpm add @validators-dao/solana-stream-sdk. See the package API and examples.

2. Rust: run the Shreds gRPC client

Requires Rust 1.98.1+ and access to a Shreds gRPC endpoint.

git clone https://github.com/ValidatorsDAO/solana-stream.git
cd solana-stream/client/shreds-rs

cp .env.example .env
# Replace SHREDS_ENDPOINT and SOLANA_RPC_ENDPOINT with your own endpoints.

cargo run

For a Rust application, add solana-stream-sdk = "5.0.0" to your Cargo.toml, then follow the Shreds example or Geyser example.

3. Rust: receive UDP Shreds

If you have a UDP Shreds source, set the listener in settings.jsonc and forward packets to its IP and port:

# From the repository root
cargo run -p shreds-udp-rs --bin generic_logger

This is a listener, not a data-source simulator; output requires incoming packets. The UDP integration guide covers configuration, assembly, custom handlers, and signature verification.

Built for streaming applications

  • Resilient Geyser subscriptions: Rust subscribe_with_reconnect and TypeScript subscribeWithReconnect expose disconnections and partial banks, with replay support. Consumers must handle replayed updates idempotently.
  • Modern Solana data formats: Supports Transaction v1 and Alpenglow block markers; see the compatibility notes.
  • High-throughput Rust gRPC configuration: Rust SDK 5.0 uses 16 MiB HTTP/2 receive windows for ShredstreamClient::connect; use tune_geyser_grpc_builder for the upstream Geyser builder.
  • Composable UDP processing: The Rust udp feature offers shred decoding, FEC assembly, deshredding, program watchers, and custom sinks without pulling solana-ledger into consumer builds.

Performance measurements and methodology include the scope and limitations of the published local benchmarks.

Versions and compatibility

Package Published version (as of 2026-11-18) Notes
solana-stream-sdk (Rust) 5.0.0 UDP decoder migration and Rust gRPC receive-window defaults; v5 migration
@validators-dao/solana-stream-sdk (TypeScript) 4.0.0 4.1.0 is in the repository source but not yet published to npm; npm 4.0 does not include the new 16 MiB Geyser defaults

The two packages do not share a release version. Check the package-registry badges above for newer releases. Rust 5.0 requires Rust 1.98.1+; the repository pins 1.99.1. TypeScript requires Node.js 22+.

Important behavior

  • Shreds gRPC filters are experimental: Use empty filter maps. Geyser gRPC filters are supported.
  • UDP is not finality: Packets may be lost or out of order, and observations may contain failed transactions. The sample UDP receive loop does not verify leader signatures by default. See verification guidance.
  • Reconnects may replay data: Handle Disconnected events, discard partial-bank state, and make application processing idempotent.
  • Flow control is not a server-limit bypass: Larger HTTP/2 receive windows do not fix a slow consumer or override upstream constraints.

Documentation

Topic Guide
Geyser gRPC TypeScript client · Rust client
Shreds gRPC TypeScript client · Rust client
UDP Shreds Integration and operational guide · Rust receiver sample
Protocol upgrades Rust v5 migration · v4 migration · Alpenglow · Transaction v1
Performance Benchmarks and gRPC flow control
SDK packages Rust crate · TypeScript package
Release history Changelog · GitHub releases

Contributing and support

Issues, fixes, and improvements are welcome. See Contributing, Security, and the Code of Conduct. Report SDK bugs through GitHub Issues; for ERPC account or endpoint support, use the ERPC dashboard.

Maintained by Validators DAO. Licensed under Apache-2.0. Powered by Solana.

The ERPC key visual is covered by the ELSOUL LABO brand notice.