22#include "etlng/InitialLoadObserverInterface.hpp"
24#include "util/log/Logger.hpp"
26#include <boost/asio/spawn.hpp>
27#include <grpcpp/support/status.h>
28#include <org/xrpl/rpc/v1/get_ledger.pb.h>
29#include <xrpl/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
37namespace etlng::impl {
41 std::unique_ptr<org::xrpl::rpc::v1::XRPLedgerAPIService::Stub> stub_;
42 std::unique_ptr<std::atomic_bool> initialLoadShouldStop_;
45 GrpcSource(std::string
const& ip, std::string
const& grpcPort);
58 std::pair<grpc::Status, org::xrpl::rpc::v1::GetLedgerResponse>
59 fetchLedger(uint32_t sequence,
bool getObjects =
true,
bool getObjectNeighbors =
false);
78 stop(boost::asio::yield_context yield);
std::expected< std::vector< std::string >, InitialLedgerLoadError > InitialLedgerLoadResult
The result type of the initial ledger load.
Definition LoadBalancerInterface.hpp:54
Definition GrpcSource.hpp:39
std::pair< grpc::Status, org::xrpl::rpc::v1::GetLedgerResponse > fetchLedger(uint32_t sequence, bool getObjects=true, bool getObjectNeighbors=false)
Fetch data for a specific ledger.
Definition GrpcSource.cpp:85
InitialLedgerLoadResult loadInitialLedger(uint32_t sequence, uint32_t numMarkers, etlng::InitialLoadObserverInterface &observer)
Download a ledger in full.
Definition GrpcSource.cpp:113
void stop(boost::asio::yield_context yield)
Stop any ongoing operations.
Definition GrpcSource.cpp:170
A simple thread-safe logger for the channel specified in the constructor.
Definition Logger.hpp:111
The interface for observing the initial ledger load.
Definition InitialLoadObserverInterface.hpp:36