23#include "etl/ETLState.hpp"
24#include "etlng/InitialLoadObserverInterface.hpp"
27#include <boost/asio/spawn.hpp>
28#include <boost/json/object.hpp>
29#include <boost/json/value.hpp>
30#include <org/xrpl/rpc/v1/ledger.pb.h>
31#include <xrpl/proto/org/xrpl/rpc/v1/get_ledger.pb.h>
47 using RawLedgerObjectType = org::xrpl::rpc::v1::RawLedgerObject;
48 using GetLedgerResponseType = org::xrpl::rpc::v1::GetLedgerResponse;
49 using OptionalGetLedgerResponseType = std::optional<GetLedgerResponseType>;
62 virtual std::vector<std::string>
66 std::chrono::steady_clock::duration retryAfter = std::chrono::seconds{2}
77 virtual std::vector<std::string>
78 loadInitialLedger(uint32_t sequence, std::chrono::steady_clock::duration retryAfter = std::chrono::seconds{2}) = 0;
93 virtual OptionalGetLedgerResponseType
95 uint32_t ledgerSequence,
97 bool getObjectNeighbors,
98 std::chrono::steady_clock::duration retryAfter = std::chrono::seconds{2}
106 virtual boost::json::value
118 virtual std::expected<boost::json::object, rpc::ClioError>
120 boost::json::object
const& request,
121 std::optional<std::string>
const& clientIp,
123 boost::asio::yield_context yield
130 virtual std::optional<etl::ETLState>
An interface for LoadBalancer.
Definition LoadBalancerInterface.hpp:45
virtual std::vector< std::string > loadInitialLedger(uint32_t sequence, std::chrono::steady_clock::duration retryAfter=std::chrono::seconds{2})=0
Load the initial ledger, writing data to the queue.
virtual std::vector< std::string > loadInitialLedger(uint32_t sequence, etlng::InitialLoadObserverInterface &loader, std::chrono::steady_clock::duration retryAfter=std::chrono::seconds{2})=0
Load the initial ledger, writing data to the queue.
virtual boost::json::value toJson() const =0
Represent the state of this load balancer as a JSON object.
virtual std::expected< boost::json::object, rpc::ClioError > forwardToRippled(boost::json::object const &request, std::optional< std::string > const &clientIp, bool isAdmin, boost::asio::yield_context yield)=0
Forward a JSON RPC request to a randomly selected rippled node.
virtual std::optional< etl::ETLState > getETLState() noexcept=0
Return state of ETL nodes.
virtual OptionalGetLedgerResponseType fetchLedger(uint32_t ledgerSequence, bool getObjects, bool getObjectNeighbors, std::chrono::steady_clock::duration retryAfter=std::chrono::seconds{2})=0
Fetch data for a specific ledger.
The interface for observing the initial ledger load.
Definition InitialLoadObserverInterface.hpp:36