rippled
Main.cpp
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012, 2013 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #include <ripple/app/main/Application.h>
21 #include <ripple/app/main/DBInit.h>
22 #include <ripple/app/rdb/RelationalDBInterface_global.h>
23 #include <ripple/basics/Log.h>
24 #include <ripple/basics/StringUtilities.h>
25 #include <ripple/basics/contract.h>
26 #include <ripple/beast/clock/basic_seconds_clock.h>
27 #include <ripple/beast/core/CurrentThreadName.h>
28 #include <ripple/core/Config.h>
29 #include <ripple/core/ConfigSections.h>
30 #include <ripple/core/TimeKeeper.h>
31 #include <ripple/json/to_string.h>
32 #include <ripple/net/RPCCall.h>
33 #include <ripple/protocol/BuildInfo.h>
34 #include <ripple/resource/Fees.h>
35 #include <ripple/rpc/RPCHandler.h>
36 
37 #include <beast/unit_test/match.hpp>
38 #include <test/unit_test/multi_runner.h>
39 
40 #include <google/protobuf/stubs/common.h>
41 
42 #include <boost/filesystem.hpp>
43 #include <boost/predef.h>
44 #include <boost/process.hpp>
45 #include <boost/program_options.hpp>
46 
47 #include <cstdlib>
48 #include <iostream>
49 #include <stdexcept>
50 #include <utility>
51 
52 #if BOOST_OS_WINDOWS
53 #include <sys/timeb.h>
54 #include <sys/types.h>
55 #endif
56 
57 // Do we know the plaform we're compiling on? If you're adding new platforms
58 // modify this check accordingly.
59 #if !BOOST_OS_LINUX && !BOOST_OS_WINDOWS && !BOOST_OS_MACOS
60 #error Supported platforms are: Linux, Windows and MacOS
61 #endif
62 
63 // Ensure that precisely one platform is detected.
64 #if (BOOST_OS_LINUX && (BOOST_OS_WINDOWS || BOOST_OS_MACOS)) || \
65  (BOOST_OS_MACOS && (BOOST_OS_WINDOWS || BOOST_OS_LINUX)) || \
66  (BOOST_OS_WINDOWS && (BOOST_OS_LINUX || BOOST_OS_MACOS))
67 #error Multiple supported platforms appear active at once
68 #endif
69 
70 namespace po = boost::program_options;
71 
72 namespace ripple {
73 
74 bool
76 {
77 #ifdef RLIMIT_NOFILE
78  // Get the current limit, then adjust it to what we need.
79  struct rlimit rl;
80 
81  int available = 0;
82 
83  if (getrlimit(RLIMIT_NOFILE, &rl) == 0)
84  {
85  // If the limit is infinite, then we are good.
86  if (rl.rlim_cur == RLIM_INFINITY)
87  available = needed;
88  else
89  available = rl.rlim_cur;
90 
91  if (available < needed)
92  {
93  // Ignore the rlim_max, as the process may
94  // be configured to override it anyways. We
95  // ask for the number descriptors we need.
96  rl.rlim_cur = needed;
97 
98  if (setrlimit(RLIMIT_NOFILE, &rl) == 0)
99  available = rl.rlim_cur;
100  }
101  }
102 
103  if (needed > available)
104  {
105  j.fatal() << "Insufficient number of file descriptors: " << needed
106  << " are needed, but only " << available << " are available.";
107 
108  std::cerr << "Insufficient number of file descriptors: " << needed
109  << " are needed, but only " << available
110  << " are available.\n";
111 
112  return false;
113  }
114 #endif
115 
116  return true;
117 }
118 
119 void
120 printHelp(const po::options_description& desc)
121 {
122  std::cerr
123  << systemName() << "d [options] <command> <params>\n"
124  << desc << std::endl
125  << "Commands: \n"
126  " account_currencies <account> [<ledger>] [strict]\n"
127  " account_info <account>|<seed>|<pass_phrase>|<key> [<ledger>] "
128  "[strict]\n"
129  " account_lines <account> <account>|\"\" [<ledger>]\n"
130  " account_channels <account> <account>|\"\" [<ledger>]\n"
131  " account_objects <account> [<ledger>] [strict]\n"
132  " account_offers <account>|<account_public_key> [<ledger>] "
133  "[strict]\n"
134  " account_tx accountID [ledger_min [ledger_max [limit "
135  "[offset]]]] [binary] [count] [descending]\n"
136  " book_offers <taker_pays> <taker_gets> [<taker [<ledger> "
137  "[<limit> [<proof> [<marker>]]]]]\n"
138  " can_delete [<ledgerid>|<ledgerhash>|now|always|never]\n"
139  " channel_authorize <private_key> <channel_id> <drops>\n"
140  " channel_verify <public_key> <channel_id> <drops> <signature>\n"
141  " connect <ip> [<port>]\n"
142  " consensus_info\n"
143  " deposit_authorized <source_account> <destination_account> "
144  "[<ledger>]\n"
145  " download_shard [[<index> <url>]]\n"
146  " feature [<feature> [accept|reject]]\n"
147  " fetch_info [clear]\n"
148  " gateway_balances [<ledger>] <issuer_account> [ <hotwallet> [ "
149  "<hotwallet> ]]\n"
150  " get_counts\n"
151  " json <method> <json>\n"
152  " ledger [<id>|current|closed|validated] [full]\n"
153  " ledger_accept\n"
154  " ledger_cleaner\n"
155  " ledger_closed\n"
156  " ledger_current\n"
157  " ledger_request <ledger>\n"
158  " log_level [[<partition>] <severity>]\n"
159  " logrotate\n"
160  " nodetoshard_status\n"
161  " peers\n"
162  " ping\n"
163  " random\n"
164  " peer_reservations_add <public_key> [<description>]\n"
165  " peer_reservations_del <public_key>\n"
166  " peer_reservations_list\n"
167  " ripple ...\n"
168  " ripple_path_find <json> [<ledger>]\n"
169  " server_info [counters]\n"
170  " server_state [counters]\n"
171  " sign <private_key> <tx_json> [offline]\n"
172  " sign_for <signer_address> <signer_private_key> <tx_json> "
173  "[offline]\n"
174  " stop\n"
175  " submit <tx_blob>|[<private_key> <tx_json>]\n"
176  " submit_multisigned <tx_json>\n"
177  " tx <id>\n"
178  " validation_create [<seed>|<pass_phrase>|<key>]\n"
179  " validators\n"
180  " validator_list_sites\n"
181  " version\n"
182  " wallet_propose [<passphrase>]\n";
183 }
184 
185 //------------------------------------------------------------------------------
186 
187 /* simple unit test selector that allows a comma separated list
188  * of selectors
189  */
190 class multi_selector
191 {
192 private:
194 
195 public:
196  explicit multi_selector(std::string const& patterns = "")
197  {
199  boost::split(v, patterns, boost::algorithm::is_any_of(","));
200  selectors_.reserve(v.size());
201  std::for_each(v.begin(), v.end(), [this](std::string s) {
202  boost::trim(s);
203  if (selectors_.empty() || !s.empty())
204  selectors_.emplace_back(
205  beast::unit_test::selector::automatch, s);
206  });
207  }
208 
209  bool
210  operator()(beast::unit_test::suite_info const& s)
211  {
212  for (auto& sel : selectors_)
213  if (sel(s))
214  return true;
215  return false;
216  }
217 
219  size() const
220  {
221  return selectors_.size();
222  }
223 };
224 
225 namespace test {
227 }
228 
229 template <class Runner>
230 static bool
231 anyMissing(Runner& runner, multi_selector const& pred)
232 {
233  if (runner.tests() == 0)
234  {
235  runner.add_failures(1);
236  std::cout << "Failed: No tests run" << std::endl;
237  return true;
238  }
239  if (runner.suites() < pred.size())
240  {
241  auto const missing = pred.size() - runner.suites();
242  runner.add_failures(missing);
243  std::cout << "Failed: " << missing
244  << " filters did not match any existing test suites"
245  << std::endl;
246  return true;
247  }
248  return false;
249 }
250 
251 static int
252 runUnitTests(
253  std::string const& pattern,
254  std::string const& argument,
255  bool quiet,
256  bool log,
257  bool child,
258  bool ipv6,
259  std::size_t num_jobs,
260  int argc,
261  char** argv)
262 {
263  using namespace beast::unit_test;
264  using namespace ripple::test;
265 
266  ripple::test::envUseIPv4 = (!ipv6);
267 
268  if (!child && num_jobs == 1)
269  {
270  multi_runner_parent parent_runner;
271 
272  multi_runner_child child_runner{num_jobs, quiet, log};
273  child_runner.arg(argument);
274  multi_selector pred(pattern);
275  auto const any_failed =
276  child_runner.run_multi(pred) || anyMissing(child_runner, pred);
277 
278  if (any_failed)
279  return EXIT_FAILURE;
280  return EXIT_SUCCESS;
281  }
282  if (!child)
283  {
284  multi_runner_parent parent_runner;
286 
287  std::string const exe_name = argv[0];
289  {
290  args.reserve(argc);
291  for (int i = 1; i < argc; ++i)
292  args.emplace_back(argv[i]);
293  args.emplace_back("--unittest-child");
294  }
295 
296  for (std::size_t i = 0; i < num_jobs; ++i)
297  children.emplace_back(
298  boost::process::exe = exe_name, boost::process::args = args);
299 
300  int bad_child_exits = 0;
301  int terminated_child_exits = 0;
302  for (auto& c : children)
303  {
304  try
305  {
306  c.wait();
307  if (c.exit_code())
308  ++bad_child_exits;
309  }
310  catch (...)
311  {
312  // wait throws if process was terminated with a signal
313  ++bad_child_exits;
314  ++terminated_child_exits;
315  }
316  }
317 
318  parent_runner.add_failures(terminated_child_exits);
319  anyMissing(parent_runner, multi_selector(pattern));
320 
321  if (parent_runner.any_failed() || bad_child_exits)
322  return EXIT_FAILURE;
323  return EXIT_SUCCESS;
324  }
325  else
326  {
327  // child
328  multi_runner_child runner{num_jobs, quiet, log};
329  runner.arg(argument);
330  auto const anyFailed = runner.run_multi(multi_selector(pattern));
331 
332  if (anyFailed)
333  return EXIT_FAILURE;
334  return EXIT_SUCCESS;
335  }
336 }
337 
338 //------------------------------------------------------------------------------
339 
340 int
341 run(int argc, char** argv)
342 {
343  using namespace std;
344 
346  "rippled: main " + BuildInfo::getVersionString());
347 
348  po::variables_map vm;
349 
350  std::string importText;
351  {
352  importText += "Import an existing node database (specified in the [";
353  importText += ConfigSection::importNodeDatabase();
354  importText += "] configuration file section) into the current ";
355  importText += "node database (specified in the [";
356  importText += ConfigSection::nodeDatabase();
357  importText += "] configuration file section).";
358  }
359 
360  // Set up option parsing.
361  //
362  po::options_description gen("General Options");
363  gen.add_options()(
364  "conf", po::value<std::string>(), "Specify the configuration file.")(
365  "debug", "Enable normally suppressed debug logging")(
366  "help,h", "Display this message.")(
367  "quorum",
368  po::value<std::size_t>(),
369  "Override the minimum validation quorum.")(
370  "reportingReadOnly", "Run in read-only reporting mode")(
371  "silent", "No output to the console after startup.")(
372  "standalone,a", "Run with no peers.")("verbose,v", "Verbose logging.")(
373  "version", "Display the build version.");
374 
375  po::options_description data("Ledger/Data Options");
376  data.add_options()("import", importText.c_str())(
377  "ledger",
378  po::value<std::string>(),
379  "Load the specified ledger and start from the value given.")(
380  "ledgerfile",
381  po::value<std::string>(),
382  "Load the specified ledger file.")(
383  "load", "Load the current ledger from the local DB.")(
384  "net", "Get the initial ledger from the network.")(
385  "nodetoshard", "Import node store into shards")(
386  "replay", "Replay a ledger close.")(
387  "start", "Start from a fresh Ledger.")(
388  "startReporting",
389  po::value<std::string>(),
390  "Start reporting from a fresh Ledger.")(
391  "vacuum", "VACUUM the transaction db.")(
392  "valid", "Consider the initial ledger a valid network ledger.");
393 
394  po::options_description rpc("RPC Client Options");
395  rpc.add_options()(
396  "rpc",
397  "Perform rpc command - see below for available commands. "
398  "This is assumed if any positional parameters are provided.")(
399  "rpc_ip",
400  po::value<std::string>(),
401  "Specify the IP address for RPC command. "
402  "Format: <ip-address>[':'<port-number>]")(
403  "rpc_port",
404  po::value<std::uint16_t>(),
405  "DEPRECATED: include with rpc_ip instead. "
406  "Specify the port number for RPC command.");
407 
408  po::options_description test("Unit Test Options");
409  test.add_options()(
410  "quiet,q",
411  "Suppress test suite messages, "
412  "including suite/case name (at start) and test log messages.")(
413  "unittest,u",
414  po::value<std::string>()->implicit_value(""),
415  "Perform unit tests. The optional argument specifies one or "
416  "more comma-separated selectors. Each selector specifies a suite name, "
417  "full-name (lib.module.suite), module, or library "
418  "(checked in that "
419  "order).")(
420  "unittest-arg",
421  po::value<std::string>()->implicit_value(""),
422  "Supplies an argument string to unit tests. If provided, this argument "
423  "is made available to each suite that runs. Interpretation of the "
424  "argument is handled individually by any suite that accesses it -- "
425  "as such, it typically only make sense to provide this when running "
426  "a single suite.")(
427  "unittest-ipv6",
428  "Use IPv6 localhost when running unittests (default is IPv4).")(
429  "unittest-log",
430  "Force unit test log message output. Only useful in combination with "
431  "--quiet, in which case log messages will print but suite/case names "
432  "will not.")(
433  "unittest-jobs",
434  po::value<std::size_t>(),
435  "Number of unittest jobs to run in parallel (child processes).");
436 
437  // These are hidden options, not intended to be shown in the usage/help
438  // message
439  po::options_description hidden("Hidden Options");
440  hidden.add_options()(
441  "parameters",
442  po::value<vector<string>>(),
443  "Specify rpc command and parameters. This option must be repeated "
444  "for each command/param. Positional parameters also serve this "
445  "purpose, "
446  "so this option is not needed for users")(
447  "unittest-child",
448  "For internal use only when spawning child unit test processes.")(
449  "fg", "Deprecated: server always in foreground mode.");
450 
451  // Interpret positional arguments as --parameters.
452  po::positional_options_description p;
453  p.add("parameters", -1);
454 
455  po::options_description all;
456  all.add(gen).add(rpc).add(data).add(test).add(hidden);
457 
458  po::options_description desc;
459  desc.add(gen).add(rpc).add(data).add(test);
460 
461  // Parse options, if no error.
462  try
463  {
464  po::store(
465  po::command_line_parser(argc, argv)
466  .options(all) // Parse options.
467  .positional(p) // Remainder as --parameters.
468  .run(),
469  vm);
470  po::notify(vm); // Invoke option notify functions.
471  }
472  catch (std::exception const& ex)
473  {
474  std::cerr << "rippled: " << ex.what() << std::endl;
475  std::cerr << "Try 'rippled --help' for a list of options." << std::endl;
476  return 1;
477  }
478 
479  if (vm.count("help"))
480  {
481  printHelp(desc);
482  return 0;
483  }
484 
485  if (vm.count("version"))
486  {
487  std::cout << "rippled version " << BuildInfo::getVersionString()
488  << std::endl;
489  return 0;
490  }
491 
492  // Run the unit tests if requested.
493  // The unit tests will exit the application with an appropriate return code.
494  //
495  if (vm.count("unittest"))
496  {
497  std::string argument;
498 
499  if (vm.count("unittest-arg"))
500  argument = vm["unittest-arg"].as<std::string>();
501 
502  std::size_t numJobs = 1;
503  bool unittestChild = false;
504  if (vm.count("unittest-jobs"))
505  numJobs = std::max(numJobs, vm["unittest-jobs"].as<std::size_t>());
506  unittestChild = bool(vm.count("unittest-child"));
507 
508  return runUnitTests(
509  vm["unittest"].as<std::string>(),
510  argument,
511  bool(vm.count("quiet")),
512  bool(vm.count("unittest-log")),
513  unittestChild,
514  bool(vm.count("unittest-ipv6")),
515  numJobs,
516  argc,
517  argv);
518  }
519  else
520  {
521  if (vm.count("unittest-jobs"))
522  {
523  // unittest jobs only makes sense with `unittest`
524  std::cerr << "rippled: '--unittest-jobs' specified without "
525  "'--unittest'.\n";
526  std::cerr << "To run the unit tests the '--unittest' option must "
527  "be present.\n";
528  return 1;
529  }
530  }
531 
532  auto config = std::make_unique<Config>();
533 
534  auto configFile =
535  vm.count("conf") ? vm["conf"].as<std::string>() : std::string();
536 
537  // config file, quiet flag.
538  config->setup(
539  configFile,
540  bool(vm.count("quiet")),
541  bool(vm.count("silent")),
542  bool(vm.count("standalone")));
543 
544  if (vm.count("vacuum"))
545  {
546  if (config->standalone())
547  {
548  std::cerr << "vacuum not applicable in standalone mode.\n";
549  return -1;
550  }
551 
552  try
553  {
554  auto setup = setup_DatabaseCon(*config);
555  if (!doVacuumDB(setup))
556  return -1;
557  }
558  catch (std::exception const& e)
559  {
560  std::cerr << "exception " << e.what() << " in function " << __func__
561  << std::endl;
562  return -1;
563  }
564 
565  return 0;
566  }
567 
568  if (vm.count("start"))
569  {
570  config->START_UP = Config::FRESH;
571  }
572 
573  if (vm.count("startReporting"))
574  {
575  config->START_UP = Config::FRESH;
576  config->START_LEDGER = vm["startReporting"].as<std::string>();
577  }
578 
579  if (vm.count("reportingReadOnly"))
580  {
581  config->setReportingReadOnly(true);
582  }
583 
584  if (vm.count("import"))
585  config->doImport = true;
586 
587  if (vm.count("nodetoshard"))
588  config->nodeToShard = true;
589 
590  if (vm.count("ledger"))
591  {
592  config->START_LEDGER = vm["ledger"].as<std::string>();
593  if (vm.count("replay"))
594  config->START_UP = Config::REPLAY;
595  else
596  config->START_UP = Config::LOAD;
597  }
598  else if (vm.count("ledgerfile"))
599  {
600  config->START_LEDGER = vm["ledgerfile"].as<std::string>();
601  config->START_UP = Config::LOAD_FILE;
602  }
603  else if (vm.count("load"))
604  {
605  config->START_UP = Config::LOAD;
606  }
607 
608  if (vm.count("valid"))
609  {
610  config->START_VALID = true;
611  }
612 
613  if (vm.count("net"))
614  {
615  if ((config->START_UP == Config::LOAD) ||
616  (config->START_UP == Config::REPLAY))
617  {
618  std::cerr << "Net and load/replay options are incompatible"
619  << std::endl;
620  return -1;
621  }
622 
623  config->START_UP = Config::NETWORK;
624  }
625 
626  // Override the RPC destination IP address. This must
627  // happen after the config file is loaded.
628  if (vm.count("rpc_ip"))
629  {
631  vm["rpc_ip"].as<std::string>());
632  if (!endpoint)
633  {
634  std::cerr << "Invalid rpc_ip = " << vm["rpc_ip"].as<std::string>()
635  << "\n";
636  return -1;
637  }
638 
639  if (endpoint->port() == 0)
640  {
641  std::cerr << "No port specified in rpc_ip.\n";
642  if (vm.count("rpc_port"))
643  {
644  std::cerr << "WARNING: using deprecated rpc_port param.\n";
645  try
646  {
647  endpoint =
648  endpoint->at_port(vm["rpc_port"].as<std::uint16_t>());
649  if (endpoint->port() == 0)
650  throw std::domain_error("0");
651  }
652  catch (std::exception const& e)
653  {
654  std::cerr << "Invalid rpc_port = " << e.what() << "\n";
655  return -1;
656  }
657  }
658  else
659  return -1;
660  }
661 
662  config->rpc_ip = std::move(*endpoint);
663  }
664 
665  if (vm.count("quorum"))
666  {
667  try
668  {
669  config->VALIDATION_QUORUM = vm["quorum"].as<std::size_t>();
670  if (config->VALIDATION_QUORUM == std::size_t{})
671  {
672  throw std::domain_error("0");
673  }
674  }
675  catch (std::exception const& e)
676  {
677  std::cerr << "Invalid value specified for --quorum (" << e.what()
678  << ")\n";
679  return -1;
680  }
681  }
682 
683  // Construct the logs object at the configured severity
684  using namespace beast::severities;
685  Severity thresh = kInfo;
686 
687  if (vm.count("quiet"))
688  thresh = kFatal;
689  else if (vm.count("verbose"))
690  thresh = kTrace;
691 
692  auto logs = std::make_unique<Logs>(thresh);
693 
694  // No arguments. Run server.
695  if (!vm.count("parameters"))
696  {
697  // TODO: this comment can be removed in a future release -
698  // say 1.7 or higher
699  if (config->had_trailing_comments())
700  {
701  JLOG(logs->journal("Application").warn())
702  << "Trailing comments were seen in your config file. "
703  << "The treatment of inline/trailing comments has changed "
704  "recently. "
705  << "Any `#` characters NOT intended to delimit comments should "
706  "be "
707  << "preceded by a \\";
708  }
709 
710  // We want at least 1024 file descriptors. We'll
711  // tweak this further.
712  if (!adjustDescriptorLimit(1024, logs->journal("Application")))
713  return -1;
714 
715  if (vm.count("debug"))
716  setDebugLogSink(logs->makeSink("Debug", beast::severities::kTrace));
717 
718  auto timeKeeper = make_TimeKeeper(logs->journal("TimeKeeper"));
719 
720  auto app = make_Application(
721  std::move(config), std::move(logs), std::move(timeKeeper));
722 
723  if (!app->setup())
724  return -1;
725 
726  // With our configuration parsed, ensure we have
727  // enough file descriptors available:
729  app->fdRequired(), app->logs().journal("Application")))
730  return -1;
731 
732  // Start the server
733  app->start(true /*start timers*/);
734 
735  // Block until we get a stop RPC.
736  app->run();
737 
738  return 0;
739  }
740 
741  // We have an RPC command to process:
742  beast::setCurrentThreadName("rippled: rpc");
744  *config, vm["parameters"].as<std::vector<std::string>>(), *logs);
745 }
746 
747 } // namespace ripple
748 
749 int
750 main(int argc, char** argv)
751 {
752 #if BOOST_OS_WINDOWS
753  {
754  // Work around for https://svn.boost.org/trac/boost/ticket/10657
755  // Reported against boost version 1.56.0. If an application's
756  // first call to GetTimeZoneInformation is from a coroutine, an
757  // unhandled exception is generated. A workaround is to call
758  // GetTimeZoneInformation at least once before launching any
759  // coroutines. At the time of this writing the _ftime call is
760  // used to initialize the timezone information.
761  struct _timeb t;
762 #ifdef _INC_TIME_INL
763  _ftime_s(&t);
764 #else
765  _ftime(&t);
766 #endif
767  }
768 #endif
769 
770  atexit(&google::protobuf::ShutdownProtobufLibrary);
771 
772  return ripple::run(argc, argv);
773 }
beast::Journal::fatal
Stream fatal() const
Definition: Journal.h:339
beast::severities::kTrace
@ kTrace
Definition: Journal.h:34
std::for_each
T for_each(T... args)
std::domain_error
STL class.
std::string
STL class.
ripple::test::multi_runner_parent::add_failures
void add_failures(std::size_t failures)
Definition: multi_runner.cpp:502
utility
std::exception
STL class.
ripple::printHelp
void printHelp(const po::options_description &desc)
Definition: Main.cpp:120
std::vector::reserve
T reserve(T... args)
ripple::TxSearched::all
@ all
ripple::setup_DatabaseCon
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
Definition: DatabaseCon.cpp:106
std::vector
STL class.
beast::unit_test
Definition: define_print.cpp:16
std::vector::size
T size(T... args)
ripple::ConfigSection::importNodeDatabase
static std::string importNodeDatabase()
Definition: ConfigSections.h:43
ripple::Config::LOAD
@ LOAD
Definition: Config.h:132
beast::severities
A namespace for easy access to logging severity values.
Definition: Journal.h:29
std::cerr
iostream
std::cout
stdexcept
std::atexit
T atexit(T... args)
std::log
T log(T... args)
ripple::Config::NETWORK
@ NETWORK
Definition: Config.h:132
std::string::c_str
T c_str(T... args)
ripple::setDebugLogSink
std::unique_ptr< beast::Journal::Sink > setDebugLogSink(std::unique_ptr< beast::Journal::Sink > sink)
Set the sink for the debug journal.
Definition: Log.cpp:446
ripple::BuildInfo::getVersionString
std::string const & getVersionString()
Server version.
Definition: BuildInfo.cpp:61
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
ripple::test::multi_runner_parent::any_failed
bool any_failed() const
Definition: multi_runner.cpp:484
std::atomic< bool >
beast::severities::kInfo
@ kInfo
Definition: Journal.h:36
ripple::RPCCall::fromCommandLine
int fromCommandLine(Config const &config, const std::vector< std::string > &vCmd, Logs &logs)
Definition: RPCCall.cpp:1673
ripple::test::envUseIPv4
std::atomic< bool > envUseIPv4
Definition: envconfig.cpp:34
beast::setCurrentThreadName
void setCurrentThreadName(std::string_view name)
Changes the name of the caller thread.
Definition: CurrentThreadName.cpp:119
std::vector::emplace_back
T emplace_back(T... args)
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::test
Definition: LedgerDeltaAcquire.h:35
ripple::Config::FRESH
@ FRESH
Definition: Config.h:132
cstdlib
std::endl
T endl(T... args)
beast::severities::Severity
Severity
Severity level / threshold of a Journal message.
Definition: Journal.h:31
std::vector::begin
T begin(T... args)
std
STL namespace.
ripple::Config::REPLAY
@ REPLAY
Definition: Config.h:132
ripple::make_TimeKeeper
std::unique_ptr< TimeKeeper > make_TimeKeeper(beast::Journal j)
Definition: TimeKeeper.cpp:119
ripple::test::multi_runner_child
A class to run a subset of unit tests.
Definition: multi_runner.h:253
ripple::systemName
static std::string const & systemName()
Definition: SystemParameters.h:34
std::size_t
std::vector::end
T end(T... args)
ripple::doVacuumDB
bool doVacuumDB(DatabaseCon::Setup const &setup)
doVacuumDB Creates, initialises DB, and performs its cleanup.
Definition: RelationalDBInterface_global.cpp:540
beast::severities::kFatal
@ kFatal
Definition: Journal.h:39
std::max
T max(T... args)
ripple::test::multi_runner_parent
Manager for children running unit tests.
Definition: multi_runner.h:218
ripple::adjustDescriptorLimit
bool adjustDescriptorLimit(int needed, beast::Journal j)
Definition: Main.cpp:75
ripple::Config::LOAD_FILE
@ LOAD_FILE
Definition: Config.h:132
std::data
T data(T... args)
beast::IP::Endpoint::from_string_checked
static std::optional< Endpoint > from_string_checked(std::string const &s)
Create an Endpoint from a string.
Definition: IPEndpoint.cpp:35
ripple::make_Application
std::unique_ptr< Application > make_Application(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
Definition: Application.cpp:2136
ripple::PublisherStatus::available
@ available
ripple::ConfigSection::nodeDatabase
static std::string nodeDatabase()
Definition: ConfigSections.h:33
std::exception::what
T what(T... args)