β‘ 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 / TypeScript
npm install shredstreamPython
pip install shredstreamRust
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 on the port assigned by ShredStream.com.
// First, install our SDK with: npm install shredstreamimport { ShredListener } from 'shredstream';import { VersionedTransaction } from '@solana/web3.js';// Bind to the UDP port from your ShredStream.com dashboardconst PORT = parseInt(process.env.SHREDSTREAM_PORT || '8001');const listener = ShredListener.bind(PORT);// Decoded transactions β ready-to-use Solana transactionsfor 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
# 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