rippled
|
Manages the set of connected peers. More...
Classes | |
struct | Setup |
Public Types | |
enum | Promote { Promote::automatic, Promote::never, Promote::always } |
using | PeerSequence = std::vector< std::shared_ptr< Peer > > |
Public Member Functions | |
virtual | ~Overlay ()=default |
virtual void | start () |
virtual void | stop () |
virtual Handoff | onHandoff (std::unique_ptr< stream_type > &&bundle, http_request_type &&request, boost::asio::ip::tcp::endpoint remote_address)=0 |
Conditionally accept an incoming HTTP request. More... | |
virtual void | connect (beast::IP::Endpoint const &address)=0 |
Establish a peer connection to the specified endpoint. More... | |
virtual int | limit ()=0 |
Returns the maximum number of peers we are configured to allow. More... | |
virtual std::size_t | size () const =0 |
Returns the number of active peers. More... | |
virtual Json::Value | json ()=0 |
Return diagnostics on the status of all peers. More... | |
virtual PeerSequence | getActivePeers () const =0 |
Returns a sequence representing the current list of peers. More... | |
virtual void | checkTracking (std::uint32_t index)=0 |
Calls the checkTracking function on each peer. More... | |
virtual std::shared_ptr< Peer > | findPeerByShortID (Peer::id_t const &id) const =0 |
Returns the peer with the matching short id, or null. More... | |
virtual std::shared_ptr< Peer > | findPeerByPublicKey (PublicKey const &pubKey)=0 |
Returns the peer with the matching public key, or null. More... | |
virtual void | broadcast (protocol::TMProposeSet &m)=0 |
Broadcast a proposal. More... | |
virtual void | broadcast (protocol::TMValidation &m)=0 |
Broadcast a validation. More... | |
virtual std::set< Peer::id_t > | relay (protocol::TMProposeSet &m, uint256 const &uid, PublicKey const &validator)=0 |
Relay a proposal. More... | |
virtual std::set< Peer::id_t > | relay (protocol::TMValidation &m, uint256 const &uid, PublicKey const &validator)=0 |
Relay a validation. More... | |
virtual void | relay (uint256 const &hash, protocol::TMTransaction &m, std::set< Peer::id_t > const &toSkip)=0 |
Relay a transaction. More... | |
template<class Function > | |
void | foreach (Function f) const |
Visit every active peer. More... | |
virtual void | incJqTransOverflow ()=0 |
Increment and retrieve counter for transaction job queue overflows. More... | |
virtual std::uint64_t | getJqTransOverflow () const =0 |
virtual void | incPeerDisconnect ()=0 |
Increment and retrieve counters for total peer disconnects, and disconnects we initiate for excessive resource consumption. More... | |
virtual std::uint64_t | getPeerDisconnect () const =0 |
virtual void | incPeerDisconnectCharges ()=0 |
virtual std::uint64_t | getPeerDisconnectCharges () const =0 |
virtual Json::Value | crawlShards (bool includePublicKey, std::uint32_t hops)=0 |
Returns information reported to the crawl shard RPC command. More... | |
virtual std::optional< std::uint32_t > | networkID () const =0 |
Returns the ID of the network this server is configured for, if any. More... | |
virtual Json::Value | txMetrics () const =0 |
Returns tx reduce-relay metrics. More... | |
std::string const & | name () const |
Returns the name of this source. More... | |
void | add (Source &source) |
Add a child source. More... | |
template<class Derived > | |
Derived * | add (Derived *child) |
Add a child source by pointer. More... | |
void | remove (Source &child) |
Remove a child source from this Source. More... | |
void | removeAll () |
Remove all child sources from this Source. More... | |
void | write_one (PropertyStream &stream) |
Write only this Source to the stream. More... | |
void | write (PropertyStream &stream) |
write this source and all its children recursively to the stream. More... | |
void | write (PropertyStream &stream, std::string const &path) |
Parse the path and write the corresponding Source and optional children. More... | |
std::pair< Source *, bool > | find (std::string path) |
Parse the dot-delimited Source path and return the result. More... | |
Source * | find_one_deep (std::string const &name) |
PropertyStream::Source * | find_path (std::string path) |
PropertyStream::Source * | find_one (std::string const &name) |
virtual void | onWrite (Map &) |
Subclass override. More... | |
Static Public Member Functions | |
static bool | peel_leading_slash (std::string *path) |
static bool | peel_trailing_slashstar (std::string *path) |
static std::string | peel_name (std::string *path) |
Protected Types | |
using | socket_type = boost::beast::tcp_stream |
using | stream_type = boost::beast::ssl_stream< socket_type > |
Protected Member Functions | |
Overlay () | |
Private Attributes | |
const std::string | m_name |
std::recursive_mutex | lock_ |
Item | item_ |
Source * | parent_ |
List< Item > | children_ |
|
protected |
|
protected |
|
strong |
|
virtualdefault |
|
virtual |
Reimplemented in ripple::OverlayImpl.
|
virtual |
Reimplemented in ripple::OverlayImpl.
|
pure virtual |
Conditionally accept an incoming HTTP request.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Establish a peer connection to the specified endpoint.
The call returns immediately, the connection attempt is performed asynchronously.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Returns the maximum number of peers we are configured to allow.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Returns the number of active peers.
Active peers are only those peers that have completed the handshake and are using the peer protocol.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Return diagnostics on the status of all peers.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Returns a sequence representing the current list of peers.
The snapshot is made at the time of the call.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Calls the checkTracking function on each peer.
index | the value to pass to the peer's checkTracking function |
Implemented in ripple::OverlayImpl.
|
pure virtual |
Returns the peer with the matching short id, or null.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Returns the peer with the matching public key, or null.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Broadcast a proposal.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Broadcast a validation.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Relay a proposal.
m | the serialized proposal |
uid | the id used to identify this proposal |
validator | The pubkey of the validator that issued this proposal |
Implemented in ripple::OverlayImpl.
|
pure virtual |
Relay a validation.
m | the serialized validation |
uid | the id used to identify this validation |
validator | The pubkey of the validator that issued this validation |
Implemented in ripple::OverlayImpl.
|
pure virtual |
Relay a transaction.
If the tx reduce-relay feature is enabled then randomly select peers to relay to and queue transaction's hash for the rest of the peers.
hash | transaction's hash |
m | transaction's protocol message to relay |
toSkip | peers which have already seen this transaction |
Implemented in ripple::OverlayImpl.
void ripple::Overlay::foreach | ( | Function | f | ) | const |
|
pure virtual |
Increment and retrieve counter for transaction job queue overflows.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Implemented in ripple::OverlayImpl.
|
pure virtual |
Increment and retrieve counters for total peer disconnects, and disconnects we initiate for excessive resource consumption.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Implemented in ripple::OverlayImpl.
|
pure virtual |
Implemented in ripple::OverlayImpl.
|
pure virtual |
Implemented in ripple::OverlayImpl.
|
pure virtual |
Returns information reported to the crawl shard RPC command.
includePublicKey | include peer public keys in the result. |
hops | the maximum jumps the crawler will attempt. The number of hops achieved is not guaranteed. |
Implemented in ripple::OverlayImpl.
|
pure virtual |
Returns the ID of the network this server is configured for, if any.
The ID is just a numerical identifier, with the IDs 0, 1 and 2 used to identify the mainnet, the testnet and the devnet respectively.
Implemented in ripple::OverlayImpl.
|
pure virtual |
Returns tx reduce-relay metrics.
Implemented in ripple::OverlayImpl.
|
inherited |
Returns the name of this source.
Definition at line 190 of file beast_PropertyStream.cpp.
|
inherited |
Add a child source.
Definition at line 196 of file beast_PropertyStream.cpp.
|
inherited |
Add a child source by pointer.
The source pointer is returned so it can be used in ctor-initializers.
Definition at line 360 of file PropertyStream.h.
|
inherited |
Remove a child source from this Source.
Definition at line 208 of file beast_PropertyStream.cpp.
|
inherited |
Remove all child sources from this Source.
Definition at line 220 of file beast_PropertyStream.cpp.
|
inherited |
Write only this Source to the stream.
Definition at line 233 of file beast_PropertyStream.cpp.
|
inherited |
write this source and all its children recursively to the stream.
Definition at line 240 of file beast_PropertyStream.cpp.
|
inherited |
Parse the path and write the corresponding Source and optional children.
If the source is found, it is written. If the wildcard character '*' exists as the last character in the path, then all the children are written recursively.
Definition at line 252 of file beast_PropertyStream.cpp.
|
inherited |
Parse the dot-delimited Source path and return the result.
The first value will be a pointer to the Source object corresponding to the given path. If no Source object exists, then the first value will be nullptr and the second value will be undefined. The second value is a boolean indicating whether or not the path string specifies the wildcard character '*' as the last character.
print statement examples "parent.child" prints child and all of its children "parent.child." start at the parent and print down to child "parent.grandchild" prints nothing- grandchild not direct discendent "parent.grandchild." starts at the parent and prints down to grandchild "parent.grandchild.*" starts at parent, print through grandchild children
Definition at line 266 of file beast_PropertyStream.cpp.
|
inherited |
Definition at line 333 of file beast_PropertyStream.cpp.
|
inherited |
Definition at line 350 of file beast_PropertyStream.cpp.
|
inherited |
Definition at line 368 of file beast_PropertyStream.cpp.
|
staticinherited |
Definition at line 286 of file beast_PropertyStream.cpp.
|
staticinherited |
Definition at line 297 of file beast_PropertyStream.cpp.
|
staticinherited |
Definition at line 313 of file beast_PropertyStream.cpp.
|
virtualinherited |
Subclass override.
The default version does nothing.
Reimplemented in ripple::ApplicationImp, ripple::OverlayImpl, ripple::PeerFinder::ManagerImp, ripple::Resource::ManagerImp, and ripple::LedgerCleanerImp.
Definition at line 380 of file beast_PropertyStream.cpp.
|
privateinherited |
Definition at line 333 of file PropertyStream.h.
|
privateinherited |
Definition at line 334 of file PropertyStream.h.
|
privateinherited |
Definition at line 335 of file PropertyStream.h.
|
privateinherited |
Definition at line 336 of file PropertyStream.h.
|
privateinherited |
Definition at line 337 of file PropertyStream.h.