Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
etlng::impl::GrpcSource Class Reference

Public Member Functions

 GrpcSource (std::string const &ip, std::string const &grpcPort)
 
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.
 
InitialLedgerLoadResult loadInitialLedger (uint32_t sequence, uint32_t numMarkers, etlng::InitialLoadObserverInterface &observer)
 Download a ledger in full.
 
void stop (boost::asio::yield_context yield)
 Stop any ongoing operations.
 

Member Function Documentation

◆ fetchLedger()

std::pair< grpc::Status, org::xrpl::rpc::v1::GetLedgerResponse > etlng::impl::GrpcSource::fetchLedger ( uint32_t sequence,
bool getObjects = true,
bool getObjectNeighbors = false )

Fetch data for a specific ledger.

This function will continuously try to fetch data for the specified ledger until the fetch succeeds, the ledger is found in the database, or the server is shutting down.

Parameters
sequenceSequence of the ledger to fetch
getObjectsWhether to get the account state diff between this ledger and the prior one; defaults to true
getObjectNeighborsWhether to request object neighbors; defaults to false
Returns
A std::pair of the response status and the response itself

◆ loadInitialLedger()

InitialLedgerLoadResult etlng::impl::GrpcSource::loadInitialLedger ( uint32_t sequence,
uint32_t numMarkers,
etlng::InitialLoadObserverInterface & observer )

Download a ledger in full.

Parameters
sequenceSequence of the ledger to download
numMarkersNumber of markers to generate for async calls
observerInitialLoadObserverInterface implementation
Returns
Downloaded data or an indication of error or cancellation

◆ stop()

void etlng::impl::GrpcSource::stop ( boost::asio::yield_context yield)

Stop any ongoing operations.

Note
This is used to cancel any ongoing initial ledger downloads
Parameters
yieldThe coroutine context

The documentation for this class was generated from the following files: