Wisp reads configuration from several sources, applied in order, each overriding the last:
Built-in defaults (shown in the tables below).
A TOML file, if you pass one: wisp relay wisp.toml.
Environment variables (WISP_*), which override the file.
A few CLI flags (--spider-admin, --db), which override everything for the settings they touch.
So an environment variable always wins over the same setting in the TOML file. Copy
wisp.toml.example to
wisp.toml to start from an annotated template.
wisp [command] [config.toml]
Commands:
relay [config] Start the relay server (default if omitted)
import Import events from stdin (JSONL)
export Export all events to stdout (JSONL)
help Show help
Flags:
--spider-admin <npub|hex> Enable spider mode and follow this pubkey's contacts
--db <path> Database path for import/export (default ./data)
The relay’s storage path comes from [storage] path / WISP_STORAGE_PATH. --db applies
to the import and export commands only. --spider-admin accepts an npub (decoded to
hex), unlike the file/env spider settings which expect raw hex.
Each setting lists its TOML key (under its [section]), its environment variable, type, and
default. Settings with no environment variable are configurable only via the TOML file.
LMDB data directory. Point at /dev/shm/wisp/data (tmpfs) for lowest latency; data is then lost on reboot (see warning).
map_size_mb
—
u32
10240
LMDB maximum map size in MB. The hard upper bound on database size.
sync
WISP_STORAGE_SYNC
enum
meta
Write durability: none, meta, or full. See Durability.
Warning:/dev/shm is volatile tmpfs — all data is lost on reboot. Use it only for
benchmarks or disposable caches. For production, point path at persistent storage and/or
configure backups.
sync controls how aggressively LMDB flushes to disk on each commit, trading throughput for
crash safety:
Mode
Behavior
On crash / power loss
none
MDB_NOSYNC + MDB_NOMETASYNC: no flush on commit. Fastest.
Recent commits can be lost, and the database can be corrupted.
meta (default)
Flush data on every commit, defer only the metapage fsync.
The last transaction may roll back, but the database stays consistent.
full
Fsync on every commit. Durable.
No acknowledged write is lost.
In the durable modes (meta/full) writes go through a group-commit writer
thread: events that arrive close together are committed in one transaction, so a
batch pays a single fsync rather than one per event. Throughput therefore scales
with how many clients publish concurrently.
The default is meta: it never corrupts the database and at worst loses the last
transaction on a crash. Use full when no acknowledged write may ever be lost, or
none for maximum throughput on a relay where the data is disposable (a cache or
benchmark) and a crash may corrupt the database. none uses a faster synchronous
write path, since there is no fsync to amortize.
Honor X-Forwarded-For / X-Real-IP for the client IP. Enable only behind a reverse proxy whose backend port is not directly reachable, or clients can spoof their IP.
trusted_proxies
WISP_TRUSTED_PROXIES
csv
(empty)
IPs/prefixes of proxies whose forwarded headers are trusted. Empty with trust_proxy=true trusts any peer.
max_connections_per_ip
WISP_MAX_CONNECTIONS_PER_IP
u32
10
Per-IP concurrent connection cap.
ip_whitelist
WISP_IP_WHITELIST
csv
(empty)
If set, only these IPs/prefixes may connect.
ip_blacklist
WISP_IP_BLACKLIST
csv
(empty)
These IPs/prefixes are refused.
IP list entries match exactly unless they end in . (IPv4 prefix) or : (IPv6 prefix), e.g.
10.0.0. matches 10.0.0.0–10.0.0.255. CIDR notation and * wildcards are not supported.
Spider mode keeps your relay populated by syncing events from the people you follow. Set
admin to your hex pubkey (or pass --spider-admin npub1... on the CLI) and Wisp fetches
your contact list and mirrors their notes from the configured relays:
Operational metrics are served in Prometheus format at GET /metrics on the relay port:
connection counts, events stored/rejected/broadcast, REQ totals, and rate-limit counters. The
endpoint honors ip_whitelist/ip_blacklist, so restrict it there or at your reverse
proxy/firewall if it should not be public.