6#ifndef BITCOIN_RPC_SERVER_H
7#define BITCOIN_RPC_SERVER_H
56 virtual const char *
Name() = 0;
77void RPCRunLater(
const std::string&
name, std::function<
void()> func, int64_t nSeconds);
101 [fn](const
JSONRPCRequest& request,
UniValue& result, bool) { result = fn().HandleRequest(request);
return true; },
119 std::vector<std::pair<std::string, bool>>
argNames;
129 std::map<std::string, std::vector<const CRPCCommand*>>
mapCommands;
CRPCCommand(std::string category, std::string name, Actor actor, std::vector< std::pair< std::string, bool > > args, intptr_t unique_id)
Constructor taking Actor callback supporting multiple handlers.
std::vector< std::pair< std::string, bool > > argNames
List of method arguments and whether they are named-only.
std::function< bool(const JSONRPCRequest &request, UniValue &result, bool last_handler)> Actor
RPC method handler reading request and assigning result.
CRPCCommand(std::string category, RpcMethodFnType fn)
Simplified constructor taking plain RpcMethodFnType function pointer.
std::map< std::string, std::vector< const CRPCCommand * > > mapCommands
bool removeCommand(const std::string &name, const CRPCCommand *pcmd)
std::vector< std::string > listCommands() const
Returns a list of registered commands.
UniValue execute(const JSONRPCRequest &request) const
Execute a method.
void appendCommand(const std::string &name, const CRPCCommand *pcmd)
Appends a CRPCCommand to the dispatch table.
std::string help(const std::string &name, const JSONRPCRequest &helpreq) const
UniValue dumpArgMap(const JSONRPCRequest &request) const
Return all named arguments that need to be converted by the client from string to another JSON type.
Opaque base class for timers returned by NewTimerFunc.
virtual ~RPCTimerBase()=default
virtual RPCTimerBase * NewTimer(std::function< void()> &func, int64_t millis)=0
Factory function for timers.
virtual const char * Name()=0
Implementation name.
virtual ~RPCTimerInterface()=default
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)
Set the factory function for timer, but only, if unset.
bool IsDeprecatedRPCEnabled(const std::string &method)
void SetRPCWarmupFinished()
void RPCUnsetTimerInterface(RPCTimerInterface *iface)
Unset factory function for timers.
void RPCRunLater(const std::string &name, std::function< void()> func, int64_t nSeconds)
Run func nSeconds from now.
bool RPCIsInWarmup(std::string *outStatus)
RPCHelpMan(* RpcMethodFnType)()
bool IsRPCRunning()
Query whether RPC is running.
UniValue JSONRPCExec(const JSONRPCRequest &jreq, bool catch_errors)
void SetRPCWarmupStatus(const std::string &newStatus)
Set the RPC warmup status.
void RPCSetTimerInterface(RPCTimerInterface *iface)
Set the factory function for timers.
void RpcInterruptionPoint()
Throw JSONRPCError if RPC is not running.