Bitcoin Core  0.20.99
P2P Digital Currency
server.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2020 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #include <rpc/server.h>
7 
8 #include <rpc/util.h>
9 #include <shutdown.h>
10 #include <sync.h>
11 #include <util/strencodings.h>
12 #include <util/system.h>
13 
14 #include <boost/algorithm/string/classification.hpp>
15 #include <boost/algorithm/string/split.hpp>
16 #include <boost/signals2/signal.hpp>
17 
18 #include <cassert>
19 #include <memory> // for unique_ptr
20 #include <mutex>
21 #include <unordered_map>
22 
24 static std::atomic<bool> g_rpc_running{false};
25 static bool fRPCInWarmup GUARDED_BY(g_rpc_warmup_mutex) = true;
26 static std::string rpcWarmupStatus GUARDED_BY(g_rpc_warmup_mutex) = "RPC server started";
27 /* Timer-creating functions */
29 /* Map of name to timer. */
31 static std::map<std::string, std::unique_ptr<RPCTimerBase> > deadlineTimers GUARDED_BY(g_deadline_timers_mutex);
32 static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& request, UniValue& result, bool last_handler);
33 
35 {
36  std::string method;
37  int64_t start;
38 };
39 
41 {
43  std::list<RPCCommandExecutionInfo> active_commands GUARDED_BY(mutex);
44 };
45 
47 
49 {
50  std::list<RPCCommandExecutionInfo>::iterator it;
51  explicit RPCCommandExecution(const std::string& method)
52  {
53  LOCK(g_rpc_server_info.mutex);
54  it = g_rpc_server_info.active_commands.insert(g_rpc_server_info.active_commands.end(), {method, GetTimeMicros()});
55  }
57  {
58  LOCK(g_rpc_server_info.mutex);
59  g_rpc_server_info.active_commands.erase(it);
60  }
61 };
62 
63 static struct CRPCSignals
64 {
65  boost::signals2::signal<void ()> Started;
66  boost::signals2::signal<void ()> Stopped;
67 } g_rpcSignals;
68 
69 void RPCServer::OnStarted(std::function<void ()> slot)
70 {
71  g_rpcSignals.Started.connect(slot);
72 }
73 
74 void RPCServer::OnStopped(std::function<void ()> slot)
75 {
76  g_rpcSignals.Stopped.connect(slot);
77 }
78 
79 std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest& helpreq) const
80 {
81  std::string strRet;
82  std::string category;
83  std::set<intptr_t> setDone;
84  std::vector<std::pair<std::string, const CRPCCommand*> > vCommands;
85 
86  for (const auto& entry : mapCommands)
87  vCommands.push_back(make_pair(entry.second.front()->category + entry.first, entry.second.front()));
88  sort(vCommands.begin(), vCommands.end());
89 
90  JSONRPCRequest jreq(helpreq);
91  jreq.fHelp = true;
92  jreq.params = UniValue();
93 
94  for (const std::pair<std::string, const CRPCCommand*>& command : vCommands)
95  {
96  const CRPCCommand *pcmd = command.second;
97  std::string strMethod = pcmd->name;
98  if ((strCommand != "" || pcmd->category == "hidden") && strMethod != strCommand)
99  continue;
100  jreq.strMethod = strMethod;
101  try
102  {
103  UniValue unused_result;
104  if (setDone.insert(pcmd->unique_id).second)
105  pcmd->actor(jreq, unused_result, true /* last_handler */);
106  }
107  catch (const std::exception& e)
108  {
109  // Help text is returned in an exception
110  std::string strHelp = std::string(e.what());
111  if (strCommand == "")
112  {
113  if (strHelp.find('\n') != std::string::npos)
114  strHelp = strHelp.substr(0, strHelp.find('\n'));
115 
116  if (category != pcmd->category)
117  {
118  if (!category.empty())
119  strRet += "\n";
120  category = pcmd->category;
121  strRet += "== " + Capitalize(category) + " ==\n";
122  }
123  }
124  strRet += strHelp + "\n";
125  }
126  }
127  if (strRet == "")
128  strRet = strprintf("help: unknown command: %s\n", strCommand);
129  strRet = strRet.substr(0,strRet.size()-1);
130  return strRet;
131 }
132 
133 UniValue help(const JSONRPCRequest& jsonRequest)
134 {
135  if (jsonRequest.fHelp || jsonRequest.params.size() > 1)
136  throw std::runtime_error(
137  RPCHelpMan{"help",
138  "\nList all commands, or get help for a specified command.\n",
139  {
140  {"command", RPCArg::Type::STR, /* default */ "all commands", "The command to get help on"},
141  },
142  RPCResult{
143  RPCResult::Type::STR, "", "The help text"
144  },
145  RPCExamples{""},
146  }.ToString()
147  );
148 
149  std::string strCommand;
150  if (jsonRequest.params.size() > 0)
151  strCommand = jsonRequest.params[0].get_str();
152 
153  return tableRPC.help(strCommand, jsonRequest);
154 }
155 
156 
157 UniValue stop(const JSONRPCRequest& jsonRequest)
158 {
159  static const std::string RESULT{PACKAGE_NAME " stopping"};
160  // Accept the deprecated and ignored 'detach' boolean argument
161  // Also accept the hidden 'wait' integer argument (milliseconds)
162  // For instance, 'stop 1000' makes the call wait 1 second before returning
163  // to the client (intended for testing)
164  if (jsonRequest.fHelp || jsonRequest.params.size() > 1)
165  throw std::runtime_error(
166  RPCHelpMan{"stop",
167  "\nRequest a graceful shutdown of " PACKAGE_NAME ".",
168  {},
169  RPCResult{RPCResult::Type::STR, "", "A string with the content '" + RESULT + "'"},
170  RPCExamples{""},
171  }.ToString());
172  // Event loop will exit after current HTTP requests have been handled, so
173  // this reply will get back to the client.
174  StartShutdown();
175  if (jsonRequest.params[0].isNum()) {
176  UninterruptibleSleep(std::chrono::milliseconds{jsonRequest.params[0].get_int()});
177  }
178  return RESULT;
179 }
180 
181 static UniValue uptime(const JSONRPCRequest& jsonRequest)
182 {
183  RPCHelpMan{"uptime",
184  "\nReturns the total uptime of the server.\n",
185  {},
186  RPCResult{
187  RPCResult::Type::NUM, "", "The number of seconds that the server has been running"
188  },
189  RPCExamples{
190  HelpExampleCli("uptime", "")
191  + HelpExampleRpc("uptime", "")
192  },
193  }.Check(jsonRequest);
194 
195  return GetTime() - GetStartupTime();
196 }
197 
198 static UniValue getrpcinfo(const JSONRPCRequest& request)
199 {
200  RPCHelpMan{"getrpcinfo",
201  "\nReturns details of the RPC server.\n",
202  {},
203  RPCResult{
204  RPCResult::Type::OBJ, "", "",
205  {
206  {RPCResult::Type::ARR, "active_commands", "All active commands",
207  {
208  {RPCResult::Type::OBJ, "", "Information about an active command",
209  {
210  {RPCResult::Type::STR, "method", "The name of the RPC command"},
211  {RPCResult::Type::NUM, "duration", "The running time in microseconds"},
212  }},
213  }},
214  {RPCResult::Type::STR, "logpath", "The complete file path to the debug log"},
215  }
216  },
217  RPCExamples{
218  HelpExampleCli("getrpcinfo", "")
219  + HelpExampleRpc("getrpcinfo", "")},
220  }.Check(request);
221 
222  LOCK(g_rpc_server_info.mutex);
223  UniValue active_commands(UniValue::VARR);
224  for (const RPCCommandExecutionInfo& info : g_rpc_server_info.active_commands) {
225  UniValue entry(UniValue::VOBJ);
226  entry.pushKV("method", info.method);
227  entry.pushKV("duration", GetTimeMicros() - info.start);
228  active_commands.push_back(entry);
229  }
230 
231  UniValue result(UniValue::VOBJ);
232  result.pushKV("active_commands", active_commands);
233 
234  const std::string path = LogInstance().m_file_path.string();
235  UniValue log_path(UniValue::VSTR, path);
236  result.pushKV("logpath", log_path);
237 
238  return result;
239 }
240 
241 // clang-format off
242 static const CRPCCommand vRPCCommands[] =
243 { // category name actor (function) argNames
244  // --------------------- ------------------------ ----------------------- ----------
245  /* Overall control/query calls */
246  { "control", "getrpcinfo", &getrpcinfo, {} },
247  { "control", "help", &help, {"command"} },
248  { "control", "stop", &stop, {"wait"} },
249  { "control", "uptime", &uptime, {} },
250 };
251 // clang-format on
252 
254 {
255  unsigned int vcidx;
256  for (vcidx = 0; vcidx < (sizeof(vRPCCommands) / sizeof(vRPCCommands[0])); vcidx++)
257  {
258  const CRPCCommand *pcmd;
259 
260  pcmd = &vRPCCommands[vcidx];
261  mapCommands[pcmd->name].push_back(pcmd);
262  }
263 }
264 
265 bool CRPCTable::appendCommand(const std::string& name, const CRPCCommand* pcmd)
266 {
267  if (IsRPCRunning())
268  return false;
269 
270  mapCommands[name].push_back(pcmd);
271  return true;
272 }
273 
274 bool CRPCTable::removeCommand(const std::string& name, const CRPCCommand* pcmd)
275 {
276  auto it = mapCommands.find(name);
277  if (it != mapCommands.end()) {
278  auto new_end = std::remove(it->second.begin(), it->second.end(), pcmd);
279  if (it->second.end() != new_end) {
280  it->second.erase(new_end, it->second.end());
281  return true;
282  }
283  }
284  return false;
285 }
286 
287 void StartRPC()
288 {
289  LogPrint(BCLog::RPC, "Starting RPC\n");
290  g_rpc_running = true;
292 }
293 
295 {
296  static std::once_flag g_rpc_interrupt_flag;
297  // This function could be called twice if the GUI has been started with -server=1.
298  std::call_once(g_rpc_interrupt_flag, []() {
299  LogPrint(BCLog::RPC, "Interrupting RPC\n");
300  // Interrupt e.g. running longpolls
301  g_rpc_running = false;
302  });
303 }
304 
305 void StopRPC()
306 {
307  static std::once_flag g_rpc_stop_flag;
308  // This function could be called twice if the GUI has been started with -server=1.
309  assert(!g_rpc_running);
310  std::call_once(g_rpc_stop_flag, []() {
311  LogPrint(BCLog::RPC, "Stopping RPC\n");
312  WITH_LOCK(g_deadline_timers_mutex, deadlineTimers.clear());
315  });
316 }
317 
319 {
320  return g_rpc_running;
321 }
322 
324 {
325  if (!IsRPCRunning()) throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Shutting down");
326 }
327 
328 void SetRPCWarmupStatus(const std::string& newStatus)
329 {
330  LOCK(g_rpc_warmup_mutex);
331  rpcWarmupStatus = newStatus;
332 }
333 
335 {
336  LOCK(g_rpc_warmup_mutex);
337  assert(fRPCInWarmup);
338  fRPCInWarmup = false;
339 }
340 
341 bool RPCIsInWarmup(std::string *outStatus)
342 {
343  LOCK(g_rpc_warmup_mutex);
344  if (outStatus)
345  *outStatus = rpcWarmupStatus;
346  return fRPCInWarmup;
347 }
348 
349 bool IsDeprecatedRPCEnabled(const std::string& method)
350 {
351  const std::vector<std::string> enabled_methods = gArgs.GetArgs("-deprecatedrpc");
352 
353  return find(enabled_methods.begin(), enabled_methods.end(), method) != enabled_methods.end();
354 }
355 
357 {
358  UniValue rpc_result(UniValue::VOBJ);
359 
360  try {
361  jreq.parse(req);
362 
363  UniValue result = tableRPC.execute(jreq);
364  rpc_result = JSONRPCReplyObj(result, NullUniValue, jreq.id);
365  }
366  catch (const UniValue& objError)
367  {
368  rpc_result = JSONRPCReplyObj(NullUniValue, objError, jreq.id);
369  }
370  catch (const std::exception& e)
371  {
372  rpc_result = JSONRPCReplyObj(NullUniValue,
373  JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id);
374  }
375 
376  return rpc_result;
377 }
378 
379 std::string JSONRPCExecBatch(const JSONRPCRequest& jreq, const UniValue& vReq)
380 {
382  for (unsigned int reqIdx = 0; reqIdx < vReq.size(); reqIdx++)
383  ret.push_back(JSONRPCExecOne(jreq, vReq[reqIdx]));
384 
385  return ret.write() + "\n";
386 }
387 
392 static inline JSONRPCRequest transformNamedArguments(const JSONRPCRequest& in, const std::vector<std::string>& argNames)
393 {
394  JSONRPCRequest out = in;
396  // Build a map of parameters, and remove ones that have been processed, so that we can throw a focused error if
397  // there is an unknown one.
398  const std::vector<std::string>& keys = in.params.getKeys();
399  const std::vector<UniValue>& values = in.params.getValues();
400  std::unordered_map<std::string, const UniValue*> argsIn;
401  for (size_t i=0; i<keys.size(); ++i) {
402  argsIn[keys[i]] = &values[i];
403  }
404  // Process expected parameters.
405  int hole = 0;
406  for (const std::string &argNamePattern: argNames) {
407  std::vector<std::string> vargNames;
408  boost::algorithm::split(vargNames, argNamePattern, boost::algorithm::is_any_of("|"));
409  auto fr = argsIn.end();
410  for (const std::string & argName : vargNames) {
411  fr = argsIn.find(argName);
412  if (fr != argsIn.end()) {
413  break;
414  }
415  }
416  if (fr != argsIn.end()) {
417  for (int i = 0; i < hole; ++i) {
418  // Fill hole between specified parameters with JSON nulls,
419  // but not at the end (for backwards compatibility with calls
420  // that act based on number of specified parameters).
421  out.params.push_back(UniValue());
422  }
423  hole = 0;
424  out.params.push_back(*fr->second);
425  argsIn.erase(fr);
426  } else {
427  hole += 1;
428  }
429  }
430  // If there are still arguments in the argsIn map, this is an error.
431  if (!argsIn.empty()) {
432  throw JSONRPCError(RPC_INVALID_PARAMETER, "Unknown named parameter " + argsIn.begin()->first);
433  }
434  // Return request with named arguments transformed to positional arguments
435  return out;
436 }
437 
439 {
440  // Return immediately if in warmup
441  {
442  LOCK(g_rpc_warmup_mutex);
443  if (fRPCInWarmup)
444  throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);
445  }
446 
447  // Find method
448  auto it = mapCommands.find(request.strMethod);
449  if (it != mapCommands.end()) {
450  UniValue result;
451  for (const auto& command : it->second) {
452  if (ExecuteCommand(*command, request, result, &command == &it->second.back())) {
453  return result;
454  }
455  }
456  }
457  throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found");
458 }
459 
460 static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& request, UniValue& result, bool last_handler)
461 {
462  try
463  {
464  RPCCommandExecution execution(request.strMethod);
465  // Execute, convert arguments to array if necessary
466  if (request.params.isObject()) {
467  return command.actor(transformNamedArguments(request, command.argNames), result, last_handler);
468  } else {
469  return command.actor(request, result, last_handler);
470  }
471  }
472  catch (const std::exception& e)
473  {
474  throw JSONRPCError(RPC_MISC_ERROR, e.what());
475  }
476 }
477 
478 std::vector<std::string> CRPCTable::listCommands() const
479 {
480  std::vector<std::string> commandList;
481  for (const auto& i : mapCommands) commandList.emplace_back(i.first);
482  return commandList;
483 }
484 
486 {
487  if (!timerInterface)
488  timerInterface = iface;
489 }
490 
492 {
493  timerInterface = iface;
494 }
495 
497 {
498  if (timerInterface == iface)
499  timerInterface = nullptr;
500 }
501 
502 void RPCRunLater(const std::string& name, std::function<void()> func, int64_t nSeconds)
503 {
504  if (!timerInterface)
505  throw JSONRPCError(RPC_INTERNAL_ERROR, "No timer handler registered for RPC");
506  LOCK(g_deadline_timers_mutex);
507  deadlineTimers.erase(name);
508  LogPrint(BCLog::RPC, "queue run of timer %s in %i seconds (using %s)\n", name, nSeconds, timerInterface->Name());
509  deadlineTimers.emplace(name, std::unique_ptr<RPCTimerBase>(timerInterface->NewTimer(func, nSeconds*1000)));
510 }
511 
513 {
514  int flag = 0;
515  if (gArgs.GetArg("-rpcserialversion", DEFAULT_RPC_SERIALIZE_VERSION) == 0)
517  return flag;
518 }
519 
bool isObject() const
Definition: univalue.h:84
std::string Capitalize(std::string str)
Capitalizes the first character of the given string.
RPC timer "driver".
Definition: server.h:59
static const int SERIALIZE_TRANSACTION_NO_WITNESS
Definition: transaction.h:15
std::string help(const std::string &name, const JSONRPCRequest &helpreq) const
Definition: server.cpp:79
std::string category
Definition: server.h:112
const std::vector< UniValue > & getValues() const
static JSONRPCRequest transformNamedArguments(const JSONRPCRequest &in, const std::vector< std::string > &argNames)
Process named arguments into a vector of positional arguments, based on the passed-in specification f...
Definition: server.cpp:392
BCLog::Logger & LogInstance()
Definition: logging.cpp:14
Bitcoin RPC command dispatcher.
Definition: server.h:122
#define LogPrint(category,...)
Definition: logging.h:182
bool IsRPCRunning()
Query whether RPC is running.
Definition: server.cpp:318
void SetRPCWarmupStatus(const std::string &newStatus)
Set the RPC warmup status.
Definition: server.cpp:328
static const unsigned int DEFAULT_RPC_SERIALIZE_VERSION
Definition: server.h:19
Actor actor
Definition: server.h:114
fs::path m_file_path
Definition: logging.h:94
#define strprintf
Format arguments and return the string or write to given std::ostream (see tinyformat::format doc for...
Definition: tinyformat.h:1164
static bool fRPCInWarmup GUARDED_BY(g_rpc_warmup_mutex)
static std::atomic< bool > g_rpc_running
Definition: server.cpp:24
void OnStopped(std::function< void()> slot)
Definition: server.cpp:74
bool removeCommand(const std::string &name, const CRPCCommand *pcmd)
Definition: server.cpp:274
#define PACKAGE_NAME
void InterruptRPC()
Definition: server.cpp:294
const std::string & get_str() const
bool isNum() const
Definition: univalue.h:82
static UniValue uptime(const JSONRPCRequest &jsonRequest)
Definition: server.cpp:181
const std::vector< std::string > & getKeys() const
static const CRPCCommand vRPCCommands[]
Definition: server.cpp:242
void RPCRunLater(const std::string &name, std::function< void()> func, int64_t nSeconds)
Run func nSeconds from now.
Definition: server.cpp:502
bool appendCommand(const std::string &name, const CRPCCommand *pcmd)
Appends a CRPCCommand to the dispatch table.
Definition: server.cpp:265
Client still warming up.
Definition: protocol.h:49
std::string method
Definition: server.cpp:36
std::vector< std::string > argNames
Definition: server.h:115
Invalid, missing or duplicate parameter.
Definition: protocol.h:43
static RPCServerInfo g_rpc_server_info
Definition: server.cpp:46
static Mutex g_deadline_timers_mutex
Definition: server.cpp:30
void RPCUnsetTimerInterface(RPCTimerInterface *iface)
Unset factory function for timers.
Definition: server.cpp:496
void DeleteAuthCookie()
Delete RPC authentication cookie from disk.
Definition: request.cpp:124
static bool ExecuteCommand(const CRPCCommand &command, const JSONRPCRequest &request, UniValue &result, bool last_handler)
Definition: server.cpp:460
UniValue execute(const JSONRPCRequest &request) const
Execute a method.
Definition: server.cpp:438
boost::signals2::signal< void()> Stopped
Definition: server.cpp:66
std::string strMethod
Definition: request.h:35
void SetRPCWarmupFinished()
Definition: server.cpp:334
std::string name
Definition: server.h:113
CRPCTable tableRPC
Definition: server.cpp:520
UniValue JSONRPCError(int code, const std::string &message)
Definition: request.cpp:51
bool push_back(const UniValue &val)
Definition: univalue.cpp:108
Mutex mutex
Definition: server.cpp:42
static UniValue getrpcinfo(const JSONRPCRequest &request)
Definition: server.cpp:198
UniValue params
Definition: request.h:36
#define LOCK(cs)
Definition: sync.h:226
const char * name
Definition: rest.cpp:41
std::string HelpExampleRpc(const std::string &methodname, const std::string &args)
Definition: util.cpp:138
static RPCTimerInterface * timerInterface
Definition: server.cpp:28
boost::signals2::signal< void()> Started
Definition: server.cpp:65
std::string JSONRPCExecBatch(const JSONRPCRequest &jreq, const UniValue &vReq)
Definition: server.cpp:379
UniValue id
Definition: request.h:34
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
General application defined errors.
Definition: protocol.h:39
RPCCommandExecution(const std::string &method)
Definition: server.cpp:51
bool pushKV(const std::string &key, const UniValue &val)
Definition: univalue.cpp:133
int get_int() const
void StartRPC()
Definition: server.cpp:287
UniValue help(const JSONRPCRequest &jsonRequest)
Definition: server.cpp:133
bool IsDeprecatedRPCEnabled(const std::string &method)
Definition: server.cpp:349
static UniValue JSONRPCExecOne(JSONRPCRequest jreq, const UniValue &req)
Definition: server.cpp:356
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
Definition: sync.h:253
static struct CRPCSignals g_rpcSignals
void RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)
Set the factory function for timer, but only, if unset.
Definition: server.cpp:485
virtual RPCTimerBase * NewTimer(std::function< void()> &func, int64_t millis)=0
Factory function for timers.
int64_t GetTimeMicros()
Returns the system time (not mockable)
Definition: time.cpp:65
bool fHelp
Definition: request.h:37
void parse(const UniValue &valRequest)
Definition: request.cpp:153
void StopRPC()
Definition: server.cpp:305
int64_t GetStartupTime()
Server/client environment: argument handling, config file parsing, thread wrappers, startup time.
Definition: system.cpp:1149
void UninterruptibleSleep(const std::chrono::microseconds &n)
Definition: time.cpp:19
int RPCSerializationFlags()
Definition: server.cpp:512
void RpcInterruptionPoint()
Throw JSONRPCError if RPC is not running.
Definition: server.cpp:323
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
Definition: system.cpp:380
void RPCSetTimerInterface(RPCTimerInterface *iface)
Set the factory function for timers.
Definition: server.cpp:491
UniValue JSONRPCReplyObj(const UniValue &result, const UniValue &error, const UniValue &id)
Definition: request.cpp:33
std::list< RPCCommandExecutionInfo >::iterator it
Definition: server.cpp:50
ArgsManager gArgs
Definition: system.cpp:77
static Mutex g_rpc_warmup_mutex
Definition: server.cpp:23
bool RPCIsInWarmup(std::string *outStatus)
Definition: server.cpp:341
const UniValue NullUniValue
Definition: univalue.cpp:13
void StartShutdown()
Definition: shutdown.cpp:12
std::string HelpExampleCli(const std::string &methodname, const std::string &args)
Definition: util.cpp:133
virtual const char * Name()=0
Implementation name.
void OnStarted(std::function< void()> slot)
Definition: server.cpp:69
size_t size() const
Definition: univalue.h:68
std::vector< std::string > GetArgs(const std::string &strArg) const
Return a vector of strings of the given argument.
Definition: system.cpp:361
intptr_t unique_id
Definition: server.h:116
int64_t GetTime()
Return system time (or mocked time, if set)
Definition: time.cpp:23
std::vector< std::string > listCommands() const
Returns a list of registered commands.
Definition: server.cpp:478
auto it
Definition: validation.cpp:384
P2P client errors.
Definition: protocol.h:58
CRPCTable()
Definition: server.cpp:253
UniValue stop(const JSONRPCRequest &jsonRequest)
Definition: server.cpp:157