xrpld
Loading...
Searching...
No Matches
xrpl::peer_finder Namespace Reference

Namespaces

namespace  detail
namespace  tuning
 Heuristically tuned constants.

Classes

struct  PeerLimitConfig
struct  Config
 PeerFinder configuration settings. More...
class  Bootcache
 Stores IP addresses useful for gaining initial connections. More...
class  Checker
 Tests remote listening sockets to make sure they are connectable. More...
class  Counts
 Manages the count of available connections for the various slots. More...
class  Fixed
 Metadata for a Fixed slot. More...
class  RedirectHandouts
 Receives handouts for redirecting a connection. More...
class  SlotHandouts
 Receives endpoints for a slot during periodic handouts. More...
class  ConnectHandouts
 Receives handouts for making automatic connections. More...
class  Livecache
 The Livecache holds the short-lived relayed Endpoint messages. More...
class  Logic
 The Logic for maintaining the list of Slot addresses. More...
class  SlotImp
class  Source
 A static or dynamic source of peer addresses. More...
class  SourceStrings
 Provides addresses from a static set of strings. More...
class  Store
 Abstract persistence for PeerFinder data. More...
class  Manager
 Maintains a set of IP addresses used for getting into the network. More...
class  Slot
 Properties and state associated with a peer to peer overlay connection. More...
struct  Endpoint
 Describes a connectable peer address along with some metadata. More...
class  ManagerImp
class  SourceStringsImp
class  StoreSqdb
 Database persistence for PeerFinder using SQLite. More...

Typedefs

using clock_type = beast::AbstractClock<std::chrono::steady_clock>
using IPAddresses = std::vector<beast::ip::Endpoint>
 Represents a set of addresses.
using Endpoints = std::vector<Endpoint>
 A set of Endpoint used for connecting.

Enumerations

enum class  Result {
  InboundDisabled , DuplicatePeer , IpLimitExceeded , Full ,
  Success
}
 Possible results from activating a slot. More...
enum class  CountAdjustment : int { Decrement = -1 , Increment = 1 }
 Direction of a slot count adjustment. More...

Functions

std::string_view to_string (Result result) noexcept
 Converts a Result enum value to its string representation.
template<class TargetFwdIter, class SeqFwdIter>
void handout (TargetFwdIter first, TargetFwdIter last, SeqFwdIter seqFirst, SeqFwdIter seqLast)
 Distributes objects to targets according to business rules.
std::unique_ptr< ManagermakeManager (boost::asio::io_context &ioContext, clock_type &clock, beast::Journal journal, Store &store, beast::insight::Collector::ptr const &collector)
 Create a new Manager.
bool operator< (Endpoint const &lhs, Endpoint const &rhs)
 TEST_F (LivecacheTest, basic_insert)
 TEST_F (LivecacheTest, insert_update_keeps_lowest_hop_count)
 TEST_F (LivecacheTest, hop_iterators_support_const_reverse_and_move_back)
 TEST_F (LivecacheTest, on_write_reports_entries_and_expiration)
 TEST_F (LivecacheTest, expire_removes_entries_after_ttl)
 TEST_F (LivecacheTest, expire_removes_multiple_entries_after_ttl)
 TEST_F (LivecacheTest, histogram_counts_all_entries)
 TEST_F (LivecacheTest, shuffle_preserves_bucket_contents)
Config makeConfig (xrpl::Config const &cfg, std::uint16_t port, bool validationPublicKey, int ipLimit, bool verifyEndpoints)

Typedef Documentation

◆ clock_type

◆ IPAddresses

Represents a set of addresses.

Definition at line 18 of file peerfinder/Types.h.

◆ Endpoints

A set of Endpoint used for connecting.

Definition at line 44 of file peerfinder/Types.h.

Enumeration Type Documentation

◆ Result

enum class xrpl::peer_finder::Result
strong

Possible results from activating a slot.

Enumerator
InboundDisabled 
DuplicatePeer 
IpLimitExceeded 
Full 
Success 

Definition at line 127 of file include/xrpl/peerfinder/Config.h.

◆ CountAdjustment

enum class xrpl::peer_finder::CountAdjustment : int
strong

Direction of a slot count adjustment.

Enumerator
Decrement 
Increment 

Definition at line 18 of file Counts.h.

Function Documentation

◆ to_string()

std::string_view xrpl::peer_finder::to_string ( Result result)
noexcept

Converts a Result enum value to its string representation.

This function provides a human-readable string for a given Result enum, which is useful for logging, debugging, or displaying status messages.

Parameters
resultThe Result enum value to convert.
Returns
A std::string_view representing the enum value. Returns "unknown" if the enum value is not explicitly handled.
Note
This function returns a std::string_view for performance. A std::string would need to allocate memory on the heap and copy the string literal into it every time the function is called.

Definition at line 144 of file include/xrpl/peerfinder/Config.h.

◆ handout()

template<class TargetFwdIter, class SeqFwdIter>
void xrpl::peer_finder::handout ( TargetFwdIter first,
TargetFwdIter last,
SeqFwdIter seqFirst,
SeqFwdIter seqLast )

Distributes objects to targets according to business rules.

A best effort is made to evenly distribute items in the sequence container list into the target sequence list.

Definition at line 53 of file Handouts.h.

◆ makeManager()

std::unique_ptr< Manager > xrpl::peer_finder::makeManager ( boost::asio::io_context & ioContext,
clock_type & clock,
beast::Journal journal,
Store & store,
beast::insight::Collector::ptr const & collector )

Create a new Manager.

Parameters
ioContextThe io_context used to schedule asynchronous work.
clockThe clock used for timekeeping.
journalThe journal used for logging.
storeThe persistence backend for the bootstrap cache. The caller retains ownership and must keep it alive (and opened) for the lifetime of the returned Manager. This lets consumers supply their own Store implementation (e.g. the SQLite-backed StoreSqdb in xrpld).
collectorThe collector used to report metrics.
Returns
The newly created Manager.

Definition at line 258 of file PeerfinderManager.cpp.

◆ operator<()

bool xrpl::peer_finder::operator< ( Endpoint const & lhs,
Endpoint const & rhs )

Definition at line 35 of file peerfinder/Types.h.

◆ TEST_F() [1/8]

xrpl::peer_finder::TEST_F ( LivecacheTest ,
basic_insert  )

Definition at line 91 of file Livecache.cpp.

◆ TEST_F() [2/8]

xrpl::peer_finder::TEST_F ( LivecacheTest ,
insert_update_keeps_lowest_hop_count  )

Definition at line 108 of file Livecache.cpp.

◆ TEST_F() [3/8]

xrpl::peer_finder::TEST_F ( LivecacheTest ,
hop_iterators_support_const_reverse_and_move_back  )

Definition at line 131 of file Livecache.cpp.

◆ TEST_F() [4/8]

xrpl::peer_finder::TEST_F ( LivecacheTest ,
on_write_reports_entries_and_expiration  )

Definition at line 161 of file Livecache.cpp.

◆ TEST_F() [5/8]

xrpl::peer_finder::TEST_F ( LivecacheTest ,
expire_removes_entries_after_ttl  )

Definition at line 183 of file Livecache.cpp.

◆ TEST_F() [6/8]

xrpl::peer_finder::TEST_F ( LivecacheTest ,
expire_removes_multiple_entries_after_ttl  )

Definition at line 202 of file Livecache.cpp.

◆ TEST_F() [7/8]

xrpl::peer_finder::TEST_F ( LivecacheTest ,
histogram_counts_all_entries  )

Definition at line 214 of file Livecache.cpp.

◆ TEST_F() [8/8]

xrpl::peer_finder::TEST_F ( LivecacheTest ,
shuffle_preserves_bucket_contents  )

Definition at line 239 of file Livecache.cpp.

◆ makeConfig()

Config xrpl::peer_finder::makeConfig ( xrpl::Config const & cfg,
std::uint16_t port,
bool validationPublicKey,
int ipLimit,
bool verifyEndpoints )

Definition at line 11 of file PeerfinderConfig.cpp.