20 #ifndef RIPPLE_OVERLAY_OVERLAY_H_INCLUDED
21 #define RIPPLE_OVERLAY_OVERLAY_H_INCLUDED
23 #include <ripple/beast/utility/PropertyStream.h>
24 #include <ripple/json/json_value.h>
25 #include <ripple/overlay/Peer.h>
26 #include <ripple/overlay/PeerSet.h>
27 #include <ripple/server/Handoff.h>
28 #include <boost/asio/buffer.hpp>
29 #include <boost/asio/ip/tcp.hpp>
30 #include <boost/asio/ssl/context.hpp>
31 #include <boost/asio/ssl/stream.hpp>
32 #include <boost/beast/core/tcp_stream.hpp>
33 #include <boost/beast/http/message.hpp>
34 #include <boost/beast/ssl/ssl_stream.hpp>
69 explicit Setup() =
default;
98 boost::asio::ip::tcp::endpoint remote_address) = 0;
146 broadcast(protocol::TMProposeSet& m) = 0;
150 broadcast(protocol::TMValidation& m) = 0;
160 protocol::TMProposeSet& m,
172 protocol::TMValidation& m,
186 protocol::TMTransaction& m,
196 template <
class Function>
198 foreach(Function f)
const
virtual ~Overlay()=default
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.
std::optional< std::uint32_t > networkID
virtual int limit()=0
Returns the maximum number of peers we are configured to allow.
virtual std::uint64_t getJqTransOverflow() const =0
Subclasses can be called to write to a stream and have children.
std::uint32_t crawlOptions
std::vector< std::shared_ptr< Peer > > PeerSequence
virtual std::size_t size() const =0
Returns the number of active peers.
boost::beast::tcp_stream socket_type
boost::beast::ssl_stream< socket_type > stream_type
virtual void incPeerDisconnectCharges()=0
virtual void broadcast(protocol::TMProposeSet &m)=0
Broadcast a proposal.
beast::IP::Address public_ip
boost::asio::ip::address Address
virtual void incJqTransOverflow()=0
Increment and retrieve counter for transaction job queue overflows.
virtual PeerSequence getActivePeers() const =0
Returns a sequence representing the current list of peers.
virtual std::set< Peer::id_t > relay(protocol::TMProposeSet &m, uint256 const &uid, PublicKey const &validator)=0
Relay a proposal.
virtual std::shared_ptr< Peer > findPeerByPublicKey(PublicKey const &pubKey)=0
Returns the peer with the matching public key, or null.
virtual void incPeerDisconnect()=0
Increment and retrieve counters for total peer disconnects, and disconnects we initiate for excessive...
virtual Json::Value txMetrics() const =0
Returns tx reduce-relay metrics.
virtual Json::Value crawlShards(bool includePublicKey, std::uint32_t hops)=0
Returns information reported to the crawl shard RPC command.
virtual void connect(beast::IP::Endpoint const &address)=0
Establish a peer connection to the specified endpoint.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Source(std::string const &name)
Manages the set of connected peers.
virtual Json::Value json()=0
Return diagnostics on the status of all peers.
Used to indicate the result of a server connection handoff.
virtual std::optional< std::uint32_t > networkID() const =0
Returns the ID of the network this server is configured for, if any.
virtual std::shared_ptr< Peer > findPeerByShortID(Peer::id_t const &id) const =0
Returns the peer with the matching short id, or null.
virtual void checkTracking(std::uint32_t index)=0
Calls the checkTracking function on each peer.
A version-independent IP address and port combination.
std::shared_ptr< boost::asio::ssl::context > context
virtual std::uint64_t getPeerDisconnect() const =0
boost::beast::http::request< boost::beast::http::dynamic_body > http_request_type
virtual std::uint64_t getPeerDisconnectCharges() const =0