⚑ SDK Quick Start

Our official SDKs handle UDP reception, shred parsing, and transaction decoding out of the box. Install one command, write a few lines of code, and start receiving Solana shreds.


πŸ“¦ Available SDKs

JavaScript / TypeScriptnpm install shredstream
Pythonpip install shredstream
Rustcargo add shredstream
Go
Gogo get github.com/shredstream/shredstream-sdk-go

πŸ“‹ Prerequisites

  1. Create an account on ShredStream.com
  2. Launch a Shred Stream and pick your region
  3. Enter your server's IP address and the UDP port where you want to receive shreds
  4. Open your firewall for inbound UDP traffic on that port β€” see Network Setup

πŸ’» Quick Start Examples

Each example listens on the port assigned by ShredStream.com.

// First, install our SDK with: npm install shredstream
import { ShredListener } from 'shredstream';
import { VersionedTransaction } from '@solana/web3.js';
// Bind to the UDP port from your ShredStream.com dashboard
const PORT = parseInt(process.env.SHREDSTREAM_PORT || '8001');
const listener = ShredListener.bind(PORT);
// Decoded transactions β€” ready-to-use Solana transactions
for await (const { slot, transactions } of listener) {
for (const raw of transactions) {
const tx = VersionedTransaction.deserialize(new Uint8Array(raw));
console.log(`slot ${slot}: ${tx.signatures[0]}`);
}
}

Replace 8001 with the port assigned to your stream on the ShredStream.com dashboard.


βš™οΈ OS Buffer Tuning

The SDKs configure the socket receive buffer automatically (25 MB by default). However, you still need to allow this buffer size at the OS level:

bash
# Linux
sudo sysctl -w net.core.rmem_max=33554432
# macOS
sudo sysctl -w kern.ipc.maxsockbuf=33554432

See Network Setup for full firewall and buffer configuration.


➑️ Next Steps

SDK Quick Start β€” Documentations | ShredStream.com