6 #ifndef BITCOIN_RPC_SERVER_H 7 #define BITCOIN_RPC_SERVER_H 47 using Actor = std::function<bool(const JSONRPCRequest& request, UniValue& result, bool last_handler)>;
79 std::vector<std::pair<std::string, bool>>
argNames;
89 std::map<std::string, std::vector<const CRPCCommand*>>
mapCommands;
138 #endif // BITCOIN_RPC_SERVER_H
bool IsRPCRunning()
Query whether RPC is running.
void appendCommand(const std::string &name, const CRPCCommand *pcmd)
Appends a CRPCCommand to the dispatch table.
void SetRPCWarmupFinished()
RPCHelpMan(* RpcMethodFnType)()
void RpcInterruptionPoint()
Throw JSONRPCError if RPC is not running.
bool removeCommand(const std::string &name, const CRPCCommand *pcmd)
std::function< bool(const JSONRPCRequest &request, UniValue &result, bool last_handler)> Actor
RPC method handler reading request and assigning result.
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.
UniValue execute(const JSONRPCRequest &request) const
Execute a method.
bool IsDeprecatedRPCEnabled(const std::string &method)
std::vector< std::pair< std::string, bool > > argNames
List of method arguments and whether they are named-only.
std::string help(std::string_view name, const JSONRPCRequest &helpreq) const
std::map< std::string, std::vector< const CRPCCommand * > > mapCommands
void SetRPCWarmupStarting()
UniValue JSONRPCExec(const JSONRPCRequest &jreq, bool catch_errors)
void SetRPCWarmupStatus(const std::string &newStatus)
Set the RPC warmup status.
std::vector< std::string > listCommands() const
Returns a list of registered commands.
UniValue dumpArgMap(const JSONRPCRequest &request) const
Return all named arguments that need to be converted by the client from string to another JSON type...
bool RPCIsInWarmup(std::string *outStatus)
CRPCCommand(std::string category, RpcMethodFnType fn)
Simplified constructor taking plain RpcMethodFnType function pointer.