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/rpc/RPCHandler.h>
26#include <xrpld/rpc/Status.h>
27#include <xrpld/rpc/detail/RPCHelpers.h>
28#include <xrpld/rpc/detail/Tuning.h>
47 template <
class JsonValue>
70 result[field] = value;
82 if (context.app.getOPs().isAmendmentBlocked() &&
88 if (context.app.getOPs().isUNLBlocked() &&
97 JLOG(context.j.info()) <<
"Insufficient network mode for RPC: "
98 << context.netOps.strOperatingMode();
100 if (context.apiVersion == 1)
105 if (!context.app.config().standalone() &&
108 if (context.ledgerMaster.getValidatedLedgerAge() >
111 if (context.apiVersion == 1)
116 auto const cID = context.ledgerMaster.getCurrentLedgerIndex();
117 auto const vID = context.ledgerMaster.getValidLedgerIndex();
121 JLOG(context.j.debug())
122 <<
"Current ledger ID(" << cID
123 <<
") is less than validated ledger ID(" << vID <<
")";
124 if (context.apiVersion == 1)
131 !context.ledgerMaster.getClosedLedger())
133 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.