xrpld
Loading...
Searching...
No Matches
xrpl::PeerFinder::Config Struct Reference

PeerFinder configuration settings. More...

#include <PeerfinderManager.h>

Collaboration diagram for xrpl::PeerFinder::Config:

Public Member Functions

 Config ()
 Create a configuration with default values.
std::size_t calcOutPeers () const
 Returns a suitable value for outPeers according to the rules.
void applyTuning ()
 Adjusts the values so they follow the business rules.
void onWrite (beast::PropertyStream::Map &map) const
 Write the configuration into a property stream.

Static Public Member Functions

static Config makeConfig (xrpl::Config const &config, std::uint16_t port, bool validationPublicKey, int ipLimit, bool verifyEndpoints)
 Make PeerFinder::Config from configuration parameters.

Public Attributes

std::size_t maxPeers {Tuning::kDefaultMaxPeers}
 The largest number of public peer slots to allow.
std::size_t outPeers
 The number of automatic outbound connections to maintain.
std::size_t inPeers {0}
 The number of automatic inbound connections to maintain.
bool peerPrivate = true
 true if we want our IP address kept private.
bool wantIncoming {true}
 true if we want to accept incoming connections.
bool autoConnect {true}
 true if we want to establish connections automatically
std::uint16_t listeningPort {0}
 The listening port number.
std::string features
 The set of features we advertise.
int ipLimit {0}
 Limit how many incoming connections we allow per IP.
bool verifyEndpoints = true
 true if we want to verify endpoints in TMEndpoints messages

Friends

bool operator== (Config const &lhs, Config const &rhs)=default

Detailed Description

PeerFinder configuration settings.

Definition at line 24 of file PeerfinderManager.h.

Constructor & Destructor Documentation

◆ Config()

xrpl::PeerFinder::Config::Config ( )

Create a configuration with default values.

Definition at line 13 of file PeerfinderConfig.cpp.

Member Function Documentation

◆ calcOutPeers()

std::size_t xrpl::PeerFinder::Config::calcOutPeers ( ) const
nodiscard

Returns a suitable value for outPeers according to the rules.

Definition at line 19 of file PeerfinderConfig.cpp.

◆ applyTuning()

void xrpl::PeerFinder::Config::applyTuning ( )

Adjusts the values so they follow the business rules.

Definition at line 26 of file PeerfinderConfig.cpp.

◆ onWrite()

void xrpl::PeerFinder::Config::onWrite ( beast::PropertyStream::Map & map) const

Write the configuration into a property stream.

Definition at line 45 of file PeerfinderConfig.cpp.

◆ makeConfig()

Config xrpl::PeerFinder::Config::makeConfig ( xrpl::Config const & config,
std::uint16_t port,
bool validationPublicKey,
int ipLimit,
bool verifyEndpoints )
static

Make PeerFinder::Config from configuration parameters.

Parameters
configserver's configuration
portserver's listening port
validationPublicKeytrue if validation public key is not empty
ipLimitlimit of incoming connections per IP
verifyEndpointstrue if we want to verify endpoints in TMEndpoints messages
Returns
PeerFinder::Config

Definition at line 58 of file PeerfinderConfig.cpp.

◆ operator==

bool operator== ( Config const & lhs,
Config const & rhs )
friend

Member Data Documentation

◆ maxPeers

std::size_t xrpl::PeerFinder::Config::maxPeers {Tuning::kDefaultMaxPeers}

The largest number of public peer slots to allow.

This includes both inbound and outbound, but does not include fixed peers.

Definition at line 30 of file PeerfinderManager.h.

◆ outPeers

std::size_t xrpl::PeerFinder::Config::outPeers

The number of automatic outbound connections to maintain.

Outbound connections are only maintained if autoConnect is true.

Definition at line 36 of file PeerfinderManager.h.

◆ inPeers

std::size_t xrpl::PeerFinder::Config::inPeers {0}

The number of automatic inbound connections to maintain.

Inbound connections are only maintained if wantIncoming is true.

Definition at line 42 of file PeerfinderManager.h.

◆ peerPrivate

bool xrpl::PeerFinder::Config::peerPrivate = true

true if we want our IP address kept private.

Definition at line 45 of file PeerfinderManager.h.

◆ wantIncoming

bool xrpl::PeerFinder::Config::wantIncoming {true}

true if we want to accept incoming connections.

Definition at line 48 of file PeerfinderManager.h.

◆ autoConnect

bool xrpl::PeerFinder::Config::autoConnect {true}

true if we want to establish connections automatically

Definition at line 51 of file PeerfinderManager.h.

◆ listeningPort

std::uint16_t xrpl::PeerFinder::Config::listeningPort {0}

The listening port number.

Definition at line 54 of file PeerfinderManager.h.

◆ features

std::string xrpl::PeerFinder::Config::features

The set of features we advertise.

Definition at line 57 of file PeerfinderManager.h.

◆ ipLimit

int xrpl::PeerFinder::Config::ipLimit {0}

Limit how many incoming connections we allow per IP.

Definition at line 60 of file PeerfinderManager.h.

◆ verifyEndpoints

bool xrpl::PeerFinder::Config::verifyEndpoints = true

true if we want to verify endpoints in TMEndpoints messages

Definition at line 63 of file PeerfinderManager.h.