1#include <xrpl/peerfinder/Config.h>
3#include <xrpl/beast/utility/PropertyStream.h>
57 bool validationPublicKey,
118 if (validationPublicKey)
static constexpr auto kOutPercent
The percentage of total peer slots that are outbound.
static constexpr auto kDefaultMaxPeers
The default value of Config::maxPeers.
static constexpr auto kMinOutCount
A hard minimum on the number of outgoing connections.
PeerFinder configuration settings.
std::size_t outPeers
The number of automatic outbound connections to maintain.
void onWrite(beast::PropertyStream::Map &map) const
Write the configuration into a property stream.
bool wantIncoming
true if we want to accept incoming connections.
bool peerPrivate
true if we want our IP address kept private.
std::uint16_t listeningPort
The listening port number.
bool autoConnect
true if we want to establish connections automatically
void applyTuning()
Adjusts the values so they follow the business rules.
static Config makeConfig(bool peerPrivate, bool standalone, PeerLimitConfig const &limits, std::uint16_t port, bool validationPublicKey, int ipLimit, bool verifyEndpoints)
Make peer_finder::Config from peer limit and server mode parameters.
std::size_t inPeers
The number of automatic inbound connections to maintain.
std::size_t maxPeers
The largest number of public peer slots to allow.
int ipLimit
Limit how many incoming connections we allow per IP.
std::size_t calcOutPeers() const
Returns a suitable value for outPeers according to the rules.
bool verifyEndpoints
true if we want to verify endpoints in TMEndpoints messages
std::string features
The set of features we advertise.
std::optional< std::size_t > outPeers
std::optional< std::size_t > maxPeers
std::optional< std::size_t > inPeers