first half of support for books stream

This commit is contained in:
CJ Cobb
2021-08-23 14:44:46 -04:00
parent fd20ab77f7
commit d65bbfc841
12 changed files with 396 additions and 255 deletions

View File

@@ -0,0 +1,26 @@
#include <backend/BackendInterface.h>
#include <rpc/RPCHelpers.h>
namespace RPC {
Result
doServerInfo(Context const& context)
{
boost::json::object response = {};
auto range = context.backend->fetchLedgerRange();
if (!range)
{
return Status{Error::rpcNOT_READY, "rangeNotFound"};
}
else
{
response["info"] = boost::json::object{};
response["info"].as_object()["complete_ledgers"] =
std::to_string(range->minSequence) + " - " +
std::to_string(range->maxSequence);
}
return response;
}
} // namespace RPC