rippled
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ripple::PeerFinder::Config Struct Reference

PeerFinder configuration settings. More...

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

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

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

Detailed Description

PeerFinder configuration settings.

Definition at line 40 of file PeerfinderManager.h.

Constructor & Destructor Documentation

◆ Config()

ripple::PeerFinder::Config::Config ( )

Create a configuration with default values.

Definition at line 26 of file PeerfinderConfig.cpp.

Member Function Documentation

◆ calcOutPeers()

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

Returns a suitable value for outPeers according to the rules.

Definition at line 38 of file PeerfinderConfig.cpp.

◆ applyTuning()

void ripple::PeerFinder::Config::applyTuning ( )

Adjusts the values so they follow the business rules.

Definition at line 46 of file PeerfinderConfig.cpp.

◆ onWrite()

void ripple::PeerFinder::Config::onWrite ( beast::PropertyStream::Map map)

Write the configuration into a property stream.

Definition at line 66 of file PeerfinderConfig.cpp.

◆ makeConfig()

Config ripple::PeerFinder::Config::makeConfig ( ripple::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 78 of file PeerfinderConfig.cpp.

Member Data Documentation

◆ maxPeers

std::size_t ripple::PeerFinder::Config::maxPeers

The largest number of public peer slots to allow.

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

Definition at line 46 of file PeerfinderManager.h.

◆ outPeers

std::size_t ripple::PeerFinder::Config::outPeers

The number of automatic outbound connections to maintain.

Outbound connections are only maintained if autoConnect is true.

Definition at line 52 of file PeerfinderManager.h.

◆ inPeers

std::size_t ripple::PeerFinder::Config::inPeers

The number of automatic inbound connections to maintain.

Inbound connections are only maintained if wantIncoming is true.

Definition at line 58 of file PeerfinderManager.h.

◆ peerPrivate

bool ripple::PeerFinder::Config::peerPrivate = true

true if we want our IP address kept private.

Definition at line 61 of file PeerfinderManager.h.

◆ wantIncoming

bool ripple::PeerFinder::Config::wantIncoming

true if we want to accept incoming connections.

Definition at line 64 of file PeerfinderManager.h.

◆ autoConnect

bool ripple::PeerFinder::Config::autoConnect

true if we want to establish connections automatically

Definition at line 67 of file PeerfinderManager.h.

◆ listeningPort

std::uint16_t ripple::PeerFinder::Config::listeningPort

The listening port number.

Definition at line 70 of file PeerfinderManager.h.

◆ features

std::string ripple::PeerFinder::Config::features

The set of features we advertise.

Definition at line 73 of file PeerfinderManager.h.

◆ ipLimit

int ripple::PeerFinder::Config::ipLimit

Limit how many incoming connections we allow per IP.

Definition at line 76 of file PeerfinderManager.h.