22#include "data/BackendInterface.hpp"
25#include <boost/json.hpp>
26#include <boost/json/conversion.hpp>
27#include <boost/json/object.hpp>
28#include <boost/json/value.hpp>
29#include <boost/json/value_to.hpp>
30#include <xrpl/protocol/jss.h>
46 uint32_t networkID{0};
53 template <
typename Forward>
54 static std::optional<ETLState>
57 auto const serverInfoRippled =
data::synchronous([&source](
auto yield) -> std::optional<boost::json::object> {
58 if (
auto result = source.forwardToRippled({{
"command",
"server_info"}}, std::nullopt, {}, yield)) {
59 return std::move(result).value();
64 if (serverInfoRippled && not serverInfoRippled->contains(JS(error))) {
65 return boost::json::value_to<ETLState>(boost::json::value(*serverInfoRippled));
79tag_invoke(boost::json::value_to_tag<ETLState>, boost::json::value
const& jv);
auto synchronous(FnType &&func)
Synchronously executes the given function object inside a coroutine.
Definition BackendInterface.hpp:104
This namespace contains everything to do with the ETL and ETL sources.
Definition CacheLoader.hpp:37
This class is responsible for fetching and storing the state of the ETL information,...
Definition ETLState.hpp:40
static std::optional< ETLState > fetchETLStateFromSource(Forward &source) noexcept
Fetch the ETL state from the rippled server.
Definition ETLState.hpp:55