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>
47 uint32_t networkID{0};
54 template <
typename Forward>
55 static std::optional<ETLState>
58 auto const serverInfoRippled =
60 if (
auto result = source.forwardToRippled(
61 {{
"command",
"server_info"}}, std::nullopt, {}, yield
63 return std::move(result).value();
68 if (serverInfoRippled && not serverInfoRippled->contains(JS(error))) {
69 return boost::json::value_to<ETLState>(boost::json::value(*serverInfoRippled));
83tag_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:105
This class is responsible for fetching and storing the state of the ETL information,...
Definition ETLState.hpp:41
static std::optional< ETLState > fetchETLStateFromSource(Forward &source) noexcept
Fetch the ETL state from the rippled server.
Definition ETLState.hpp:56