Receive Raw Shreds over UDP with Surge
Register an IP and UDP port, open your firewall to the APEX source IP, run a listener and check that shreds arrive
Surge needs no validator and no special hardware: a server with a public IP and an open UDP port is enough. Product page: raw Solana shreds (Raiden Surge) .
1. Get Access
Open the Surge page of the dashboard (sign in with Discord), pick one or more regions (FRA, AMS, LND, NYC, TKY) and enter the public IP and UDP port that will receive the stream. Then either:
- Start a free trial: 3 hours, once per region per account, no payment. Every trial request is reviewed by hand: after submitting it, open a ticket on Discord . The 3 hours start once the trial is approved. An IP that another account already used for a trial can’t start a new one, and there is no trial in a region where you already hold a live subscription.
- Buy a pass: 1 day, 7 days or 30 days per region, paid in USDC on Solana. See Pricing.
A destination IP:port can carry only one active subscription. You can change a region’s destination from the dashboard, with a 60-second cooldown between changes. Plans and trial terms: Solana shred stream pricing and free trial .
2. Open Your Firewall
Allow inbound UDP on your port from the APEX source IP of each region you subscribe to. Example for FRA, receiver on UDP port 20000:
# ufw
sudo ufw allow proto udp from 198.13.140.100 to any port 20000
# or iptables
sudo iptables -A INPUT -p udp -s 198.13.140.100 --dport 20000 -j ACCEPTIf the server sits behind a cloud firewall or security group, open the UDP port there too. Behind NAT, forward the port to the receiving host and register the public address. All APEX IPs: APEX Servers.
3. Check That Shreds Arrive
Once the region shows Active in the dashboard, capture a few packets before writing any code:
sudo tcpdump -ni any -c 20 udp port 20000 and src host 198.13.140.100tcpdump sees packets before the host firewall does. Packets here but nothing in your listener point to a host firewall rule. No packets at all point to the cloud firewall, NAT, the registered IP:port, or a stream that is not active yet. See Troubleshooting.
4. Receive Shreds
Both listeners treat each datagram as one shred and read Agave’s 83-byte common header, little-endian: a 64-byte signature, the variant byte, then slot, index, shred version and FEC set index.
Python
# Raiden Surge: print the common header of every raw shred that arrives over UDP
import socket
import struct
PORT = 20000 # the UDP port you registered in the dashboard
KIND = {0x60: "code", 0x70: "code", 0x90: "data", 0xB0: "data"}
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 32 * 1024 * 1024) # capped by net.core.rmem_max
sock.bind(("0.0.0.0", PORT))
while True:
pkt, (src, _) = sock.recvfrom(2048) # one datagram = one shred (1203 B data, 1228 B coding)
if len(pkt) < 83: # the common shred header is 83 bytes
continue
variant = pkt[64] # right after the 64-byte signature
slot, index, version, fec_set = struct.unpack_from("<QIHI", pkt, 65) # little-endian
kind = KIND.get(variant & 0xF0, "unknown")
print(f"slot={slot} index={index} fec_set={fec_set} variant=0x{variant:02x} {kind} {len(pkt)}B from {src}")Rust (std only)
// Raiden Surge: print the common header of every raw shred that arrives over UDP
use std::net::UdpSocket;
fn main() -> std::io::Result<()> {
let sock = UdpSocket::bind("0.0.0.0:20000")?; // the UDP port you registered in the dashboard
let mut buf = [0u8; 2048]; // one datagram = one shred (1203 B data, 1228 B coding)
loop {
let (n, from) = sock.recv_from(&mut buf)?;
if n < 83 {
continue; // the common shred header is 83 bytes
}
let p = &buf[..n];
let variant = p[64]; // right after the 64-byte signature
let slot = u64::from_le_bytes(p[65..73].try_into().unwrap());
let index = u32::from_le_bytes(p[73..77].try_into().unwrap());
let fec_set = u32::from_le_bytes(p[79..83].try_into().unwrap());
let kind = match variant & 0xF0 {
0x60 | 0x70 => "code",
0x90 | 0xB0 => "data",
_ => "unknown",
};
println!("slot={slot} index={index} fec_set={fec_set} variant={variant:#04x} {kind} {n}B from {}", from.ip());
}
}A variant high nibble of 0x60 or 0x70 is a Merkle coding shred, and 0x90 or 0xB0 a Merkle data shred; current Agave accepts only these four, so anything else prints as unknown. In current Agave a data shred is 1,203 bytes and a coding shred 1,228 bytes.
The Python listener asks for a 32 MB receive buffer, which Linux caps at net.core.rmem_max: raise it with sudo sysctl -w net.core.rmem_max=33554432. The Rust listener keeps the OS default, because std::net::UdpSocket cannot set SO_RCVBUF; use the socket2 crate (set_recv_buffer_size) for a larger one. This is general Linux tuning, not a Raiden requirement.
From Shreds to Transactions
Shreds are not transactions yet. To get transactions out, group shreds by slot and FEC set, recover missing data shreds from the coding shreds, concatenate the data and decode the entries. UDP has no retransmission, so deduplication and loss handling are part of the job. Three routes:
- Your own deshredder: full control, full maintenance.
- Raiden’s public proxy: raiden-shredstream-proxy receives raw UDP shreds on
--src-bind-port, deshreds them and serves the entries over gRPC with theSubscribeEntriesinterface from Jito’s proto. Register its address and port as your Surge destination, and test it against your workload before you rely on it. - Let Raiden decode: if transactions are all you need, Pulse does the deshredding on Raiden’s side and filters by account. See decoded shreds (Raiden Pulse) and the Pulse client guide.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| tcpdump shows nothing | The region is not Active yet (trial pending approval, payment not confirmed); a cloud firewall, security group or NAT drops inbound UDP; the registered IP:port is not the host’s public address and port | Check the region status in the dashboard; allow the UDP port from the APEX IP in the cloud firewall; forward the port through NAT; compare the registered destination with the host |
| tcpdump shows packets, the listener prints nothing | The host firewall (ufw, iptables, nftables) drops them, or the listener is bound to another port | Add the allow rule from step 2; bind to 0.0.0.0 on the registered port |
| Gaps in indexes during bursts | The socket receive buffer overflows | Raise SO_RCVBUF and net.core.rmem_max; read the socket on a dedicated thread |
| The dashboard refuses the destination as already in use | That IP:port already carries an active subscription | Register another port |
| The dashboard refuses a destination change | Less than 60 seconds since the last change | Wait a minute and retry |
| The trial stays In review (Pending approval on the region card) | Trials are reviewed by hand | Open a ticket on Discord |
Pricing
$49 per day, $199 per week or $499 per 30 days, per region, paid in USDC on Solana from the dashboard. Each region is billed independently. Full rate card: Pricing.