#include <config.h>
|
| uint16_t | listen_port = 0 |
| | Listen port for inbound peers.
|
| |
| bool | enable_listen = true |
| |
| std::string | bind_address = "" |
| | Interface to bind the listener to.
|
| |
| size_t | reactor_threads = 1 |
| | Number of reactor threads.
|
| |
| size_t | max_peers = 0 |
| | Maximum number of established peers.
|
| |
| Security | security = Security::Noise |
| |
| std::string | protocol = "librats/1.0" |
| | Application protocol identity, bound into the Noise handshake prologue, so two nodes whose protocol differs cannot complete a handshake — a cheap, cryptographically-enforced way to keep separate apps (or app versions) from cross-connecting.
|
| |
| std::string | data_dir = "" |
| | Directory for persistent state.
|
| |
| bool | enable_network_monitor = true |
| | Watch the host for network configuration changes (interface up/down, IP add/remove, route flip, wake-from-sleep) and publish NetworkChanged on the node's EventBus so subsystems can renew port mappings, re-run STUN and re-announce.
|
| |
Definition at line 14 of file config.h.
◆ Security
Secure channel to use for peer connections.
| Enumerator |
|---|
| Noise | |
| Plaintext | |
Definition at line 41 of file config.h.
◆ bind_address
| std::string librats::NodeConfig::bind_address = "" |
Interface to bind the listener to.
The address family is derived from it:
- "" or "::" → dual-stack wildcard: reachable over both IPv6 and IPv4 (IPv4-mapped) on all interfaces. This is the default.
- "0.0.0.0" → IPv4 on all interfaces.
- an IPv6 literal → IPv6-only, that interface (e.g. "::1" for v6 loopback).
- an IPv4 literal → IPv4, that interface (e.g. "127.0.0.1" for v4 loopback). Bare IPv6 literals are written without brackets here; peer endpoints rendered as text use bracketed "[ip]:port" form (see core/address.h).
Definition at line 28 of file config.h.
◆ data_dir
| std::string librats::NodeConfig::data_dir = "" |
Directory for persistent state.
Empty = ephemeral (a fresh random identity each run). When set, the node's Noise keypair is loaded from / saved to "<data_dir>/identity.key", giving a stable PeerId across restarts.
Definition at line 55 of file config.h.
◆ enable_listen
| bool librats::NodeConfig::enable_listen = true |
◆ enable_network_monitor
| bool librats::NodeConfig::enable_network_monitor = true |
Watch the host for network configuration changes (interface up/down, IP add/remove, route flip, wake-from-sleep) and publish NetworkChanged on the node's EventBus so subsystems can renew port mappings, re-run STUN and re-announce.
Costs one mostly-idle monitor thread. See node/host_events.h.
Definition at line 61 of file config.h.
◆ listen_port
| uint16_t librats::NodeConfig::listen_port = 0 |
Listen port for inbound peers.
0 picks an ephemeral port. Ignored if enable_listen is false (client-only node).
Definition at line 17 of file config.h.
◆ max_peers
| size_t librats::NodeConfig::max_peers = 0 |
Maximum number of established peers.
0 means unlimited. The limit guards inbound connections (a flood is refused at accept, before any handshake); outbound dials we initiate are always honored. Runtime-adjustable via Node::set_max_peers().
Definition at line 38 of file config.h.
◆ protocol
| std::string librats::NodeConfig::protocol = "librats/1.0" |
Application protocol identity, bound into the Noise handshake prologue, so two nodes whose protocol differs cannot complete a handshake — a cheap, cryptographically-enforced way to keep separate apps (or app versions) from cross-connecting.
An opaque string compared for exact equality; by convention "<name>/<version>". Both peers must match. (Under Plaintext it is still checked, but not cryptographically bound — see PlaintextSecurity.)
Definition at line 50 of file config.h.
◆ reactor_threads
| size_t librats::NodeConfig::reactor_threads = 1 |
Number of reactor threads.
1 is plenty for thousands of peers; larger pools shard outbound connections across cores.
Definition at line 32 of file config.h.
◆ security
The documentation for this struct was generated from the following file: