22#include "data/BackendInterface.hpp"
24#include <boost/json.hpp>
25#include <boost/json/conversion.hpp>
26#include <boost/json/object.hpp>
27#include <boost/json/value.hpp>
28#include <boost/json/value_to.hpp>
39 std::optional<uint32_t> networkID;
46 template <
typename Forward>
47 static std::optional<ETLState>
50 auto const serverInfoRippled =
data::synchronous([&source](
auto yield) -> std::optional<boost::json::object> {
51 if (
auto result = source.forwardToRippled({{
"command",
"server_info"}}, std::nullopt, {}, yield)) {
52 return std::move(result).value();
57 if (serverInfoRippled)
58 return boost::json::value_to<std::optional<ETLState>>(boost::json::value(*serverInfoRippled));
70std::optional<ETLState>
71tag_invoke(boost::json::value_to_tag<std::optional<ETLState>>, boost::json::value
const& jv);
auto synchronous(FnType &&func)
Synchronously executes the given function object inside a coroutine.
Definition BackendInterface.hpp:102
This namespace contains everything to do with the ETL and ETL sources.
Definition CacheLoader.hpp:36
std::optional< ETLState > tag_invoke(boost::json::value_to_tag< std::optional< ETLState > >, boost::json::value const &jv)
Parse a boost::json::value into a ETLState.
Definition ETLState.cpp:35
This class is responsible for fetching and storing the state of the ETL information,...
Definition ETLState.hpp:38
static std::optional< ETLState > fetchETLStateFromSource(Forward &source) noexcept
Fetch the ETL state from the rippled server.
Definition ETLState.hpp:48