rippled
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
xrpl::PeerFinder::Config Struct Reference

PeerFinder configuration settings. More...

#include <PeerfinderManager.h>

Collaboration diagram for xrpl::PeerFinder::Config:
Collaboration graph
[legend]

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)
 Make PeerFinder::Config from configuration parameters.
 

Public Attributes

std::size_t maxPeers {Tuning::defaultMaxPeers}
 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.
 

Friends

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

Detailed Description

PeerFinder configuration settings.

Definition at line 26 of file PeerfinderManager.h.

Constructor & Destructor Documentation

◆ Config()

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

Create a configuration with default values.

Definition at line 9 of file PeerfinderConfig.cpp.

Member Function Documentation

◆ calcOutPeers()

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

Returns a suitable value for outPeers according to the rules.

Definition at line 25 of file PeerfinderConfig.cpp.

◆ applyTuning()

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

Adjusts the values so they follow the business rules.

Definition at line 31 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 50 of file PeerfinderConfig.cpp.

◆ makeConfig()

Config xrpl::PeerFinder::Config::makeConfig ( xrpl::Config const &  config,
std::uint16_t  port,
bool  validationPublicKey,
int  ipLimit 
)
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
Returns
PeerFinder::Config

Definition at line 62 of file PeerfinderConfig.cpp.

Friends And Related Symbol Documentation

◆ operator==

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

Definition at line 15 of file PeerfinderConfig.cpp.

Member Data Documentation

◆ maxPeers

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

The largest number of public peer slots to allow.

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

Definition at line 32 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 38 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 44 of file PeerfinderManager.h.

◆ peerPrivate

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

true if we want our IP address kept private.

Definition at line 47 of file PeerfinderManager.h.

◆ wantIncoming

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

true if we want to accept incoming connections.

Definition at line 50 of file PeerfinderManager.h.

◆ autoConnect

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

true if we want to establish connections automatically

Definition at line 53 of file PeerfinderManager.h.

◆ listeningPort

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

The listening port number.

Definition at line 56 of file PeerfinderManager.h.

◆ features

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

The set of features we advertise.

Definition at line 59 of file PeerfinderManager.h.

◆ ipLimit

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

Limit how many incoming connections we allow per IP.

Definition at line 62 of file PeerfinderManager.h.