UDP Setup

ShredStream.com delivers Solana shreds over UDP. Before your server can receive data, you need to open the correct port, tune your OS network buffers, and run a listener process. This guide covers all three steps with production-ready examples.


Firewall Configuration

Open the UDP port you plan to use (this guide uses port 8001 as an example). The exact command depends on your Linux distribution's firewall manager.

UFW (Ubuntu / Debian)

sudo ufw allow 8001/udp

iptables

sudo iptables -A INPUT -p udp --dport 8001 -j ACCEPT

To persist the rule across reboots, save it with iptables-save or your distribution's persistence mechanism (e.g., netfilter-persistent).

firewalld (CentOS / RHEL / Fedora)

sudo firewall-cmd --permanent --add-port=8001/udp
sudo firewall-cmd --reload
circle-info

If your server is behind a cloud provider's security group (AWS, GCP, Azure, etc.), you must also allow inbound UDP traffic on the same port in the cloud console.


UDP Buffer Tuning

Solana validators produce shreds at a very high rate. The default Linux UDP receive buffer is typically 256 KB, which is far too small and will cause packet drops under load. Set the receive buffer to at least 25 MB (26,214,400 bytes).

Apply Immediately

Make Persistent Across Reboots

Then verify:

You should see both values set to 26214400.

circle-exclamation

Production-Ready Listener Examples

Each example binds to port 8001, sets the socket receive buffer to 25 MB, and reads packets using a buffer size of 1203 bytes -- the exact size of a Solana shred (variant 0xA5).

Python

Save as listener.py and run:

Rust

Add to your Cargo.toml and run with cargo run --release for best performance.

JavaScript / TypeScript (Node.js)

To set the receive buffer in Node.js, call server.setRecvBufferSize(26_214_400) inside the listening event handler, after the socket is bound:

Run with:


Verifying Your Setup

Once your listener is running and your stream is active on the ShredStream.com dashboard, you should see output within seconds:

Checklist if shreds are not arriving:

  1. Dashboard status -- confirm your stream shows Active in the ShredStream.com dashboard and that the connection IP and port match your server.

  2. Firewall -- verify the UDP port is open. You can test from another machine with nc -u <your-ip> 8001.

  3. Public IP -- make sure you entered your server's public IPv4 address in the connection settings, not a private or internal IP.

  4. Buffer size -- run sysctl net.core.rmem_max to confirm the buffer is set to at least 26214400.

  5. Listener binding -- ensure your listener binds to 0.0.0.0 (all interfaces), not 127.0.0.1 (localhost only).

If everything checks out and you are still not receiving data, see the full Troubleshooting guide or reach out to the team on Discord.

Last updated

Was this helpful?