20#ifndef RIPPLE_RPC_HANDLER_H_INCLUDED
21#define RIPPLE_RPC_HANDLER_H_INCLUDED
23#include <xrpld/app/ledger/LedgerMaster.h>
24#include <xrpld/app/misc/NetworkOPs.h>
25#include <xrpld/core/Config.h>
26#include <xrpld/rpc/RPCHandler.h>
27#include <xrpld/rpc/Status.h>
28#include <xrpld/rpc/detail/RPCHelpers.h>
29#include <xrpld/rpc/detail/Tuning.h>
49 template <
class JsonValue>
72 result[field] = value;
84 if (context.app.getOPs().isAmendmentBlocked() &&
90 if (context.app.getOPs().isUNLBlocked() &&
99 JLOG(context.j.info()) <<
"Insufficient network mode for RPC: "
100 << context.netOps.strOperatingMode();
102 if (context.apiVersion == 1)
107 if (!context.app.config().standalone() &&
110 if (context.ledgerMaster.getValidatedLedgerAge() >
113 if (context.apiVersion == 1)
118 auto const cID = context.ledgerMaster.getCurrentLedgerIndex();
119 auto const vID = context.ledgerMaster.getValidLedgerIndex();
123 JLOG(context.j.debug())
124 <<
"Current ledger ID(" << cID
125 <<
") is less than validated ledger ID(" << vID <<
")";
126 if (context.apiVersion == 1)
133 !context.ledgerMaster.getClosedLedger())
135 if (context.apiVersion == 1)
Lightweight wrapper to tag static string.
JSON (JavaScript Object Notation).
@ objectValue
object value (collection of name/value pairs).
auto constexpr maxValidatedLedgerAge
@ NEEDS_NETWORK_CONNECTION
std::set< char const * > getHandlerNames()
Return names of all methods.
Json::Value makeObjectValue(Value const &value, Json::StaticString const &field=jss::message)
Return a Json::objectValue with a single entry.
static constexpr auto apiMaximumValidVersion
Handler const * getHandler(unsigned version, bool betaEnabled, std::string const &name)
error_code_i conditionMet(Condition condition_required, T &context)
static constexpr auto apiMinimumSupportedVersion
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
@ rpcEXPIRED_VALIDATOR_LIST
@ SYNCING
fallen slightly behind
Role
Indicates the level of administrative permission to grant.
RPC::Condition condition_
Method< Json::Value > valueMethod_
Status represents the results of an operation that might fail.