3#include "data/BackendInterface.hpp"
6#include <boost/json.hpp>
7#include <boost/json/conversion.hpp>
8#include <boost/json/object.hpp>
9#include <boost/json/value.hpp>
10#include <boost/json/value_to.hpp>
11#include <xrpl/protocol/jss.h>
28 uint32_t networkID{0};
35 template <
typename Forward>
36 static std::optional<ETLState>
39 auto const serverInfoRippled =
41 if (
auto result = source.forwardToRippled(
42 {{
"command",
"server_info"}}, std::nullopt, {}, yield
44 return std::move(result).value();
49 if (serverInfoRippled && not serverInfoRippled->contains(JS(error))) {
50 return boost::json::value_to<ETLState>(boost::json::value(*serverInfoRippled));
64tag_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:86
This class is responsible for fetching and storing the state of the ETL information,...
Definition ETLState.hpp:22
static std::optional< ETLState > fetchETLStateFromSource(Forward &source) noexcept
Fetch the ETL state from the rippled server.
Definition ETLState.hpp:37