|
rippled
|
Manages the set of connected peers. More...
#include <Overlay.h>


Classes | |
| struct | Setup |
Public Types | |
| enum class | Promote { automatic , never , 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. | |
| virtual void | connect (beast::IP::Endpoint const &address)=0 |
| Establish a peer connection to the specified endpoint. | |
| virtual int | limit ()=0 |
| Returns the maximum number of peers we are configured to allow. | |
| virtual std::size_t | size () const =0 |
| Returns the number of active peers. | |
| virtual Json::Value | json ()=0 |
| Return diagnostics on the status of all peers. | |
| virtual PeerSequence | getActivePeers () const =0 |
| Returns a sequence representing the current list of peers. | |
| virtual void | checkTracking (std::uint32_t index)=0 |
| Calls the checkTracking function on each peer. | |
| virtual std::shared_ptr< Peer > | findPeerByShortID (Peer::id_t const &id) const =0 |
| Returns the peer with the matching short id, or null. | |
| virtual std::shared_ptr< Peer > | findPeerByPublicKey (PublicKey const &pubKey)=0 |
| Returns the peer with the matching public key, or null. | |
| virtual void | broadcast (protocol::TMProposeSet &m)=0 |
| Broadcast a proposal. | |
| virtual void | broadcast (protocol::TMValidation &m)=0 |
| Broadcast a validation. | |
| virtual std::set< Peer::id_t > | relay (protocol::TMProposeSet &m, uint256 const &uid, PublicKey const &validator)=0 |
| Relay a proposal. | |
| virtual std::set< Peer::id_t > | relay (protocol::TMValidation &m, uint256 const &uid, PublicKey const &validator)=0 |
| Relay a validation. | |
| virtual void | relay (uint256 const &hash, std::optional< std::reference_wrapper< protocol::TMTransaction > > m, std::set< Peer::id_t > const &toSkip)=0 |
| Relay a transaction. | |
| template<class Function > | |
| void | foreach (Function f) const |
| Visit every active peer. | |
| virtual void | incJqTransOverflow ()=0 |
| Increment and retrieve counter for transaction job queue overflows. | |
| 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. | |
| virtual std::uint64_t | getPeerDisconnect () const =0 |
| virtual void | incPeerDisconnectCharges ()=0 |
| virtual std::uint64_t | getPeerDisconnectCharges () const =0 |
| virtual std::optional< std::uint32_t > | networkID () const =0 |
| Returns the ID of the network this server is configured for, if any. | |
| virtual Json::Value | txMetrics () const =0 |
| Returns tx reduce-relay metrics. | |
| std::string const & | name () const |
| Returns the name of this source. | |
| void | add (Source &source) |
| Add a child source. | |
| template<class Derived > | |
| Derived * | add (Derived *child) |
| Add a child source by pointer. | |
| void | remove (Source &child) |
| Remove a child source from this Source. | |
| void | removeAll () |
| Remove all child sources from this Source. | |
| void | write_one (PropertyStream &stream) |
| Write only this Source to the stream. | |
| void | write (PropertyStream &stream) |
| write this source and all its children recursively to the stream. | |
| void | write (PropertyStream &stream, std::string const &path) |
| Parse the path and write the corresponding Source and optional children. | |
| std::pair< Source *, bool > | find (std::string path) |
| Parse the dot-delimited Source path and return the result. | |
| 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. | |
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 | |
| std::string const | m_name |
| std::recursive_mutex | lock_ |
| Item | item_ |
| Source * | parent_ |
| List< Item > | children_ |
|
protected |
|
protected |
|
strong |
|
virtualdefault |
|
virtual |
Reimplemented in xrpl::OverlayImpl.
|
virtual |
Reimplemented in xrpl::OverlayImpl.
|
pure virtual |
Conditionally accept an incoming HTTP request.
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Establish a peer connection to the specified endpoint.
The call returns immediately, the connection attempt is performed asynchronously.
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Returns the maximum number of peers we are configured to allow.
Implemented in xrpl::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 xrpl::OverlayImpl.
|
pure virtual |
Return diagnostics on the status of all peers.
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Returns a sequence representing the current list of peers.
The snapshot is made at the time of the call.
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Calls the checkTracking function on each peer.
| index | the value to pass to the peer's checkTracking function |
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Returns the peer with the matching short id, or null.
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Returns the peer with the matching public key, or null.
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Broadcast a proposal.
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Broadcast a validation.
Implemented in xrpl::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 xrpl::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 xrpl::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 xrpl::OverlayImpl.
| void xrpl::Overlay::foreach | ( | Function | f | ) | const |
|
pure virtual |
Increment and retrieve counter for transaction job queue overflows.
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Increment and retrieve counters for total peer disconnects, and disconnects we initiate for excessive resource consumption.
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Implemented in xrpl::OverlayImpl.
|
pure virtual |
Implemented in xrpl::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 xrpl::OverlayImpl.
|
pure virtual |
Returns tx reduce-relay metrics.
Implemented in xrpl::OverlayImpl.
|
inherited |
Returns the name of this source.
Definition at line 167 of file beast_PropertyStream.cpp.
|
inherited |
Add a child source.
Definition at line 173 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 338 of file PropertyStream.h.
|
inherited |
Remove a child source from this Source.
Definition at line 185 of file beast_PropertyStream.cpp.
|
inherited |
Remove all child sources from this Source.
Definition at line 197 of file beast_PropertyStream.cpp.
|
inherited |
Write only this Source to the stream.
Definition at line 210 of file beast_PropertyStream.cpp.
|
inherited |
write this source and all its children recursively to the stream.
Definition at line 217 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 229 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 descendent "parent.grandchild." starts at the parent and prints down to grandchild "parent.grandchild.*" starts at parent, print through grandchild children
Definition at line 243 of file beast_PropertyStream.cpp.
|
inherited |
Definition at line 310 of file beast_PropertyStream.cpp.
|
inherited |
Definition at line 327 of file beast_PropertyStream.cpp.
|
inherited |
Definition at line 345 of file beast_PropertyStream.cpp.
|
staticinherited |
Definition at line 263 of file beast_PropertyStream.cpp.
|
staticinherited |
Definition at line 274 of file beast_PropertyStream.cpp.
|
staticinherited |
Definition at line 290 of file beast_PropertyStream.cpp.
|
virtualinherited |
Subclass override.
The default version does nothing.
Reimplemented in xrpl::Resource::ManagerImp, xrpl::LedgerCleanerImp, xrpl::PeerFinder::ManagerImp, xrpl::ApplicationImp, and xrpl::OverlayImpl.
Definition at line 357 of file beast_PropertyStream.cpp.
|
privateinherited |
Definition at line 311 of file PropertyStream.h.
|
privateinherited |
Definition at line 312 of file PropertyStream.h.
|
privateinherited |
Definition at line 313 of file PropertyStream.h.
|
privateinherited |
Definition at line 314 of file PropertyStream.h.
|
privateinherited |
Definition at line 315 of file PropertyStream.h.