⚡ 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
Rust
cargo add shredstreamGo
go get github.com/shredstream/shredstream-sdk-go📋 Prerequisites
- Create an account on ShredStream.com
- Launch a Shred Stream and pick your region
- Enter your server's IP address and the UDP port where you want to receive shreds
- Open your firewall for inbound UDP traffic on that port — see Network Setup
💻 Quick Start Examples
Each example listens for raw shreds on the port assigned by ShredStream.com.
// First, install our SDK with: npm install shredstreamconst { ShredListener } = require('shredstream');const listener = new ShredListener(8001);// Decoded transactions — ready-to-use Solana transactionslistener.on('transactions', (slot, txs) => {txs.forEach(tx => console.log(`slot ${slot}: ${tx.signature}`));});// OR: raw shreds — lowest latency, pre-block delivery// listener.on('shred', (slot, index, payload) => {// console.log(`slot ${slot} index ${index} len ${payload.length}`);// });listener.start();
Replace 8001 with the port assigned to your stream on the ShredStream.com dashboard.
⚖️ Raw Shreds vs Decoded Transactions
The SDKs offer two modes:
| Mode | Method | Latency | Use Case |
|---|---|---|---|
| Raw shreds | .shreds() / on('shred') / OnShred() | Lowest | Custom parsing, binary analysis, maximum speed |
| Decoded transactions | for slot, txs in listener / on('transactions') / OnTransactions() | Slightly higher | Ready-to-use Solana transactions with signatures |
Decoded transactions are emitted as each shred arrives, not at the end of the slot. The latency difference between the two modes is minimal.
⚙️ 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
# Linuxsudo sysctl -w net.core.rmem_max=33554432# macOSsudo sysctl -w kern.ipc.maxsockbuf=33554432
See Network Setup for full firewall and buffer configuration.
➡️ Next Steps
- Network Setup — firewall and OS-level configuration
- Best Practices — monitoring, redundancy, and performance
- Troubleshooting — common issues and solutions
- Advanced: Packet Format for users who need full control over the binary format