3#include "etl/InitialLoadObserverInterface.hpp"
5#include "util/log/Logger.hpp"
7#include <boost/asio/spawn.hpp>
8#include <grpcpp/support/status.h>
9#include <org/xrpl/rpc/v1/get_ledger.pb.h>
10#include <xrpl/proto/org/xrpl/rpc/v1/xrp_ledger.grpc.pb.h>
23 std::unique_ptr<org::xrpl::rpc::v1::XRPLedgerAPIService::Stub> stub_;
24 std::unique_ptr<std::atomic_bool> initialLoadShouldStop_;
25 std::chrono::system_clock::duration deadline_;
27 static constexpr auto kKeepalivePingIntervalMs = 10000;
28 static constexpr auto kKeepaliveTimeoutMs = 5000;
29 static constexpr auto kKeepalivePermitWithoutCalls =
31 static constexpr auto kMaxPingsWithoutData = 0;
32 static constexpr auto kDeadline = std::chrono::seconds(30);
36 std::string
const& ip,
37 std::string
const& grpcPort,
38 std::chrono::system_clock::duration deadline = kDeadline
53 std::pair<grpc::Status, org::xrpl::rpc::v1::GetLedgerResponse>
54 fetchLedger(uint32_t sequence,
bool getObjects =
true,
bool getObjectNeighbors =
false);
77 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:35
void stop(boost::asio::yield_context yield)
Stop any ongoing operations.
Definition GrpcSource.cpp:170
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:81
InitialLedgerLoadResult loadInitialLedger(uint32_t sequence, uint32_t numMarkers, InitialLoadObserverInterface &observer)
Download a ledger in full.
Definition GrpcSource.cpp:113
A simple thread-safe logger for the channel specified in the constructor.
Definition Logger.hpp:78
The interface for observing the initial ledger load.
Definition InitialLoadObserverInterface.hpp:17