Skip to content

Deploy a Relay

Prerequisites

  • Rust toolchain (1.75+)
  • Linux server with a public IP
  • UDP port 4433 open (QUIC transport)
  • TCP port 8443 open (HTTP health check)
  • TCP port 5000 open (gRPC DataPlaneService)

Build from source

Terminal window
git clone https://github.com/nicholasraimbault/static.git
cd static
cargo build --release -p static-supernode

The binary is at target/release/static-supernode.

Configure

Create supernode.toml:

[server]
listen_port = 4433
data_dir = "/opt/static/data"
health_listen_addr = "0.0.0.0:8443"
grpc_listen_addr = "0.0.0.0:5000"
jwt_secret = "your-hs256-secret-here"
message_ttl_days = 7
[privacy]
batch_interval_ms = 500
accept_direct_connections = false
[limits]
max_connections = 256
max_channels = 64
max_message_size = 1048576

Configuration reference

SectionFieldDefaultDescription
serverlisten_port4433QUIC transport port
serverdata_dir./dataPersistent data directory
serverhealth_listen_addr0.0.0.0:8443HTTP health endpoint
servergrpc_listen_addr(none)gRPC address — set to enable SLIM interface
serverjwt_secret(none)HS256 secret for JWT auth — set to enable authentication
servergrpc_tls_cert(none)Path to PEM TLS certificate for gRPC
servergrpc_tls_key(none)Path to PEM TLS private key for gRPC
servermessage_ttl_days7Days to retain archived messages
privacybatch_interval_ms500Message batching interval (0 to disable)
privacyaccept_direct_connectionsfalseAccept non-relay QUIC connections
limitsmax_connections256Maximum concurrent connections
limitsmax_channels64Maximum channels
limitsmax_message_size262144Maximum message payload (bytes)

Enabling TLS on gRPC

To secure the gRPC endpoint with TLS, add both cert and key paths:

[server]
grpc_tls_cert = "/etc/ssl/relay.crt"
grpc_tls_key = "/etc/ssl/relay.key"

Both fields must be set together. When configured, the gRPC server terminates TLS. Agents connect via https:// instead of http://.

Run

Terminal window
./static-supernode --config supernode.toml

CLI options:

FlagDefaultDescription
-c, --configsupernode.tomlConfig file path
-p, --port(from config)Override QUIC listen port
--log-levelinfoLog level (trace, debug, info, warn, error)
--drain-timeout60Seconds to drain connections on graceful restart

Verify

  1. HTTP health check

    Terminal window
    curl http://localhost:8443/health
    # {"status":"ok","uptime":42}
  2. gRPC health check

    Terminal window
    grpcurl -plaintext localhost:5000 grpc.health.v1.Health/Check
    # { "status": "SERVING" }
  3. gRPC reflection (list available services)

    Terminal window
    grpcurl -plaintext localhost:5000 list
    # dataplane.proto.v1.DataPlaneService
    # grpc.health.v1.Health
    # grpc.reflection.v1.ServerReflection

gRPC services

When grpc_listen_addr is set, the relay serves three gRPC services:

ServiceDescription
DataPlaneServiceSLIM bidirectional streaming (Subscribe, Publish, Unsubscribe)
grpc.health.v1.HealthStandard health check — reports DataPlaneService as SERVING
grpc.reflection.v1.ServerReflectionSchema discovery — agents introspect the API at runtime

Systemd

Example unit file:

[Unit]
Description=Skytale Relay
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=static
ExecStart=/opt/static/bin/static-supernode --config /opt/static/config/supernode.toml
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
NoNewPrivileges=yes
ProtectSystem=strict
ReadWritePaths=/opt/static/data
[Install]
WantedBy=multi-user.target

Point your SDK at the relay

from static_sdk import StaticClient
client = StaticClient(
"https://your-relay:5000",
"/tmp/agent",
b"my-agent",
api_key="sk_live_...",
api_url="https://api.skytale.sh",
)