#include <dht_discovery.h>
Public Attributes | |
| uint16_t | dht_port = 0 |
| 0 = ephemeral | |
| std::string | bind_address = "" |
| std::string | data_dir = "" |
| routing-table persistence dir (empty = cwd). Set to the node's data_dir to co-locate state. | |
| bool | enable_ipv4 = true |
| run the IPv4 Kademlia network | |
| bool | enable_ipv6 = true |
| run the IPv6 Kademlia network (BEP 32) | |
| std::string | discovery_key = "" |
DHT namespace. Empty → the node's protocol (resolved at attach), so peers of the same app/version discover each other and mismatched protocols (which can't handshake anyway) don't even meet. Set non-empty to override with a custom discovery network. | |
| std::vector< HostEndpoint > | bootstrap_nodes |
| empty → default internet nodes | |
| std::chrono::milliseconds | search_interval {30000} |
| std::chrono::milliseconds | announce_interval {600000} |
| every 30 seconds | |
| bool | discover_external_ip = true |
| Probe a STUN server once at startup to learn our public IP and seed the DHT node id per BEP 42. | |
| std::vector< HostEndpoint > | stun_servers |
| empty → built-in public defaults | |
| std::chrono::milliseconds | stun_timeout {3000} |
Definition at line 43 of file dht_discovery.h.
| std::chrono::milliseconds librats::DhtDiscovery::Config::announce_interval {600000} |
every 30 seconds
Re-announce cadence. Kept at ~⅓ of the peer TTL (librats stores announced peers for 30 min, libtorrent ~45 min) so we stay findable with a comfortable margin even if an announce or two is lost — libtorrent's own default is 15 min. A fresh node still announces immediately at startup regardless of this value (see loop()).
Definition at line 56 of file dht_discovery.h.
| std::string librats::DhtDiscovery::Config::bind_address = "" |
Definition at line 45 of file dht_discovery.h.
| std::vector<HostEndpoint> librats::DhtDiscovery::Config::bootstrap_nodes |
empty → default internet nodes
Definition at line 50 of file dht_discovery.h.
| std::string librats::DhtDiscovery::Config::data_dir = "" |
routing-table persistence dir (empty = cwd). Set to the node's data_dir to co-locate state.
Definition at line 46 of file dht_discovery.h.
| uint16_t librats::DhtDiscovery::Config::dht_port = 0 |
0 = ephemeral
Definition at line 44 of file dht_discovery.h.
| bool librats::DhtDiscovery::Config::discover_external_ip = true |
Probe a STUN server once at startup to learn our public IP and seed the DHT node id per BEP 42.
Without it we still converge via the slower in-DHT "ip" voting, but bootstrap under the wrong node id until then.
Definition at line 61 of file dht_discovery.h.
| std::string librats::DhtDiscovery::Config::discovery_key = "" |
DHT namespace. Empty → the node's protocol (resolved at attach), so peers of the same app/version discover each other and mismatched protocols (which can't handshake anyway) don't even meet. Set non-empty to override with a custom discovery network.
Definition at line 49 of file dht_discovery.h.
| bool librats::DhtDiscovery::Config::enable_ipv4 = true |
run the IPv4 Kademlia network
Definition at line 47 of file dht_discovery.h.
| bool librats::DhtDiscovery::Config::enable_ipv6 = true |
run the IPv6 Kademlia network (BEP 32)
Definition at line 48 of file dht_discovery.h.
| std::chrono::milliseconds librats::DhtDiscovery::Config::search_interval {30000} |
Definition at line 51 of file dht_discovery.h.
| std::vector<HostEndpoint> librats::DhtDiscovery::Config::stun_servers |
empty → built-in public defaults
Definition at line 62 of file dht_discovery.h.
| std::chrono::milliseconds librats::DhtDiscovery::Config::stun_timeout {3000} |
Definition at line 63 of file dht_discovery.h.