Back to Site
Loading...
Searching...
No Matches
librats::PeerExchange::Config Struct Reference

#include <peer_exchange.h>

Public Attributes

size_t max_addresses_per_response = 32
 cap entries we send / act on per response
size_t request_max = 32
 how many peers we ask for on connect
bool request_on_connect = true
bool public_only = false
 only share globally-routable addresses
std::chrono::milliseconds dial_cooldown {std::chrono::minutes(5)}
 re-dial suppression
size_t max_recent_dials = 4096
 bound the cooldown set
size_t peer_target = 0
 Stop dialing discovered peers once this many are connected.
bool punch_on_dial_failure = true
 Ask HolePunch to reach a discovered peer whose address would not dial.
std::chrono::milliseconds punch_window {std::chrono::seconds(30)}
 How long a dial started here stays eligible for that fallback.
size_t max_pending_dials = 512
 Bound on dials awaiting their verdict — one entry is an address and an id.
bool introduce_requesters = false
 Tell the peers an answer left out about the peer that asked, so that a small mesh whose members join through one another closes even when two join at once (see above).

Detailed Description

Definition at line 82 of file peer_exchange.h.

Member Data Documentation

◆ dial_cooldown

std::chrono::milliseconds librats::PeerExchange::Config::dial_cooldown {std::chrono::minutes(5)}

re-dial suppression

Definition at line 87 of file peer_exchange.h.

◆ introduce_requesters

bool librats::PeerExchange::Config::introduce_requesters = false

Tell the peers an answer left out about the peer that asked, so that a small mesh whose members join through one another closes even when two join at once (see above).

Costs a message to each of those per peer joining — for a mesh of a few, not a swarm; off by default.

Definition at line 111 of file peer_exchange.h.

◆ max_addresses_per_response

size_t librats::PeerExchange::Config::max_addresses_per_response = 32

cap entries we send / act on per response

Definition at line 83 of file peer_exchange.h.

◆ max_pending_dials

size_t librats::PeerExchange::Config::max_pending_dials = 512

Bound on dials awaiting their verdict — one entry is an address and an id.

Definition at line 105 of file peer_exchange.h.

◆ max_recent_dials

size_t librats::PeerExchange::Config::max_recent_dials = 4096

bound the cooldown set

Definition at line 88 of file peer_exchange.h.

◆ peer_target

size_t librats::PeerExchange::Config::peer_target = 0

Stop dialing discovered peers once this many are connected.

0 (default) keeps the historical behaviour: grow without bound. Worth setting, because NodeConfig::max_peers guards inbound connections only — every discovered peer we dial is honored regardless of it, and PEX is the one discovery source that compounds (each new peer is asked for more peers). Answering other peers' requests is unaffected: that costs one message.

Definition at line 96 of file peer_exchange.h.

◆ public_only

bool librats::PeerExchange::Config::public_only = false

only share globally-routable addresses

Definition at line 86 of file peer_exchange.h.

◆ punch_on_dial_failure

bool librats::PeerExchange::Config::punch_on_dial_failure = true

Ask HolePunch to reach a discovered peer whose address would not dial.

A no-op when no HolePunch is attached.

Definition at line 100 of file peer_exchange.h.

◆ punch_window

std::chrono::milliseconds librats::PeerExchange::Config::punch_window {std::chrono::seconds(30)}

How long a dial started here stays eligible for that fallback.

Only has to outlive the dial itself (connect + handshake, ~15 s worst case).

Definition at line 103 of file peer_exchange.h.

◆ request_max

size_t librats::PeerExchange::Config::request_max = 32

how many peers we ask for on connect

Definition at line 84 of file peer_exchange.h.

◆ request_on_connect

bool librats::PeerExchange::Config::request_on_connect = true

Definition at line 85 of file peer_exchange.h.


The documentation for this struct was generated from the following file: