Configuration

All configurable settings for agents, relay, and bridge.

Agent configuration#

Set via AgentNodeBuilder methods or CLI flags.

SettingDefaultBuilder methodCLI flag
Agent nameRequired.name("x")--name x
Relay addressrelay.subway.dev:9000.relay("host:port")--relay host:port
Key path.subway/keys.key_path("/path")
mDNS discoveryOff.with_mdns()
DHT discoveryOff.with_dht()
JSONL outputOff--jsonl
Control socketOn--no-ctl

Relay configuration#

SettingDefaultDescription
Listen address0.0.0.0:9000QUIC/WebTransport listener
HTTP port9001Health check + REST bridge
Identity path.subway/relay-keysKeypair storage
Max connections1,000,000Connection limit
Max reservations1,000,000Circuit reservation limit

Bridge configuration#

SettingDefaultCLI flagDescription
Listen port9002--port NREST + WebSocket port
Relay addressrelay.subway.dev:9000--relay host:portRelay to connect to

Internal constants#

These are compiled into the binary and not configurable at runtime:

ConstantValueLocation
RELAY_CONNECT_TIMEOUT10ssubway-core/src/node.rs
RPC_DEFAULT_TIMEOUT30ssubway-core/src/node.rs
NAME_RENEWAL_INTERVAL30ssubway-core/src/node.rs
RECONNECT_INITIAL_DELAY1ssubway-core/src/node.rs
RECONNECT_MAX_DELAY30ssubway-core/src/node.rs
RECONNECT_MAX_ATTEMPTS10subway-core/src/node.rs
NAME_RENEWAL_MAX_FAILURES5subway-core/src/node.rs

Environment variables#

VariableUsed byDescription
RUST_LOGAllLog level (info, debug, subway_core=debug)
SUBWAY_INSTALL_DIRinstall.shCustom install directory
SUBWAY_NO_BREWinstall.shForce binary install over Homebrew
SUBWAY_VERSIONinstall.shInstall specific version

Log levels#

LevelWhat you see
errorDispatcher errors, exhausted reconnects
warnRenewal failures, decode errors
infoAgent ready, relay events, reconnections
debugDetailed networking (very verbose)
RUST_LOG=info subway agent --name test.relay
RUST_LOG=subway_core=debug subway agent --name test.relay