Clio develop
The XRP Ledger API server.
|
Provides an implementation of a ETL source. More...
#include <Source.hpp>
Public Types | |
using | OnConnectHook = std::function<void()> |
using | OnDisconnectHook = std::function<void(bool)> |
using | OnLedgerClosedHook = std::function<void()> |
Public Member Functions | |
virtual void | run ()=0 |
Run subscriptions loop of the source. | |
virtual void | stop (boost::asio::yield_context yield)=0 |
Stop Source. | |
virtual bool | isConnected () const =0 |
Check if source is connected. | |
virtual void | setForwarding (bool isForwarding)=0 |
Set the forwarding state of the source. | |
virtual boost::json::object | toJson () const =0 |
Represent the source as a JSON object. | |
virtual std::string | toString () const =0 |
virtual bool | hasLedger (uint32_t sequence) const =0 |
Check if ledger is known by this source. | |
virtual std::pair< grpc::Status, org::xrpl::rpc::v1::GetLedgerResponse > | fetchLedger (uint32_t sequence, bool getObjects=true, bool getObjectNeighbors=false)=0 |
Fetch data for a specific ledger. | |
virtual std::pair< std::vector< std::string >, bool > | loadInitialLedger (uint32_t sequence, std::uint32_t numMarkers, bool cacheOnly=false)=0 |
Download a ledger in full. | |
virtual std::expected< boost::json::object, rpc::ClioError > | forwardToRippled (boost::json::object const &request, std::optional< std::string > const &forwardToRippledClientIp, std::string_view xUserValue, boost::asio::yield_context yield) const =0 |
Forward a request to rippled. | |
Provides an implementation of a ETL source.
|
pure virtual |
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.
sequence | Sequence of the ledger to fetch |
getObjects | Whether to get the account state diff between this ledger and the prior one; defaults to true |
getObjectNeighbors | Whether to request object neighbors; defaults to false |
Implemented in etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >.
|
pure virtual |
Forward a request to rippled.
request | The request to forward |
forwardToRippledClientIp | IP of the client forwarding this request if known |
xUserValue | Value of the X-User header |
yield | The coroutine context |
Implemented in etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >.
|
pure virtual |
Check if ledger is known by this source.
sequence | The ledger sequence to check |
Implemented in etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >.
|
pure virtual |
Check if source is connected.
Implemented in etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >.
|
pure virtual |
Download a ledger in full.
sequence | Sequence of the ledger to download |
numMarkers | Number of markers to generate for async calls |
cacheOnly | Only insert into cache, not the DB; defaults to false |
Implemented in etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >.
|
pure virtual |
Run subscriptions loop of the source.
Implemented in etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >.
|
pure virtual |
Set the forwarding state of the source.
isForwarding | Whether to forward or not |
Implemented in etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >.
|
pure virtual |
Stop Source.
yield | The coroutine context. |
Implemented in etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >.
|
pure virtual |
Represent the source as a JSON object.
Implemented in etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >.
|
pure virtual |
Implemented in etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >.