|
template<typename SomeGrpcSourceType , typename SomeForwardingSourceType >
requires std::is_same_v<GrpcSourceType, SomeGrpcSourceType> and std::is_same_v<ForwardingSourceType, SomeForwardingSourceType> |
| SourceImpl (std::string ip, std::string wsPort, std::string grpcPort, SomeGrpcSourceType &&grpcSource, SubscriptionSourceTypePtr subscriptionSource, SomeForwardingSourceType &&forwardingSource) |
| Construct a new SourceImpl object.
|
|
void | run () final |
| Run subscriptions loop of the source.
|
|
void | stop (boost::asio::yield_context yield) final |
| Stop Source.
|
|
bool | isConnected () const final |
| Check if source is connected.
|
|
void | setForwarding (bool isForwarding) final |
| Set the forwarding state of the source.
|
|
boost::json::object | toJson () const final |
| Represent the source as a JSON object.
|
|
std::string | toString () const final |
|
bool | hasLedger (uint32_t sequence) const final |
| Check if ledger is known by this source.
|
|
std::pair< grpc::Status, org::xrpl::rpc::v1::GetLedgerResponse > | fetchLedger (uint32_t sequence, bool getObjects=true, bool getObjectNeighbors=false) final |
| Fetch data for a specific ledger.
|
|
std::pair< std::vector< std::string >, bool > | loadInitialLedger (uint32_t sequence, std::uint32_t numMarkers, bool cacheOnly=false) final |
| Download a ledger in full.
|
|
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 final |
| Forward a request to rippled.
|
|
template<typename GrpcSourceType = GrpcSource, typename SubscriptionSourceTypePtr = std::unique_ptr<SubscriptionSource>, typename ForwardingSourceType = ForwardingSource>
class etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >
Provides an implementation of a ETL source.
- Template Parameters
-
GrpcSourceType | The type of the gRPC source |
SubscriptionSourceTypePtr | The type of the subscription source |
ForwardingSourceType | The type of the forwarding source |
template<typename GrpcSourceType = GrpcSource, typename SubscriptionSourceTypePtr = std::unique_ptr<SubscriptionSource>, typename ForwardingSourceType = ForwardingSource>
template<typename SomeGrpcSourceType , typename SomeForwardingSourceType >
requires std::is_same_v<GrpcSourceType, SomeGrpcSourceType> and std::is_same_v<ForwardingSourceType, SomeForwardingSourceType>
etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >::SourceImpl |
( |
std::string | ip, |
|
|
std::string | wsPort, |
|
|
std::string | grpcPort, |
|
|
SomeGrpcSourceType && | grpcSource, |
|
|
SubscriptionSourceTypePtr | subscriptionSource, |
|
|
SomeForwardingSourceType && | forwardingSource ) |
|
inline |
Construct a new SourceImpl object.
- Parameters
-
ip | The IP of the source |
wsPort | The web socket port of the source |
grpcPort | The gRPC port of the source |
grpcSource | The gRPC source |
subscriptionSource | The subscription source |
forwardingSource | The forwarding source |
template<typename GrpcSourceType = GrpcSource, typename SubscriptionSourceTypePtr = std::unique_ptr<SubscriptionSource>, typename ForwardingSourceType = ForwardingSource>
std::pair< grpc::Status, org::xrpl::rpc::v1::GetLedgerResponse > etl::impl::SourceImpl< GrpcSourceType, SubscriptionSourceTypePtr, ForwardingSourceType >::fetchLedger |
( |
uint32_t | sequence, |
|
|
bool | getObjects = true, |
|
|
bool | getObjectNeighbors = false ) |
|
inlinefinalvirtual |
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
-
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 |
- Returns
- A std::pair of the response status and the response itself
Implements etl::SourceBase.