Setup & config
Install the ShredStream listener process and connect your application over a local Unix socket.
Install the listener
The listener is pre-installed on all OpenInfra servers. If you need to install manually:
curl -fsSL https://install.openinfra.sh/shredstream | bashConfigure environment
OPENINFRA_API_KEY=oi_live_xxxxxxxxxxxxPlace this in
/etc/openinfra/env.Enable as a systemd service
[Unit]Description=OpenInfra ShredStream listenerAfter=network-online.targetWants=network-online.target [Service]User=openinfraExecStart=/usr/local/bin/openinfra-shredstream \ --relay shred.openinfra.sh:1234 \ --api-key ${OPENINFRA_API_KEY} \ --bind 0.0.0.0:1235 \ --grpc-socket /run/shredstream/shred.sockEnvironmentFile=/etc/openinfra/envRestart=on-failureRestartSec=5 [Install]WantedBy=multi-user.targetsystemctl enable --now openinfra-shredstreamConnect your application
The listener exposes a local gRPC server over a Unix socket. Connect from your application without any network overhead:
import { createChannel, createClient } from "nice-grpc"; const channel = createChannel( "unix:///run/shredstream/shred.sock" // local IPC — no TLS); // The proto is bundled with openinfra-shredstreamconst client = createClient(ShredStreamDefinition, channel); for await (const shred of client.subscribe({})) { console.log("slot:", shred.slot, "index:", shred.index, "bytes:", shred.data.length);}
Verifying the connection
journalctl -u openinfra-shredstream -fYou should see lines like received shred slot=312449201 index=3 within a few seconds of the service starting.
Configuration options
--relay— ShredStream relay address (set automatically on OpenInfra servers).--bind— UDP port to receive shreds on. Firewall-open this from the relay IP.--grpc-socket— Unix socket path for local gRPC server.--grpc-port— Optional TCP gRPC port (useful for Docker networking).--max-lag-slots— Drop shreds for slots more than N behind current slot.