Skip to content

IFM Relay Station — Desktop Mesh Relay + Dashboard

Infrastructure-grade mesh relay with live operational dashboard. Runs headless in background, discoverable by all peers.


Overview

PropertyValue
Binaryifm-relay-station
Packagepackages/ifm-relay-station/
Coreifm-core via Tauri/N-API
UIReact + TypeScript (WebView) — optional, for dashboard
PlatformsWindows, macOS, Linux (x64 + arm64)
Installcurl -fsSL https://ifm.sh/install-relay-station.sh | bash

Features

Mesh Relay (Core)

  • Protocol-agnostic forwarding — Relays all frequencies, all packet types
  • Station-agnostic — No binding to specific stations; infrastructure only
  • GossipSub + Kademlia — Full libp2p mesh participation
  • Connection pooling — Manages 100–500 concurrent peers efficiently
  • Packet caching — Caches voice init segments for mid-stream joins
  • Peer scoring — Tit-for-tat bandwidth accounting (future rewards)

Live Dashboard (UI)

  • Real-time topology — Connected sessions (stations + listeners) with geo map
  • Frequency traffic — Active frequencies, packets/sec, bytes relayed
  • Relay pool — All known relays (including self) with health metrics
  • Live traffic feed — Packet stream: type, frequency, sender, size, latency
  • Resource monitors — CPU, memory, network I/O, open connections
  • Alerting — Configurable thresholds (peers, bandwidth, latency, errors)

System Integration

  • Headless mode--headless flag: no window, runs in background
  • System tray — Status icon, quick actions, notifications
  • systemd/launchd/Windows Service — Install as system service
  • Auto-restart — Crash recovery, update restart
  • Log rotation — Structured JSON logs, configurable retention

Discovery & Announcement

  • mDNS — Announces _ifm-relay._tcp.local with capabilities
  • DHT — Registers as relay peer; serves peer discovery
  • Relay pool — Shares pool with stations/listeners via HTTP /pool
  • Health endpointGET /health for load balancers/monitoring

Architecture


User Flow

Operator: First Launch (with UI)

Operator: Headless / Server

bash
# Install as service
ifm-relay-station --install-service

# Or run headless
ifm-relay-station --headless --config /etc/ifm/relay.toml

# Check status
ifm-relay-station --status
# → Relay: RUNNING | Peers: 47 | Frequencies: 12 | Up: 2h 13m

Station/Listener: Discovery

  • Stations query /pool endpoint or mDNS to find relays
  • Listeners connect to closest relay (RTT-based)
  • Relays never need manual config — fully automatic

Configuration

Stored in platform config dir:

  • macOS: ~/Library/Application Support/ifm-relay-station/
  • Windows: %APPDATA%\ifm-relay-station\
  • Linux: ~/.config/ifm-relay-station/ (or /etc/ifm/relay.toml for service)
toml
# relay.toml
[identity]
private_key = "ed25519..."          # Generated on first run
public_key = "ed25519..."

[network]
listen_addresses = ["/ip4/0.0.0.0/tcp/8790", "/ip4/0.0.0.0/udp/8790/quic-v1"]
advertise_addresses = []            # Auto-detected; override for NAT
quic_port = 8791
websocket_port = 8790

[relay]
max_peers = 500
max_pending = 1000
enable_tit_for_tat = true           # Peer scoring
min_score_for_relay = 0.1

[discovery]
mdns_enabled = true
dht_enabled = true
bootstrap_peers = [
  "/ip4/bootstrap.ifm.sh/tcp/8790/p2p/12D3KooW...",
  "/ip4/bootstrap2.ifm.sh/tcp/8790/p2p/12D3KooW..."
]
announce_interval_sec = 120

[dashboard]
enabled = true                      # Set false for pure headless
port = 5174                         # HTTP dashboard port
bind = "127.0.0.1"                  # Or "0.0.0.0" for LAN access
auth_token = ""                     # Optional: bearer token for dashboard API

[logging]
level = "info"                      # trace/debug/info/warn/error
format = "json"                     # json/text
output = "file"                     # file/stdout/both
file_path = "logs/relay-%Y-%m-%d.log"
max_files = 30
max_size_mb = 100

[service]
run_as_service = false              # Set true when installed as service
restart_on_failure = true
restart_delay_sec = 5

CLI Flags

bash
ifm-relay-station [OPTIONS]

Options:
  --headless                  No window, run in background
  --config <PATH>             Custom config file
  --install-service           Install as system service (systemd/launchd/Windows)
  --uninstall-service         Remove system service
  --start-service             Start installed service
  --stop-service              Stop installed service
  --status                    Print status and exit
  --pool                      Print relay pool JSON and exit
  --log-level <LEVEL>         trace/debug/info/warn/error
  --version                   Print version
  --help                      Show help

Dashboard API (when enabled)


Development

bash
cd packages/ifm-relay-station

# Install deps
bun install

# Dev mode (hot reload)
bun run tauri dev

# Build release
bun run tauri build

# Output: src-tauri/target/release/bundle/

Project Structure

packages/ifm-relay-station/
├── src/
│   ├── App.tsx              # Dashboard routing
│   ├── main.tsx             # Entry
│   ├── components/
│   │   ├── Sessions/        # Peer map, list, details
│   │   ├── Frequencies/     # Frequency stats, charts
│   │   ├── Traffic/         # Live packet feed, charts
│   │   ├── Pool/            # Relay pool view
│   │   ├── System/          # Resource monitors
│   │   └── Header/          # Brand, status, controls
│   ├── hooks/
│   │   ├── useRelay.ts      # Relay state + actions
│   │   ├── usePool.ts       # Relay pool discovery
│   │   ├── useTraffic.ts    # SSE traffic subscription
│   │   └── useSystem.ts     # Resource monitoring
│   ├── lib/
│   │   ├── ifm.ts           # Tauri command wrappers
│   │   └── api.ts           # Dashboard REST/WS client
│   └── styles/
├── src-tauri/
│   ├── Cargo.toml
│   ├── tauri.conf.json
│   ├── src/
│   │   ├── main.rs
│   │   ├── commands/
│   │   │   ├── relay.rs     # relay_start, stop, status, stats
│   │   │   ├── pool.rs      # pool_get, peers_get
│   │   │   ├── traffic.rs   # traffic_subscribe
│   │   │   ├── config.rs
│   │   │   └── service.rs   # install/start/stop service
│   │   └── lib.rs
│   └── icons/
├── package.json
├── tauri.conf.json
└── vite.config.ts

Release Artifacts

PlatformFormatSize (est.)
macOS arm64.dmg~22 MB
macOS x64.dmg~25 MB
Windows x64.msi~28 MB
Windows arm64.msi~26 MB
Linux x64.AppImage~30 MB
Linux arm64.AppImage~28 MB
Linux x64.deb~10 MB
Linux x64.rpm~10 MB

Deployment Patterns

Personal Relay (Desktop)

bash
# Install & run
curl -fsSL https://ifm.sh/install-relay-station.sh | bash
ifm-relay-station  # Opens dashboard, click Start

Dedicated Server (Headless)

bash
# On server
curl -fsSL https://ifm.sh/install-relay-station.sh | bash
sudo ifm-relay-station --install-service
sudo systemctl enable --now ifm-relay-station

# Verify
curl http://localhost:5174/health

Docker (ifm-node (https://github.com/ifmprotocol/ifm-node) is the container-native relay)

bash
docker run -d --name ifm-relay \
  -p 8790:8790 -p 8791:8791/udp \
  -v ifm-relay-data:/data \
  ghcr.io/ifm/ifm-node:stable

Released under the MIT License.