rippled
Application.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/consensus/RCLValidations.h>
21 #include <ripple/app/ledger/InboundLedgers.h>
22 #include <ripple/app/ledger/InboundTransactions.h>
23 #include <ripple/app/ledger/LedgerCleaner.h>
24 #include <ripple/app/ledger/LedgerMaster.h>
25 #include <ripple/app/ledger/LedgerReplayer.h>
26 #include <ripple/app/ledger/LedgerToJson.h>
27 #include <ripple/app/ledger/OpenLedger.h>
28 #include <ripple/app/ledger/OrderBookDB.h>
29 #include <ripple/app/ledger/PendingSaves.h>
30 #include <ripple/app/ledger/TransactionMaster.h>
31 #include <ripple/app/main/Application.h>
32 #include <ripple/app/main/BasicApp.h>
33 #include <ripple/app/main/DBInit.h>
34 #include <ripple/app/main/GRPCServer.h>
35 #include <ripple/app/main/LoadManager.h>
36 #include <ripple/app/main/NodeIdentity.h>
37 #include <ripple/app/main/NodeStoreScheduler.h>
38 #include <ripple/app/main/Tuning.h>
39 #include <ripple/app/misc/AmendmentTable.h>
40 #include <ripple/app/misc/HashRouter.h>
41 #include <ripple/app/misc/LoadFeeTrack.h>
42 #include <ripple/app/misc/NetworkOPs.h>
43 #include <ripple/app/misc/SHAMapStore.h>
44 #include <ripple/app/misc/TxQ.h>
45 #include <ripple/app/misc/ValidatorKeys.h>
46 #include <ripple/app/misc/ValidatorSite.h>
47 #include <ripple/app/paths/PathRequests.h>
48 #include <ripple/app/rdb/RelationalDBInterface_global.h>
49 #include <ripple/app/rdb/backend/RelationalDBInterfacePostgres.h>
50 #include <ripple/app/reporting/ReportingETL.h>
51 #include <ripple/app/tx/apply.h>
52 #include <ripple/basics/ByteUtilities.h>
53 #include <ripple/basics/PerfLog.h>
54 #include <ripple/basics/ResolverAsio.h>
55 #include <ripple/basics/safe_cast.h>
56 #include <ripple/beast/asio/io_latency_probe.h>
57 #include <ripple/beast/core/LexicalCast.h>
58 #include <ripple/core/DatabaseCon.h>
59 #include <ripple/json/json_reader.h>
60 #include <ripple/nodestore/DatabaseShard.h>
61 #include <ripple/nodestore/DummyScheduler.h>
62 #include <ripple/overlay/Cluster.h>
63 #include <ripple/overlay/PeerReservationTable.h>
64 #include <ripple/overlay/PeerSet.h>
65 #include <ripple/overlay/make_Overlay.h>
66 #include <ripple/protocol/BuildInfo.h>
67 #include <ripple/protocol/Feature.h>
68 #include <ripple/protocol/Protocol.h>
69 #include <ripple/protocol/STParsedJSON.h>
70 #include <ripple/resource/Fees.h>
71 #include <ripple/rpc/ShardArchiveHandler.h>
72 #include <ripple/rpc/impl/RPCHelpers.h>
73 #include <ripple/shamap/NodeFamily.h>
74 #include <ripple/shamap/ShardFamily.h>
75 
76 #include <boost/algorithm/string/predicate.hpp>
77 #include <boost/asio/steady_timer.hpp>
78 #include <boost/system/error_code.hpp>
79 
80 #include <date/date.h>
81 
82 #include <chrono>
83 #include <condition_variable>
84 #include <cstring>
85 #include <iostream>
86 #include <limits>
87 #include <mutex>
88 #include <optional>
89 #include <sstream>
90 #include <utility>
91 #include <variant>
92 
93 namespace ripple {
94 
95 // VFALCO TODO Move the function definitions into the class declaration
96 class ApplicationImp : public Application, public BasicApp
97 {
98 private:
100  {
101  private:
106 
107  public:
111  std::chrono::milliseconds interval,
112  boost::asio::io_service& ios)
113  : m_event(ev)
114  , m_journal(journal)
115  , m_probe(interval, ios)
116  , lastSample_{}
117  {
118  }
119 
120  void
122  {
123  m_probe.sample(std::ref(*this));
124  }
125 
126  template <class Duration>
127  void
128  operator()(Duration const& elapsed)
129  {
130  using namespace std::chrono;
131  auto const lastSample = ceil<milliseconds>(elapsed);
132 
133  lastSample_ = lastSample;
134 
135  if (lastSample >= 10ms)
136  m_event.notify(lastSample);
137  if (lastSample >= 500ms)
138  {
139  JLOG(m_journal.warn())
140  << "io_service latency = " << lastSample.count();
141  }
142  }
143 
145  get() const
146  {
147  return lastSample_.load();
148  }
149 
150  void
152  {
153  m_probe.cancel();
154  }
155 
156  void
158  {
160  }
161  };
162 
163 public:
167 
171 
172  // Required by the SHAMapStore
174 
182 
187 
189 
195  // VFALCO TODO Make OrderBookDB abstract
219  boost::asio::steady_timer sweepTimer_;
220  boost::asio::steady_timer entropyTimer_;
221 
225 
226  boost::asio::signal_set m_signals;
227 
229  mutable std::mutex mut_;
230  bool isTimeToStop = false;
231 
233 
235 
237 
240 
241  //--------------------------------------------------------------------------
242 
243  static std::size_t
245  {
246 #if RIPPLE_SINGLE_IO_SERVICE_THREAD
247  return 1;
248 #else
249 
250  if (config.IO_WORKERS > 0)
251  return config.IO_WORKERS;
252 
253  auto const cores = std::thread::hardware_concurrency();
254 
255  // Use a single thread when running on under-provisioned systems
256  // or if we are configured to use minimal resources.
257  if ((cores == 1) || ((config.NODE_SIZE == 0) && (cores == 2)))
258  return 1;
259 
260  // Otherwise, prefer two threads.
261  return 2;
262 #endif
263  }
264 
265  //--------------------------------------------------------------------------
266 
272  , config_(std::move(config))
273  , logs_(std::move(logs))
274  , timeKeeper_(std::move(timeKeeper))
275  , m_journal(logs_->journal("Application"))
276 
277  // PerfLog must be started before any other threads are launched.
278  , perfLog_(perf::make_PerfLog(
279  perf::setup_PerfLog(
280  config_->section("perf"),
281  config_->CONFIG_DIR),
282  *this,
283  logs_->journal("PerfLog"),
284  [this] { signalStop(); }))
285 
286  , m_txMaster(*this)
287 
289  config_->section(SECTION_INSIGHT),
290  logs_->journal("Collector")))
291 
292  , m_jobQueue(std::make_unique<JobQueue>(
293  [](std::unique_ptr<Config> const& config) {
294  if (config->standalone() && !config->reporting() &&
296  return 1;
297 
298  if (config->WORKERS)
299  return config->WORKERS;
300 
301  auto count =
302  static_cast<int>(std::thread::hardware_concurrency());
303 
304  // Be more aggressive about the number of threads to use
305  // for the job queue if the server is configured as "large"
306  // or "huge" if there are enough cores.
307  if (config->NODE_SIZE >= 4 && count >= 16)
308  count = 6 + std::min(count, 8);
309  else if (config->NODE_SIZE >= 3 && count >= 8)
310  count = 4 + std::min(count, 6);
311  else
312  count = 2 + std::min(count, 4);
313 
314  return count;
315  }(config_),
316  m_collectorManager->group("jobq"),
317  logs_->journal("JobQueue"),
318  *logs_,
319  *perfLog_))
320 
322 
324  *this,
326  logs_->journal("SHAMapStore")))
327 
328  , accountIDCache_(128000)
329 
330  , m_tempNodeCache(
331  "NodeCache",
332  16384,
334  stopwatch(),
335  logs_->journal("TaggedCache"))
336 
337  , cachedSLEs_(
338  "Cached SLEs",
339  0,
341  stopwatch(),
342  logs_->journal("CachedSLEs"))
343 
345 
347  m_collectorManager->collector(),
348  logs_->journal("Resource")))
349 
350  , m_nodeStore(m_shaMapStore->makeNodeStore(
351  config_->PREFETCH_WORKERS > 0 ? config_->PREFETCH_WORKERS : 4))
352 
354 
355  // The shard store is optional and make_ShardStore can return null.
357  *this,
359  4,
360  logs_->journal("ShardStore")))
361 
362  , m_orderBookDB(*this)
363 
364  , m_pathRequests(std::make_unique<PathRequests>(
365  *this,
366  logs_->journal("PathRequest"),
367  m_collectorManager->collector()))
368 
369  , m_ledgerMaster(std::make_unique<LedgerMaster>(
370  *this,
371  stopwatch(),
372  m_collectorManager->collector(),
373  logs_->journal("LedgerMaster")))
374 
375  , ledgerCleaner_(
376  make_LedgerCleaner(*this, logs_->journal("LedgerCleaner")))
377 
378  // VFALCO NOTE must come before NetworkOPs to prevent a crash due
379  // to dependencies in the destructor.
380  //
382  *this,
383  stopwatch(),
384  m_collectorManager->collector()))
385 
387  *this,
388  m_collectorManager->collector(),
389  [this](std::shared_ptr<SHAMap> const& set, bool fromAcquire) {
390  gotTXSet(set, fromAcquire);
391  }))
392 
393  , m_ledgerReplayer(std::make_unique<LedgerReplayer>(
394  *this,
396  make_PeerSetBuilder(*this)))
397 
399  "AcceptedLedger",
400  4,
402  stopwatch(),
403  logs_->journal("TaggedCache"))
404 
406  *this,
407  stopwatch(),
408  config_->standalone(),
409  config_->NETWORK_QUORUM,
410  config_->START_VALID,
411  *m_jobQueue,
414  get_io_service(),
415  logs_->journal("NetworkOPs"),
416  m_collectorManager->collector()))
417 
418  , cluster_(std::make_unique<Cluster>(logs_->journal("Overlay")))
419 
420  , peerReservations_(std::make_unique<PeerReservationTable>(
421  logs_->journal("PeerReservationTable")))
422 
424  std::make_unique<ManifestCache>(logs_->journal("ManifestCache")))
425 
427  std::make_unique<ManifestCache>(logs_->journal("ManifestCache")))
428 
429  , validators_(std::make_unique<ValidatorList>(
432  *timeKeeper_,
433  config_->legacy("database_path"),
434  logs_->journal("ValidatorList"),
435  config_->VALIDATION_QUORUM))
436 
437  , validatorSites_(std::make_unique<ValidatorSite>(*this))
438 
440  *this,
441  get_io_service(),
442  *m_jobQueue,
443  *m_networkOPs,
446 
447  , mFeeTrack(
448  std::make_unique<LoadFeeTrack>(logs_->journal("LoadManager")))
449 
450  , hashRouter_(std::make_unique<HashRouter>(
451  stopwatch(),
453 
454  , mValidations(
455  ValidationParms(),
456  stopwatch(),
457  *this,
458  logs_->journal("Validations"))
459 
460  , m_loadManager(make_LoadManager(*this, logs_->journal("LoadManager")))
461 
462  , txQ_(
463  std::make_unique<TxQ>(setup_TxQ(*config_), logs_->journal("TxQ")))
464 
466 
468 
470 
471  , checkSigs_(true)
472 
473  , m_resolver(
474  ResolverAsio::New(get_io_service(), logs_->journal("Resolver")))
475 
477  m_collectorManager->collector()->make_event("ios_latency"),
478  logs_->journal("Application"),
480  get_io_service())
481  , grpcServer_(std::make_unique<GRPCServer>(*this))
482  , reportingETL_(
483  config_->reporting() ? std::make_unique<ReportingETL>(*this)
484  : nullptr)
485  {
486  add(m_resourceManager.get());
487 
488  //
489  // VFALCO - READ THIS!
490  //
491  // Do not start threads, open sockets, or do any sort of "real work"
492  // inside the constructor. Put it in start instead. Or if you must,
493  // put it in setup (but everything in setup should be moved to start
494  // anyway.
495  //
496  // The reason is that the unit tests require an Application object to
497  // be created. But we don't actually start all the threads, sockets,
498  // and services when running the unit tests. Therefore anything which
499  // needs to be stopped will not get stopped correctly if it is
500  // started in this constructor.
501  //
502 
503  add(ledgerCleaner_.get());
504  }
505 
506  //--------------------------------------------------------------------------
507 
508  bool
509  setup() override;
510  void
511  start(bool withTimers) override;
512  void
513  run() override;
514  void
515  signalStop() override;
516  bool
517  checkSigs() const override;
518  void
519  checkSigs(bool) override;
520  bool
521  isStopping() const override;
522  int
523  fdRequired() const override;
524 
525  //--------------------------------------------------------------------------
526 
527  Logs&
528  logs() override
529  {
530  return *logs_;
531  }
532 
533  Config&
534  config() override
535  {
536  return *config_;
537  }
538 
541  {
542  return *m_collectorManager;
543  }
544 
545  Family&
546  getNodeFamily() override
547  {
548  return nodeFamily_;
549  }
550 
551  // The shard store is an optional feature. If the sever is configured for
552  // shards, this function will return a valid pointer, otherwise a nullptr.
553  Family*
554  getShardFamily() override
555  {
556  return shardFamily_.get();
557  }
558 
559  TimeKeeper&
560  timeKeeper() override
561  {
562  return *timeKeeper_;
563  }
564 
565  JobQueue&
566  getJobQueue() override
567  {
568  return *m_jobQueue;
569  }
570 
572  nodeIdentity() override
573  {
574  return nodeIdentity_;
575  }
576 
577  PublicKey const&
578  getValidationPublicKey() const override
579  {
580  return validatorKeys_.publicKey;
581  }
582 
583  NetworkOPs&
584  getOPs() override
585  {
586  return *m_networkOPs;
587  }
588 
589  boost::asio::io_service&
590  getIOService() override
591  {
592  return get_io_service();
593  }
594 
596  getIOLatency() override
597  {
598  return m_io_latency_sampler.get();
599  }
600 
601  LedgerMaster&
602  getLedgerMaster() override
603  {
604  return *m_ledgerMaster;
605  }
606 
608  getLedgerCleaner() override
609  {
610  return *ledgerCleaner_;
611  }
612 
614  getLedgerReplayer() override
615  {
616  return *m_ledgerReplayer;
617  }
618 
620  getInboundLedgers() override
621  {
622  return *m_inboundLedgers;
623  }
624 
627  {
628  return *m_inboundTransactions;
629  }
630 
633  {
634  return m_acceptedLedgerCache;
635  }
636 
637  void
638  gotTXSet(std::shared_ptr<SHAMap> const& set, bool fromAcquire)
639  {
640  if (set)
641  m_networkOPs->mapComplete(set, fromAcquire);
642  }
643 
646  {
647  return m_txMaster;
648  }
649 
651  getPerfLog() override
652  {
653  return *perfLog_;
654  }
655 
656  NodeCache&
657  getTempNodeCache() override
658  {
659  return m_tempNodeCache;
660  }
661 
663  getNodeStore() override
664  {
665  return *m_nodeStore;
666  }
667 
668  // The shard store is an optional feature. If the sever is configured for
669  // shards, this function will return a valid pointer, otherwise a nullptr.
671  getShardStore() override
672  {
673  return shardStore_.get();
674  }
675 
677  getShardArchiveHandler(bool tryRecovery) override
678  {
679  static std::mutex handlerMutex;
680  std::lock_guard lock(handlerMutex);
681 
682  // After constructing the handler, try to
683  // initialize it. Log on error; set the
684  // member variable on success.
685  auto initAndSet =
687  if (!handler)
688  return false;
689 
690  if (!handler->init())
691  {
692  JLOG(m_journal.error())
693  << "Failed to initialize ShardArchiveHandler.";
694 
695  return false;
696  }
697 
698  shardArchiveHandler_ = std::move(handler);
699  return true;
700  };
701 
702  // Need to resume based on state from a previous
703  // run.
704  if (tryRecovery)
705  {
706  if (shardArchiveHandler_ != nullptr)
707  {
708  JLOG(m_journal.error())
709  << "ShardArchiveHandler already created at startup.";
710 
711  return nullptr;
712  }
713 
714  auto handler =
716 
717  if (!initAndSet(std::move(handler)))
718  return nullptr;
719  }
720 
721  // Construct the ShardArchiveHandler
722  if (shardArchiveHandler_ == nullptr)
723  {
724  auto handler =
726 
727  if (!initAndSet(std::move(handler)))
728  return nullptr;
729  }
730 
731  return shardArchiveHandler_.get();
732  }
733 
735  getMasterMutex() override
736  {
737  return m_masterMutex;
738  }
739 
740  LoadManager&
741  getLoadManager() override
742  {
743  return *m_loadManager;
744  }
745 
748  {
749  return *m_resourceManager;
750  }
751 
752  OrderBookDB&
753  getOrderBookDB() override
754  {
755  return m_orderBookDB;
756  }
757 
758  PathRequests&
759  getPathRequests() override
760  {
761  return *m_pathRequests;
762  }
763 
764  CachedSLEs&
765  cachedSLEs() override
766  {
767  return cachedSLEs_;
768  }
769 
771  getAmendmentTable() override
772  {
773  return *m_amendmentTable;
774  }
775 
776  LoadFeeTrack&
777  getFeeTrack() override
778  {
779  return *mFeeTrack;
780  }
781 
782  HashRouter&
783  getHashRouter() override
784  {
785  return *hashRouter_;
786  }
787 
789  getValidations() override
790  {
791  return mValidations;
792  }
793 
795  validators() override
796  {
797  return *validators_;
798  }
799 
801  validatorSites() override
802  {
803  return *validatorSites_;
804  }
805 
808  {
809  return *validatorManifests_;
810  }
811 
814  {
815  return *publisherManifests_;
816  }
817 
818  Cluster&
819  cluster() override
820  {
821  return *cluster_;
822  }
823 
825  peerReservations() override
826  {
827  return *peerReservations_;
828  }
829 
830  SHAMapStore&
831  getSHAMapStore() override
832  {
833  return *m_shaMapStore;
834  }
835 
836  PendingSaves&
837  pendingSaves() override
838  {
839  return pendingSaves_;
840  }
841 
842  AccountIDCache const&
843  accountIDCache() const override
844  {
845  return accountIDCache_;
846  }
847 
848  OpenLedger&
849  openLedger() override
850  {
851  if (config_->reporting())
852  Throw<ReportingShouldProxy>();
853  return *openLedger_;
854  }
855 
856  OpenLedger const&
857  openLedger() const override
858  {
859  if (config_->reporting())
860  Throw<ReportingShouldProxy>();
861  return *openLedger_;
862  }
863 
864  Overlay&
865  overlay() override
866  {
867  assert(overlay_);
868  return *overlay_;
869  }
870 
871  TxQ&
872  getTxQ() override
873  {
874  assert(txQ_.get() != nullptr);
875  return *txQ_;
876  }
877 
880  {
881  assert(mRelationalDBInterface.get() != nullptr);
882  return *mRelationalDBInterface;
883  }
884 
885  DatabaseCon&
886  getWalletDB() override
887  {
888  assert(mWalletDB.get() != nullptr);
889  return *mWalletDB;
890  }
891 
892  ReportingETL&
893  getReportingETL() override
894  {
895  assert(reportingETL_.get() != nullptr);
896  return *reportingETL_;
897  }
898 
899  bool
900  serverOkay(std::string& reason) override;
901 
903  journal(std::string const& name) override;
904 
905  //--------------------------------------------------------------------------
906 
907  bool
909  {
910  assert(mWalletDB.get() == nullptr);
911 
912  try
913  {
916 
917  // wallet database
919  setup.useGlobalPragma = false;
920 
922  }
923  catch (std::exception const& e)
924  {
925  JLOG(m_journal.fatal())
926  << "Failed to initialize SQL databases: " << e.what();
927  return false;
928  }
929 
930  return true;
931  }
932 
933  bool
935  {
936  if (config_->doImport)
937  {
938  auto j = logs_->journal("NodeObject");
939  NodeStore::DummyScheduler dummyScheduler;
942  megabytes(config_->getValueFor(
943  SizedItem::burstSize, std::nullopt)),
944  dummyScheduler,
945  0,
947  j);
948 
949  JLOG(j.warn()) << "Starting node import from '" << source->getName()
950  << "' to '" << m_nodeStore->getName() << "'.";
951 
952  using namespace std::chrono;
953  auto const start = steady_clock::now();
954 
955  m_nodeStore->importDatabase(*source);
956 
957  auto const elapsed =
958  duration_cast<seconds>(steady_clock::now() - start);
959  JLOG(j.warn()) << "Node import from '" << source->getName()
960  << "' took " << elapsed.count() << " seconds.";
961  }
962 
963  // tune caches
964  using namespace std::chrono;
965 
966  m_ledgerMaster->tune(
967  config_->getValueFor(SizedItem::ledgerSize),
968  seconds{config_->getValueFor(SizedItem::ledgerAge)});
969 
970  return true;
971  }
972 
973  //--------------------------------------------------------------------------
974 
975  // Called to indicate shutdown.
976  void
978  {
979  JLOG(m_journal.debug()) << "Application stopping";
980 
982 
983  // VFALCO Enormous hack, we have to force the probe to cancel
984  // before we stop the io_service queue or else it never
985  // unblocks in its destructor. The fix is to make all
986  // io_objects gracefully handle exit so that we can
987  // naturally return from io_service::run() instead of
988  // forcing a call to io_service::stop()
990 
991  m_resolver->stop_async();
992 
993  // NIKB This is a hack - we need to wait for the resolver to
994  // stop. before we stop the io_server_queue or weird
995  // things will happen.
996  m_resolver->stop();
997 
998  {
999  boost::system::error_code ec;
1000  sweepTimer_.cancel(ec);
1001  if (ec)
1002  {
1003  JLOG(m_journal.error())
1004  << "Application: sweepTimer cancel error: " << ec.message();
1005  }
1006 
1007  ec.clear();
1008  entropyTimer_.cancel(ec);
1009  if (ec)
1010  {
1011  JLOG(m_journal.error())
1012  << "Application: entropyTimer cancel error: "
1013  << ec.message();
1014  }
1015  }
1016  // Make sure that any waitHandlers pending in our timers are done
1017  // before we declare ourselves stopped.
1018  using namespace std::chrono_literals;
1019  waitHandlerCounter_.join("Application", 1s, m_journal);
1020 
1021  mValidations.flush();
1022 
1023  validatorSites_->stop();
1024 
1025  // TODO Store manifests in manifests.sqlite instead of wallet.db
1026  validatorManifests_->save(
1027  getWalletDB(),
1028  "ValidatorManifests",
1029  [this](PublicKey const& pubKey) {
1030  return validators().listed(pubKey);
1031  });
1032 
1033  publisherManifests_->save(
1034  getWalletDB(),
1035  "PublisherManifests",
1036  [this](PublicKey const& pubKey) {
1037  return validators().trustedPublisher(pubKey);
1038  });
1039 
1040  // The order of these stop calls is delicate.
1041  // Re-ordering them risks undefined behavior.
1042  m_loadManager->stop();
1043  m_shaMapStore->stop();
1044  m_jobQueue->stop();
1046  shardArchiveHandler_->stop();
1047  if (overlay_)
1048  overlay_->stop();
1049  if (shardStore_)
1050  shardStore_->stop();
1051  grpcServer_->stop();
1052  m_networkOPs->stop();
1053  serverHandler_->stop();
1054  m_ledgerReplayer->stop();
1055  m_inboundTransactions->stop();
1056  m_inboundLedgers->stop();
1057  ledgerCleaner_->stop();
1058  if (reportingETL_)
1059  reportingETL_->stop();
1060  if (auto pg = dynamic_cast<RelationalDBInterfacePostgres*>(
1062  pg->stop();
1063  m_nodeStore->stop();
1064  perfLog_->stop();
1065  }
1066 
1067  //--------------------------------------------------------------------------
1068  //
1069  // PropertyStream
1070  //
1071 
1072  void
1074  {
1075  }
1076 
1077  //--------------------------------------------------------------------------
1078 
1079  void
1081  {
1082  // Only start the timer if waitHandlerCounter_ is not yet joined.
1083  if (auto optionalCountedHandler = waitHandlerCounter_.wrap(
1084  [this](boost::system::error_code const& e) {
1085  if (e.value() == boost::system::errc::success)
1086  {
1087  m_jobQueue->addJob(
1088  jtSWEEP, "sweep", [this](Job&) { doSweep(); });
1089  }
1090  // Recover as best we can if an unexpected error occurs.
1091  if (e.value() != boost::system::errc::success &&
1092  e.value() != boost::asio::error::operation_aborted)
1093  {
1094  // Try again later and hope for the best.
1095  JLOG(m_journal.error())
1096  << "Sweep timer got error '" << e.message()
1097  << "'. Restarting timer.";
1098  setSweepTimer();
1099  }
1100  }))
1101  {
1102  using namespace std::chrono;
1103  sweepTimer_.expires_from_now(
1104  seconds{config_->SWEEP_INTERVAL.value_or(
1105  config_->getValueFor(SizedItem::sweepInterval))});
1106  sweepTimer_.async_wait(std::move(*optionalCountedHandler));
1107  }
1108  }
1109 
1110  void
1112  {
1113  // Only start the timer if waitHandlerCounter_ is not yet joined.
1114  if (auto optionalCountedHandler = waitHandlerCounter_.wrap(
1115  [this](boost::system::error_code const& e) {
1116  if (e.value() == boost::system::errc::success)
1117  {
1118  crypto_prng().mix_entropy();
1119  setEntropyTimer();
1120  }
1121  // Recover as best we can if an unexpected error occurs.
1122  if (e.value() != boost::system::errc::success &&
1123  e.value() != boost::asio::error::operation_aborted)
1124  {
1125  // Try again later and hope for the best.
1126  JLOG(m_journal.error())
1127  << "Entropy timer got error '" << e.message()
1128  << "'. Restarting timer.";
1129  setEntropyTimer();
1130  }
1131  }))
1132  {
1133  using namespace std::chrono_literals;
1134  entropyTimer_.expires_from_now(5min);
1135  entropyTimer_.async_wait(std::move(*optionalCountedHandler));
1136  }
1137  }
1138 
1139  void
1141  {
1142  if (!config_->standalone() &&
1143  !getRelationalDBInterface().transactionDbHasSpace(*config_))
1144  {
1145  signalStop();
1146  }
1147 
1148  // VFALCO NOTE Does the order of calls matter?
1149  // VFALCO TODO fix the dependency inversion using an observer,
1150  // have listeners register for "onSweep ()" notification.
1151 
1152  nodeFamily_.sweep();
1153  if (shardFamily_)
1154  shardFamily_->sweep();
1156  getNodeStore().sweep();
1157  if (shardStore_)
1158  shardStore_->sweep();
1159  getLedgerMaster().sweep();
1160  getTempNodeCache().sweep();
1164  m_acceptedLedgerCache.sweep();
1165  cachedSLEs_.sweep();
1166 
1167 #ifdef RIPPLED_REPORTING
1168  if (auto pg = dynamic_cast<RelationalDBInterfacePostgres*>(
1170  pg->sweep();
1171 #endif
1172 
1173  // Set timer to do another sweep later.
1174  setSweepTimer();
1175  }
1176 
1177  LedgerIndex
1179  {
1180  return maxDisallowedLedger_;
1181  }
1182 
1183 private:
1184  // For a newly-started validator, this is the greatest persisted ledger
1185  // and new validations must be greater than this.
1187 
1188  bool
1189  nodeToShards();
1190 
1191  void
1193 
1196 
1198  loadLedgerFromFile(std::string const& ledgerID);
1199 
1200  bool
1201  loadOldLedger(std::string const& ledgerID, bool replay, bool isFilename);
1202 
1203  void
1205 };
1206 
1207 //------------------------------------------------------------------------------
1208 
1209 // TODO Break this up into smaller, more digestible initialization segments.
1210 bool
1212 {
1213  // We want to intercept CTRL-C and the standard termination signal SIGTERM
1214  // and terminate the process. This handler will NEVER be invoked twice.
1215  //
1216  // Note that async_wait is "one-shot": for each call, the handler will be
1217  // invoked exactly once, either when one of the registered signals in the
1218  // signal set occurs or the signal set is cancelled. Subsequent signals are
1219  // effectively ignored (technically, they are queued up, waiting for a call
1220  // to async_wait).
1221  m_signals.add(SIGINT);
1222  m_signals.add(SIGTERM);
1223  m_signals.async_wait(
1224  [this](boost::system::error_code const& ec, int signum) {
1225  // Indicates the signal handler has been aborted; do nothing
1226  if (ec == boost::asio::error::operation_aborted)
1227  return;
1228 
1229  JLOG(m_journal.info()) << "Received signal " << signum;
1230 
1231  if (signum == SIGTERM || signum == SIGINT)
1232  signalStop();
1233  });
1234 
1235  auto debug_log = config_->getDebugLogFile();
1236 
1237  if (!debug_log.empty())
1238  {
1239  // Let debug messages go to the file but only WARNING or higher to
1240  // regular output (unless verbose)
1241 
1242  if (!logs_->open(debug_log))
1243  std::cerr << "Can't open log file " << debug_log << '\n';
1244 
1245  using namespace beast::severities;
1246  if (logs_->threshold() > kDebug)
1247  logs_->threshold(kDebug);
1248  }
1249  JLOG(m_journal.info()) << "process starting: "
1251 
1252  if (numberOfThreads(*config_) < 2)
1253  {
1254  JLOG(m_journal.warn()) << "Limited to a single I/O service thread by "
1255  "system configuration.";
1256  }
1257 
1258  // Optionally turn off logging to console.
1259  logs_->silent(config_->silent());
1260 
1261  if (!config_->standalone())
1262  timeKeeper_->run(config_->SNTP_SERVERS);
1263 
1264  if (!initRDBMS() || !initNodeStore())
1265  return false;
1266 
1267  if (shardStore_)
1268  {
1269  shardFamily_ =
1270  std::make_unique<ShardFamily>(*this, *m_collectorManager);
1271 
1272  if (!shardStore_->init())
1273  return false;
1274  }
1275 
1276  if (!peerReservations_->load(getWalletDB()))
1277  {
1278  JLOG(m_journal.fatal()) << "Cannot find peer reservations!";
1279  return false;
1280  }
1281 
1284 
1285  // Configure the amendments the server supports
1286  {
1287  auto const supported = []() {
1288  auto const& amendments = detail::supportedAmendments();
1290  supported.reserve(amendments.size());
1291  for (auto const& [a, vote] : amendments)
1292  {
1293  auto const f = ripple::getRegisteredFeature(a);
1294  assert(f);
1295  if (f)
1296  supported.emplace_back(a, *f, vote);
1297  }
1298  return supported;
1299  }();
1300  Section const& downVoted = config_->section(SECTION_VETO_AMENDMENTS);
1301 
1302  Section const& upVoted = config_->section(SECTION_AMENDMENTS);
1303 
1305  *this,
1306  config().AMENDMENT_MAJORITY_TIME,
1307  supported,
1308  upVoted,
1309  downVoted,
1310  logs_->journal("Amendments"));
1311  }
1312 
1314 
1315  auto const startUp = config_->START_UP;
1316  JLOG(m_journal.debug()) << "startUp: " << startUp;
1317  if (!config_->reporting())
1318  {
1319  if (startUp == Config::FRESH)
1320  {
1321  JLOG(m_journal.info()) << "Starting new Ledger";
1322 
1324  }
1325  else if (
1326  startUp == Config::LOAD || startUp == Config::LOAD_FILE ||
1327  startUp == Config::REPLAY)
1328  {
1329  JLOG(m_journal.info()) << "Loading specified Ledger";
1330 
1331  if (!loadOldLedger(
1332  config_->START_LEDGER,
1333  startUp == Config::REPLAY,
1334  startUp == Config::LOAD_FILE))
1335  {
1336  JLOG(m_journal.error())
1337  << "The specified ledger could not be loaded.";
1338  if (config_->FAST_LOAD)
1339  {
1340  // Fall back to syncing from the network, such as
1341  // when there's no existing data.
1342  if (startUp == Config::NETWORK && !config_->standalone())
1343  m_networkOPs->setNeedNetworkLedger();
1345  }
1346  else
1347  {
1348  return false;
1349  }
1350  }
1351  }
1352  else if (startUp == Config::NETWORK)
1353  {
1354  // This should probably become the default once we have a stable
1355  // network.
1356  if (!config_->standalone())
1357  m_networkOPs->setNeedNetworkLedger();
1358 
1360  }
1361  else
1362  {
1364  }
1365  }
1366 
1367  if (!config().reporting())
1368  m_orderBookDB.setup(getLedgerMaster().getCurrentLedger());
1369 
1370  nodeIdentity_ = getNodeIdentity(*this);
1371 
1372  if (!cluster_->load(config().section(SECTION_CLUSTER_NODES)))
1373  {
1374  JLOG(m_journal.fatal()) << "Invalid entry in cluster configuration.";
1375  return false;
1376  }
1377 
1378  if (!config().reporting())
1379  {
1380  {
1382  return false;
1383 
1384  if (!validatorManifests_->load(
1385  getWalletDB(),
1386  "ValidatorManifests",
1388  config()
1389  .section(SECTION_VALIDATOR_KEY_REVOCATION)
1390  .values()))
1391  {
1392  JLOG(m_journal.fatal())
1393  << "Invalid configured validator manifest.";
1394  return false;
1395  }
1396 
1397  publisherManifests_->load(getWalletDB(), "PublisherManifests");
1398 
1399  // Setup trusted validators
1400  if (!validators_->load(
1402  config().section(SECTION_VALIDATORS).values(),
1403  config().section(SECTION_VALIDATOR_LIST_KEYS).values()))
1404  {
1405  JLOG(m_journal.fatal())
1406  << "Invalid entry in validator configuration.";
1407  return false;
1408  }
1409  }
1410 
1411  if (!validatorSites_->load(
1412  config().section(SECTION_VALIDATOR_LIST_SITES).values()))
1413  {
1414  JLOG(m_journal.fatal())
1415  << "Invalid entry in [" << SECTION_VALIDATOR_LIST_SITES << "]";
1416  return false;
1417  }
1418  }
1419  //----------------------------------------------------------------------
1420  //
1421  // Server
1422  //
1423  //----------------------------------------------------------------------
1424 
1425  // VFALCO NOTE Unfortunately, in stand-alone mode some code still
1426  // foolishly calls overlay(). When this is fixed we can
1427  // move the instantiation inside a conditional:
1428  //
1429  // if (!config_.standalone())
1430  if (!config_->reporting())
1431  {
1433  *this,
1435  *serverHandler_,
1437  *m_resolver,
1438  get_io_service(),
1439  *config_,
1440  m_collectorManager->collector());
1441  add(*overlay_); // add to PropertyStream
1442  }
1443 
1444  if (!config_->standalone())
1445  {
1446  // NodeStore import into the ShardStore requires the SQLite database
1447  if (config_->nodeToShard && !nodeToShards())
1448  return false;
1449  }
1450 
1451  // start first consensus round
1452  if (!config_->reporting() &&
1453  !m_networkOPs->beginConsensus(
1454  m_ledgerMaster->getClosedLedger()->info().hash))
1455  {
1456  JLOG(m_journal.fatal()) << "Unable to start consensus";
1457  return false;
1458  }
1459 
1460  {
1461  try
1462  {
1463  auto setup = setup_ServerHandler(
1465  setup.makeContexts();
1466  serverHandler_->setup(setup, m_journal);
1467  }
1468  catch (std::exception const& e)
1469  {
1470  if (auto stream = m_journal.fatal())
1471  {
1472  stream << "Unable to setup server handler";
1473  if (std::strlen(e.what()) > 0)
1474  stream << ": " << e.what();
1475  }
1476  return false;
1477  }
1478  }
1479 
1480  // Begin connecting to network.
1481  if (!config_->standalone())
1482  {
1483  // Should this message be here, conceptually? In theory this sort
1484  // of message, if displayed, should be displayed from PeerFinder.
1485  if (config_->PEER_PRIVATE && config_->IPS_FIXED.empty())
1486  {
1487  JLOG(m_journal.warn())
1488  << "No outbound peer connections will be made";
1489  }
1490 
1491  // VFALCO NOTE the state timer resets the deadlock detector.
1492  //
1493  m_networkOPs->setStateTimer();
1494  }
1495  else
1496  {
1497  JLOG(m_journal.warn()) << "Running in standalone mode";
1498 
1499  m_networkOPs->setStandAlone();
1500  }
1501 
1502  if (config_->canSign())
1503  {
1504  JLOG(m_journal.warn()) << "*** The server is configured to allow the "
1505  "'sign' and 'sign_for'";
1506  JLOG(m_journal.warn()) << "*** commands. These commands have security "
1507  "implications and have";
1508  JLOG(m_journal.warn()) << "*** been deprecated. They will be removed "
1509  "in a future release of";
1510  JLOG(m_journal.warn()) << "*** rippled.";
1511  JLOG(m_journal.warn()) << "*** If you do not use them to sign "
1512  "transactions please edit your";
1513  JLOG(m_journal.warn())
1514  << "*** configuration file and remove the [enable_signing] stanza.";
1515  JLOG(m_journal.warn()) << "*** If you do use them to sign transactions "
1516  "please migrate to a";
1517  JLOG(m_journal.warn())
1518  << "*** standalone signing solution as soon as possible.";
1519  }
1520 
1521  //
1522  // Execute start up rpc commands.
1523  //
1524  for (auto cmd : config_->section(SECTION_RPC_STARTUP).lines())
1525  {
1526  Json::Reader jrReader;
1527  Json::Value jvCommand;
1528 
1529  if (!jrReader.parse(cmd, jvCommand))
1530  {
1531  JLOG(m_journal.fatal()) << "Couldn't parse entry in ["
1532  << SECTION_RPC_STARTUP << "]: '" << cmd;
1533  }
1534 
1535  if (!config_->quiet())
1536  {
1537  JLOG(m_journal.fatal())
1538  << "Startup RPC: " << jvCommand << std::endl;
1539  }
1540 
1543  RPC::JsonContext context{
1544  {journal("RPCHandler"),
1545  *this,
1546  loadType,
1547  getOPs(),
1548  getLedgerMaster(),
1549  c,
1550  Role::ADMIN,
1551  {},
1552  {},
1554  jvCommand};
1555 
1556  Json::Value jvResult;
1557  RPC::doCommand(context, jvResult);
1558 
1559  if (!config_->quiet())
1560  {
1561  JLOG(m_journal.fatal()) << "Result: " << jvResult << std::endl;
1562  }
1563  }
1564 
1565  RPC::ShardArchiveHandler* shardArchiveHandler = nullptr;
1566  if (shardStore_)
1567  {
1568  try
1569  {
1570  // Create a ShardArchiveHandler if recovery
1571  // is needed (there's a state database left
1572  // over from a previous run).
1573  auto handler = getShardArchiveHandler(true);
1574 
1575  // Recovery is needed.
1576  if (handler)
1577  shardArchiveHandler = handler;
1578  }
1579  catch (std::exception const& e)
1580  {
1581  JLOG(m_journal.fatal())
1582  << "Exception when starting ShardArchiveHandler from "
1583  "state database: "
1584  << e.what();
1585 
1586  return false;
1587  }
1588  }
1589 
1590  if (shardArchiveHandler && !shardArchiveHandler->start())
1591  {
1592  JLOG(m_journal.fatal()) << "Failed to start ShardArchiveHandler.";
1593 
1594  return false;
1595  }
1596 
1597  validatorSites_->start();
1598 
1599  if (reportingETL_)
1600  reportingETL_->start();
1601 
1602  return true;
1603 }
1604 
1605 void
1606 ApplicationImp::start(bool withTimers)
1607 {
1608  JLOG(m_journal.info()) << "Application starting. Version is "
1610 
1611  if (withTimers)
1612  {
1613  setSweepTimer();
1614  setEntropyTimer();
1615  }
1616 
1618  m_resolver->start();
1619  m_loadManager->start();
1620  m_shaMapStore->start();
1621  if (overlay_)
1622  overlay_->start();
1623  grpcServer_->start();
1624  ledgerCleaner_->start();
1625  perfLog_->start();
1626 }
1627 
1628 void
1630 {
1631  if (!config_->standalone())
1632  {
1633  // VFALCO NOTE This seems unnecessary. If we properly refactor the load
1634  // manager then the deadlock detector can just always be
1635  // "armed"
1636  //
1638  }
1639 
1640  {
1642  cv_.wait(lk, [this] { return isTimeToStop; });
1643  }
1644 
1645  JLOG(m_journal.info()) << "Received shutdown request";
1646  stop();
1647  JLOG(m_journal.info()) << "Done.";
1648 }
1649 
1650 void
1652 {
1653  // Unblock the main thread (which is sitting in run()).
1654  // When we get C++20 this can use std::latch.
1655  std::lock_guard lk{mut_};
1656 
1657  if (!isTimeToStop)
1658  {
1659  isTimeToStop = true;
1660  cv_.notify_all();
1661  }
1662 }
1663 
1664 bool
1666 {
1667  return checkSigs_;
1668 }
1669 
1670 void
1672 {
1673  checkSigs_ = check;
1674 }
1675 
1676 bool
1678 {
1679  std::lock_guard lk{mut_};
1680  return isTimeToStop;
1681 }
1682 
1683 int
1685 {
1686  // Standard handles, config file, misc I/O etc:
1687  int needed = 128;
1688 
1689  // 2x the configured peer limit for peer connections:
1690  if (overlay_)
1691  needed += 2 * overlay_->limit();
1692 
1693  // the number of fds needed by the backend (internally
1694  // doubled if online delete is enabled).
1695  needed += std::max(5, m_shaMapStore->fdRequired());
1696 
1697  if (shardStore_)
1698  needed += shardStore_->fdRequired();
1699 
1700  // One fd per incoming connection a port can accept, or
1701  // if no limit is set, assume it'll handle 256 clients.
1702  for (auto const& p : serverHandler_->setup().ports)
1703  needed += std::max(256, p.limit);
1704 
1705  // The minimum number of file descriptors we need is 1024:
1706  return std::max(1024, needed);
1707 }
1708 
1709 //------------------------------------------------------------------------------
1710 
1711 void
1713 {
1714  std::vector<uint256> initialAmendments =
1715  (config_->START_UP == Config::FRESH) ? m_amendmentTable->getDesired()
1717 
1718  std::shared_ptr<Ledger> const genesis = std::make_shared<Ledger>(
1719  create_genesis, *config_, initialAmendments, nodeFamily_);
1720  m_ledgerMaster->storeLedger(genesis);
1721 
1722  auto const next =
1723  std::make_shared<Ledger>(*genesis, timeKeeper().closeTime());
1724  next->updateSkipList();
1725  next->setImmutable(*config_);
1726  openLedger_.emplace(next, cachedSLEs_, logs_->journal("OpenLedger"));
1727  m_ledgerMaster->storeLedger(next);
1728  m_ledgerMaster->switchLCL(next);
1729 }
1730 
1733 {
1734  auto j = journal("Ledger");
1735 
1736  try
1737  {
1738  auto const [ledger, seq, hash] = getLatestLedger(*this);
1739 
1740  if (!ledger)
1741  return ledger;
1742 
1743  ledger->setImmutable(*config_);
1744 
1745  if (getLedgerMaster().haveLedger(seq))
1746  ledger->setValidated();
1747 
1748  if (ledger->info().hash == hash)
1749  {
1750  JLOG(j.trace()) << "Loaded ledger: " << hash;
1751  return ledger;
1752  }
1753 
1754  if (auto stream = j.error())
1755  {
1756  stream << "Failed on ledger";
1757  Json::Value p;
1758  addJson(p, {*ledger, nullptr, LedgerFill::full});
1759  stream << p;
1760  }
1761 
1762  return {};
1763  }
1764  catch (SHAMapMissingNode const& mn)
1765  {
1766  JLOG(j.warn()) << "Ledger in database: " << mn.what();
1767  return {};
1768  }
1769 }
1770 
1773 {
1774  try
1775  {
1776  std::ifstream ledgerFile(name, std::ios::in);
1777 
1778  if (!ledgerFile)
1779  {
1780  JLOG(m_journal.fatal()) << "Unable to open file '" << name << "'";
1781  return nullptr;
1782  }
1783 
1784  Json::Reader reader;
1785  Json::Value jLedger;
1786 
1787  if (!reader.parse(ledgerFile, jLedger))
1788  {
1789  JLOG(m_journal.fatal()) << "Unable to parse ledger JSON";
1790  return nullptr;
1791  }
1792 
1793  std::reference_wrapper<Json::Value> ledger(jLedger);
1794 
1795  // accept a wrapped ledger
1796  if (ledger.get().isMember("result"))
1797  ledger = ledger.get()["result"];
1798 
1799  if (ledger.get().isMember("ledger"))
1800  ledger = ledger.get()["ledger"];
1801 
1802  std::uint32_t seq = 1;
1803  auto closeTime = timeKeeper().closeTime();
1804  using namespace std::chrono_literals;
1805  auto closeTimeResolution = 30s;
1806  bool closeTimeEstimated = false;
1807  std::uint64_t totalDrops = 0;
1808 
1809  if (ledger.get().isMember("accountState"))
1810  {
1811  if (ledger.get().isMember(jss::ledger_index))
1812  {
1813  seq = ledger.get()[jss::ledger_index].asUInt();
1814  }
1815 
1816  if (ledger.get().isMember("close_time"))
1817  {
1818  using tp = NetClock::time_point;
1819  using d = tp::duration;
1820  closeTime = tp{d{ledger.get()["close_time"].asUInt()}};
1821  }
1822  if (ledger.get().isMember("close_time_resolution"))
1823  {
1824  using namespace std::chrono;
1825  closeTimeResolution =
1826  seconds{ledger.get()["close_time_resolution"].asUInt()};
1827  }
1828  if (ledger.get().isMember("close_time_estimated"))
1829  {
1830  closeTimeEstimated =
1831  ledger.get()["close_time_estimated"].asBool();
1832  }
1833  if (ledger.get().isMember("total_coins"))
1834  {
1835  totalDrops = beast::lexicalCastThrow<std::uint64_t>(
1836  ledger.get()["total_coins"].asString());
1837  }
1838 
1839  ledger = ledger.get()["accountState"];
1840  }
1841 
1842  if (!ledger.get().isArrayOrNull())
1843  {
1844  JLOG(m_journal.fatal()) << "State nodes must be an array";
1845  return nullptr;
1846  }
1847 
1848  auto loadLedger =
1849  std::make_shared<Ledger>(seq, closeTime, *config_, nodeFamily_);
1850  loadLedger->setTotalDrops(totalDrops);
1851 
1852  for (Json::UInt index = 0; index < ledger.get().size(); ++index)
1853  {
1854  Json::Value& entry = ledger.get()[index];
1855 
1856  if (!entry.isObjectOrNull())
1857  {
1858  JLOG(m_journal.fatal()) << "Invalid entry in ledger";
1859  return nullptr;
1860  }
1861 
1862  uint256 uIndex;
1863 
1864  if (!uIndex.parseHex(entry[jss::index].asString()))
1865  {
1866  JLOG(m_journal.fatal()) << "Invalid entry in ledger";
1867  return nullptr;
1868  }
1869 
1870  entry.removeMember(jss::index);
1871 
1872  STParsedJSONObject stp("sle", ledger.get()[index]);
1873 
1874  if (!stp.object || uIndex.isZero())
1875  {
1876  JLOG(m_journal.fatal()) << "Invalid entry in ledger";
1877  return nullptr;
1878  }
1879 
1880  // VFALCO TODO This is the only place that
1881  // constructor is used, try to remove it
1882  STLedgerEntry sle(*stp.object, uIndex);
1883 
1884  if (!loadLedger->addSLE(sle))
1885  {
1886  JLOG(m_journal.fatal())
1887  << "Couldn't add serialized ledger: " << uIndex;
1888  return nullptr;
1889  }
1890  }
1891 
1892  loadLedger->stateMap().flushDirty(hotACCOUNT_NODE);
1893 
1894  loadLedger->setAccepted(
1895  closeTime, closeTimeResolution, !closeTimeEstimated, *config_);
1896 
1897  return loadLedger;
1898  }
1899  catch (std::exception const& x)
1900  {
1901  JLOG(m_journal.fatal()) << "Ledger contains invalid data: " << x.what();
1902  return nullptr;
1903  }
1904 }
1905 
1906 bool
1908  std::string const& ledgerID,
1909  bool replay,
1910  bool isFileName)
1911 {
1912  try
1913  {
1914  std::shared_ptr<Ledger const> loadLedger, replayLedger;
1915 
1916  if (isFileName)
1917  {
1918  if (!ledgerID.empty())
1919  loadLedger = loadLedgerFromFile(ledgerID);
1920  }
1921  else if (ledgerID.length() == 64)
1922  {
1923  uint256 hash;
1924 
1925  if (hash.parseHex(ledgerID))
1926  {
1927  loadLedger = loadByHash(hash, *this);
1928 
1929  if (!loadLedger)
1930  {
1931  // Try to build the ledger from the back end
1932  auto il = std::make_shared<InboundLedger>(
1933  *this,
1934  hash,
1935  0,
1937  stopwatch(),
1938  make_DummyPeerSet(*this));
1939  if (il->checkLocal())
1940  loadLedger = il->getLedger();
1941  }
1942  }
1943  }
1944  else if (ledgerID.empty() || boost::iequals(ledgerID, "latest"))
1945  {
1946  loadLedger = getLastFullLedger();
1947  }
1948  else
1949  {
1950  // assume by sequence
1951  std::uint32_t index;
1952 
1953  if (beast::lexicalCastChecked(index, ledgerID))
1954  loadLedger = loadByIndex(index, *this);
1955  }
1956 
1957  if (!loadLedger)
1958  return false;
1959 
1960  if (replay)
1961  {
1962  // Replay a ledger close with same prior ledger and transactions
1963 
1964  // this ledger holds the transactions we want to replay
1965  replayLedger = loadLedger;
1966 
1967  JLOG(m_journal.info()) << "Loading parent ledger";
1968 
1969  loadLedger = loadByHash(replayLedger->info().parentHash, *this);
1970  if (!loadLedger)
1971  {
1972  JLOG(m_journal.info())
1973  << "Loading parent ledger from node store";
1974 
1975  // Try to build the ledger from the back end
1976  auto il = std::make_shared<InboundLedger>(
1977  *this,
1978  replayLedger->info().parentHash,
1979  0,
1981  stopwatch(),
1982  make_DummyPeerSet(*this));
1983 
1984  if (il->checkLocal())
1985  loadLedger = il->getLedger();
1986 
1987  if (!loadLedger)
1988  {
1989  JLOG(m_journal.fatal()) << "Replay ledger missing/damaged";
1990  assert(false);
1991  return false;
1992  }
1993  }
1994  }
1995  using namespace std::chrono_literals;
1996  using namespace date;
1997  static constexpr NetClock::time_point ledgerWarnTimePoint{
1998  sys_days{January / 1 / 2018} - sys_days{January / 1 / 2000}};
1999  if (loadLedger->info().closeTime < ledgerWarnTimePoint)
2000  {
2001  JLOG(m_journal.fatal())
2002  << "\n\n*** WARNING ***\n"
2003  "You are replaying a ledger from before "
2004  << to_string(ledgerWarnTimePoint)
2005  << " UTC.\n"
2006  "This replay will not handle your ledger as it was "
2007  "originally "
2008  "handled.\nConsider running an earlier version of rippled "
2009  "to "
2010  "get the older rules.\n*** CONTINUING ***\n";
2011  }
2012 
2013  JLOG(m_journal.info()) << "Loading ledger " << loadLedger->info().hash
2014  << " seq:" << loadLedger->info().seq;
2015 
2016  if (loadLedger->info().accountHash.isZero())
2017  {
2018  JLOG(m_journal.fatal()) << "Ledger is empty.";
2019  assert(false);
2020  return false;
2021  }
2022 
2023  if (!loadLedger->walkLedger(journal("Ledger"), true))
2024  {
2025  JLOG(m_journal.fatal()) << "Ledger is missing nodes.";
2026  assert(false);
2027  return false;
2028  }
2029 
2030  if (!loadLedger->assertSensible(journal("Ledger")))
2031  {
2032  JLOG(m_journal.fatal()) << "Ledger is not sensible.";
2033  assert(false);
2034  return false;
2035  }
2036 
2037  m_ledgerMaster->setLedgerRangePresent(
2038  loadLedger->info().seq, loadLedger->info().seq);
2039 
2040  m_ledgerMaster->switchLCL(loadLedger);
2041  loadLedger->setValidated();
2042  m_ledgerMaster->setFullLedger(loadLedger, true, false);
2043  openLedger_.emplace(
2044  loadLedger, cachedSLEs_, logs_->journal("OpenLedger"));
2045 
2046  if (replay)
2047  {
2048  // inject transaction(s) from the replayLedger into our open ledger
2049  // and build replay structure
2050  auto replayData =
2051  std::make_unique<LedgerReplay>(loadLedger, replayLedger);
2052 
2053  for (auto const& [_, tx] : replayData->orderedTxns())
2054  {
2055  (void)_;
2056  auto txID = tx->getTransactionID();
2057 
2058  auto s = std::make_shared<Serializer>();
2059  tx->add(*s);
2060 
2062 
2063  openLedger_->modify(
2064  [&txID, &s](OpenView& view, beast::Journal j) {
2065  view.rawTxInsert(txID, std::move(s), nullptr);
2066  return true;
2067  });
2068  }
2069 
2070  m_ledgerMaster->takeReplay(std::move(replayData));
2071  }
2072  }
2073  catch (SHAMapMissingNode const& mn)
2074  {
2075  JLOG(m_journal.fatal())
2076  << "While loading specified ledger: " << mn.what();
2077  return false;
2078  }
2079  catch (boost::bad_lexical_cast&)
2080  {
2081  JLOG(m_journal.fatal())
2082  << "Ledger specified '" << ledgerID << "' is not valid";
2083  return false;
2084  }
2085 
2086  return true;
2087 }
2088 
2089 bool
2091 {
2092  if (!config().ELB_SUPPORT)
2093  return true;
2094 
2095  if (isStopping())
2096  {
2097  reason = "Server is shutting down";
2098  return false;
2099  }
2100 
2101  if (getOPs().isNeedNetworkLedger())
2102  {
2103  reason = "Not synchronized with network yet";
2104  return false;
2105  }
2106 
2107  if (getOPs().isAmendmentBlocked())
2108  {
2109  reason = "Server version too old";
2110  return false;
2111  }
2112 
2113  if (getOPs().isUNLBlocked())
2114  {
2115  reason = "No valid validator list available";
2116  return false;
2117  }
2118 
2119  if (getOPs().getOperatingMode() < OperatingMode::SYNCING)
2120  {
2121  reason = "Not synchronized with network";
2122  return false;
2123  }
2124 
2125  if (!getLedgerMaster().isCaughtUp(reason))
2126  return false;
2127 
2128  if (getFeeTrack().isLoadedLocal())
2129  {
2130  reason = "Too much load";
2131  return false;
2132  }
2133 
2134  return true;
2135 }
2136 
2139 {
2140  return logs_->journal(name);
2141 }
2142 
2143 bool
2145 {
2146  assert(overlay_);
2147  assert(!config_->standalone());
2148 
2149  if (config_->section(ConfigSection::shardDatabase()).empty())
2150  {
2151  JLOG(m_journal.fatal())
2152  << "The [shard_db] configuration setting must be set";
2153  return false;
2154  }
2155  if (!shardStore_)
2156  {
2157  JLOG(m_journal.fatal()) << "Invalid [shard_db] configuration";
2158  return false;
2159  }
2160  shardStore_->importDatabase(getNodeStore());
2161  return true;
2162 }
2163 
2164 void
2166 {
2168  if (seq)
2169  maxDisallowedLedger_ = *seq;
2170 
2171  JLOG(m_journal.trace())
2172  << "Max persisted ledger is " << maxDisallowedLedger_;
2173 }
2174 
2175 //------------------------------------------------------------------------------
2176 
2177 Application::Application() : beast::PropertyStream::Source("app")
2178 {
2179 }
2180 
2181 //------------------------------------------------------------------------------
2182 
2185  std::unique_ptr<Config> config,
2186  std::unique_ptr<Logs> logs,
2187  std::unique_ptr<TimeKeeper> timeKeeper)
2188 {
2189  return std::make_unique<ApplicationImp>(
2190  std::move(config), std::move(logs), std::move(timeKeeper));
2191 }
2192 
2193 } // namespace ripple
ripple::NodeStoreScheduler
A NodeStore::Scheduler which uses the JobQueue.
Definition: NodeStoreScheduler.h:30
beast::PropertyStream::Source::name
std::string const & name() const
Returns the name of this source.
Definition: beast_PropertyStream.cpp:190
ripple::ApplicationImp::m_resourceManager
std::unique_ptr< Resource::Manager > m_resourceManager
Definition: Application.cpp:188
ripple::ValidatorKeys::publicKey
PublicKey publicKey
Definition: ValidatorKeys.h:40
beast::Journal::fatal
Stream fatal() const
Definition: Journal.h:339
ripple::setup_TxQ
TxQ::Setup setup_TxQ(Config const &config)
Build a TxQ::Setup object from application configuration.
Definition: TxQ.cpp:1823
ripple::ApplicationImp::getReportingETL
ReportingETL & getReportingETL() override
Definition: Application.cpp:893
ripple::NodeStore::DummyScheduler
Simple NodeStore Scheduler that just peforms the tasks synchronously.
Definition: DummyScheduler.h:29
ripple::ApplicationImp::getValidationPublicKey
PublicKey const & getValidationPublicKey() const override
Definition: Application.cpp:578
ripple::ApplicationImp::m_tempNodeCache
NodeCache m_tempNodeCache
Definition: Application.cpp:183
ripple::Section
Holds a collection of configuration values.
Definition: BasicConfig.h:42
ripple::NetworkOPs
Provides server functionality for clients.
Definition: NetworkOPs.h:86
ripple::ApplicationImp::openLedger_
std::optional< OpenLedger > openLedger_
Definition: Application.cpp:181
ripple::getNodeIdentity
std::pair< PublicKey, SecretKey > getNodeIdentity(Application &app)
The cryptographic credentials identifying this server instance.
Definition: NodeIdentity.cpp:32
ripple::ApplicationImp::m_ledgerReplayer
std::unique_ptr< LedgerReplayer > m_ledgerReplayer
Definition: Application.cpp:202
ripple::ApplicationImp::shardStore_
std::unique_ptr< NodeStore::DatabaseShard > shardStore_
Definition: Application.cpp:192
ripple::make_DummyPeerSet
std::unique_ptr< PeerSet > make_DummyPeerSet(Application &app)
Make a dummy PeerSet that does not do anything.
Definition: PeerSet.cpp:187
ripple::Application
Definition: Application.h:115
sstream
ripple::RPC::JsonContext
Definition: Context.h:53
ripple::ApplicationImp::ledgerCleaner_
std::unique_ptr< LedgerCleaner > ledgerCleaner_
Definition: Application.cpp:199
ripple::LoadManager::activateDeadlockDetector
void activateDeadlockDetector()
Turn on deadlock detection.
Definition: LoadManager.cpp:55
ripple::ApplicationImp::m_inboundTransactions
std::unique_ptr< InboundTransactions > m_inboundTransactions
Definition: Application.cpp:201
ripple::NodeStore::make_ShardStore
std::unique_ptr< DatabaseShard > make_ShardStore(Application &app, Scheduler &scheduler, int readThreads, beast::Journal j)
Definition: DatabaseShardImp.cpp:2231
ripple::NodeFamily::sweep
void sweep() override
Definition: NodeFamily.cpp:49
ripple::ApplicationImp::getShardFamily
Family * getShardFamily() override
Definition: Application.cpp:554
ripple::LoadManager
Manages load sources.
Definition: LoadManager.h:45
ripple::ApplicationImp::validators
ValidatorList & validators() override
Definition: Application.cpp:795
ripple::TaggedCache::sweep
void sweep()
Definition: TaggedCache.h:200
std::strlen
T strlen(T... args)
ripple::STLedgerEntry
Definition: STLedgerEntry.h:30
ripple::NodeStore::Database
Persistency layer for NodeObject.
Definition: Database.h:51
ripple::RPC::ShardArchiveHandler::makeShardArchiveHandler
static std::unique_ptr< ShardArchiveHandler > makeShardArchiveHandler(Application &app)
Definition: ShardArchiveHandler.cpp:49
std::string
STL class.
ripple::ApplicationImp::cachedSLEs
CachedSLEs & cachedSLEs() override
Definition: Application.cpp:765
std::shared_ptr
STL class.
ripple::ApplicationImp::getNodeStore
NodeStore::Database & getNodeStore() override
Definition: Application.cpp:663
ripple::RPC::ShardArchiveHandler::start
bool start()
Starts downloading and importing archives.
Definition: ShardArchiveHandler.cpp:235
ripple::TaggedCache< SHAMapHash, Blob >
ripple::ApplicationImp::serverOkay
bool serverOkay(std::string &reason) override
Definition: Application.cpp:2090
ripple::loadByIndex
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition: Ledger.cpp:1064
utility
ripple::LedgerMaster::sweep
void sweep()
Definition: LedgerMaster.cpp:1839
ripple::ApplicationImp::mValidations
RCLValidations mValidations
Definition: Application.cpp:215
ripple::TransactionMaster::sweep
void sweep(void)
Definition: TransactionMaster.cpp:156
std::exception
STL class.
ripple::ApplicationImp::getAcceptedLedgerCache
TaggedCache< uint256, AcceptedLedger > & getAcceptedLedgerCache() override
Definition: Application.cpp:632
ripple::make_Overlay
std::unique_ptr< Overlay > make_Overlay(Application &app, Overlay::Setup const &setup, ServerHandler &serverHandler, Resource::Manager &resourceManager, Resolver &resolver, boost::asio::io_service &io_service, BasicConfig const &config, beast::insight::Collector::ptr const &collector)
Creates the implementation of Overlay.
Definition: OverlayImpl.cpp:1642
cstring
ripple::ApplicationImp::getHashRouter
HashRouter & getHashRouter() override
Definition: Application.cpp:783
beast::Journal::trace
Stream trace() const
Severity stream access functions.
Definition: Journal.h:309
beast::PropertyStream::Map
Definition: PropertyStream.h:236
ripple::ApplicationImp::validatorSites_
std::unique_ptr< ValidatorSite > validatorSites_
Definition: Application.cpp:210
ripple::ApplicationImp::mWalletDB
std::unique_ptr< DatabaseCon > mWalletDB
Definition: Application.cpp:223
ripple::ApplicationImp::getPathRequests
PathRequests & getPathRequests() override
Definition: Application.cpp:759
ripple::ApplicationImp::m_orderBookDB
OrderBookDB m_orderBookDB
Definition: Application.cpp:196
ripple::ApplicationImp::stop
void stop()
Definition: Application.cpp:977
ripple::make_LoadManager
std::unique_ptr< LoadManager > make_LoadManager(Application &app, beast::Journal journal)
Definition: LoadManager.cpp:197
ripple::TransactionMaster
Definition: TransactionMaster.h:36
ripple::ValidatorSite
Definition: ValidatorSite.h:69
std::pair
ripple::ApplicationImp::onWrite
void onWrite(beast::PropertyStream::Map &stream) override
Subclass override.
Definition: Application.cpp:1073
ripple::LedgerMaster
Definition: LedgerMaster.h:70
ripple::ApplicationImp::mRelationalDBInterface
std::unique_ptr< RelationalDBInterface > mRelationalDBInterface
Definition: Application.cpp:222
ripple::ApplicationImp::getInboundLedgers
InboundLedgers & getInboundLedgers() override
Definition: Application.cpp:620
ripple::ApplicationImp::accountIDCache
AccountIDCache const & accountIDCache() const override
Definition: Application.cpp:843
ripple::OpenView
Writable ledger view that accumulates state and tx changes.
Definition: OpenView.h:55
ripple::ApplicationImp::io_latency_sampler::cancel_async
void cancel_async()
Definition: Application.cpp:157
Json::UInt
unsigned int UInt
Definition: json_forwards.h:27
ripple::hotACCOUNT_NODE
@ hotACCOUNT_NODE
Definition: NodeObject.h:35
ripple::setup_DatabaseCon
DatabaseCon::Setup setup_DatabaseCon(Config const &c, std::optional< beast::Journal > j=std::nullopt)
Definition: DatabaseCon.cpp:106
ripple::ApplicationImp::getLedgerReplayer
LedgerReplayer & getLedgerReplayer() override
Definition: Application.cpp:614
ripple::InboundLedger::Reason::GENERIC
@ GENERIC
std::vector
STL class.
ripple::ConfigSection::shardDatabase
static std::string shardDatabase()
Definition: ConfigSections.h:38
std::string::length
T length(T... args)
ripple::ValidatorList::trustedPublisher
bool trustedPublisher(PublicKey const &identity) const
Returns true if public key is a trusted publisher.
Definition: ValidatorList.cpp:1404
ripple::ApplicationImp::waitHandlerCounter_
ClosureCounter< void, boost::system::error_code const & > waitHandlerCounter_
Definition: Application.cpp:218
ripple::ApplicationImp::getOPs
NetworkOPs & getOPs() override
Definition: Application.cpp:584
ripple::ApplicationImp::run
void run() override
Definition: Application.cpp:1629
ripple::make_InboundLedgers
std::unique_ptr< InboundLedgers > make_InboundLedgers(Application &app, InboundLedgers::clock_type &clock, beast::insight::Collector::ptr const &collector)
Definition: InboundLedgers.cpp:427
ripple::CollectorManager
Provides the beast::insight::Collector service.
Definition: CollectorManager.h:29
ripple::ConfigSection::importNodeDatabase
static std::string importNodeDatabase()
Definition: ConfigSections.h:43
std::chrono::milliseconds
ripple::Config::NODE_SIZE
std::size_t NODE_SIZE
Definition: Config.h:197
ripple::ApplicationImp::m_acceptedLedgerCache
TaggedCache< uint256, AcceptedLedger > m_acceptedLedgerCache
Definition: Application.cpp:203
ripple::ApplicationImp::setup
bool setup() override
Definition: Application.cpp:1211
ripple::SHAMapStore
class to create database, launch online delete thread, and related SQLite database
Definition: SHAMapStore.h:36
ripple::ApplicationImp::validatorManifests
ManifestCache & validatorManifests() override
Definition: Application.cpp:807
ripple::ApplicationImp::getWalletDB
DatabaseCon & getWalletDB() override
Retrieve the "wallet database".
Definition: Application.cpp:886
ripple::getLatestLedger
std::tuple< std::shared_ptr< Ledger >, std::uint32_t, uint256 > getLatestLedger(Application &app)
Definition: Ledger.cpp:1054
ripple::ApplicationImp::getCollectorManager
CollectorManager & getCollectorManager() override
Definition: Application.cpp:540
ripple::ApplicationImp::sweepTimer_
boost::asio::steady_timer sweepTimer_
Definition: Application.cpp:219
ripple::ApplicationImp::cluster_
std::unique_ptr< Cluster > cluster_
Definition: Application.cpp:205
ripple::ApplicationImp::getShardStore
NodeStore::DatabaseShard * getShardStore() override
Definition: Application.cpp:671
ripple::ApplicationImp::openLedger
OpenLedger const & openLedger() const override
Definition: Application.cpp:857
ripple::ApplicationImp::getIOLatency
std::chrono::milliseconds getIOLatency() override
Definition: Application.cpp:596
ripple::ApplicationImp::m_shaMapStore
std::unique_ptr< SHAMapStore > m_shaMapStore
Definition: Application.cpp:178
ripple::make_CollectorManager
std::unique_ptr< CollectorManager > make_CollectorManager(Section const &params, beast::Journal journal)
Definition: CollectorManager.cpp:72
ripple::Config::LOAD
@ LOAD
Definition: Config.h:132
beast::Journal::warn
Stream warn() const
Definition: Journal.h:327
std::recursive_mutex
STL class.
std::reference_wrapper::get
T get(T... args)
ripple::ApplicationImp::getIOService
boost::asio::io_service & getIOService() override
Definition: Application.cpp:590
ripple::ApplicationImp::shardArchiveHandler_
std::unique_ptr< RPC::ShardArchiveHandler > shardArchiveHandler_
Definition: Application.cpp:194
std::lock_guard
STL class.
beast::severities
A namespace for easy access to logging severity values.
Definition: Journal.h:29
ripple::perf::PerfLog
Singleton class that maintains performance counters and optionally writes Json-formatted data to a di...
Definition: PerfLog.h:48
ripple::STParsedJSONObject
Holds the serialized result of parsing an input JSON object.
Definition: STParsedJSON.h:31
ripple::PendingSaves
Keeps track of which ledgers haven't been fully saved.
Definition: PendingSaves.h:36
ripple::Resource::feeReferenceRPC
const Charge feeReferenceRPC
ripple::make_LedgerCleaner
std::unique_ptr< LedgerCleaner > make_LedgerCleaner(Application &app, beast::Journal journal)
Definition: LedgerCleaner.cpp:455
ripple::Pathfinder::initPathTable
static void initPathTable()
Definition: Pathfinder.cpp:1244
std::cerr
ripple::ApplicationImp::ApplicationImp
ApplicationImp(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
Definition: Application.cpp:267
ripple::ApplicationImp::signalStop
void signalStop() override
Definition: Application.cpp:1651
ripple::ApplicationImp::cluster
Cluster & cluster() override
Definition: Application.cpp:819
ripple::stopwatch
Stopwatch & stopwatch()
Returns an instance of a wall clock.
Definition: chrono.h:88
ripple::RelationalDBInterface
Definition: RelationalDBInterface.h:48
ripple::make_NetworkOPs
std::unique_ptr< NetworkOPs > make_NetworkOPs(Application &app, NetworkOPs::clock_type &clock, bool standalone, std::size_t minPeerCount, bool startvalid, JobQueue &job_queue, LedgerMaster &ledgerMaster, ValidatorKeys const &validatorKeys, boost::asio::io_service &io_svc, beast::Journal journal, beast::insight::Collector::ptr const &collector)
Definition: NetworkOPs.cpp:4449
ripple::make_InboundTransactions
std::unique_ptr< InboundTransactions > make_InboundTransactions(Application &app, beast::insight::Collector::ptr const &collector, std::function< void(std::shared_ptr< SHAMap > const &, bool)> gotSet)
Definition: InboundTransactions.cpp:272
ripple::RelationalDBInterface::init
static std::unique_ptr< RelationalDBInterface > init(Application &app, Config const &config, JobQueue &jobQueue)
init Creates and returns appropriate interface based on config.
Definition: RelationalDBInterface.cpp:40
ripple::ApplicationImp::getLedgerMaster
LedgerMaster & getLedgerMaster() override
Definition: Application.cpp:602
Json::Reader
Unserialize a JSON document into a Value.
Definition: json_reader.h:36
ripple::NodeFamily
Definition: NodeFamily.h:30
ripple::STParsedJSONObject::object
std::optional< STObject > object
The STObject if the parse was successful.
Definition: STParsedJSON.h:50
ripple::ResolverAsio::New
static std::unique_ptr< ResolverAsio > New(boost::asio::io_service &, beast::Journal)
Definition: ResolverAsio.cpp:406
iostream
ripple::ApplicationImp::m_nodeStore
std::unique_ptr< NodeStore::Database > m_nodeStore
Definition: Application.cpp:190
ripple::RelationalDBInterfacePostgres
Definition: RelationalDBInterfacePostgres.h:27
ripple::ApplicationImp::perfLog_
std::unique_ptr< perf::PerfLog > perfLog_
Definition: Application.cpp:169
ripple::AccountIDCache
Caches the base58 representations of AccountIDs.
Definition: AccountID.h:118
ripple::ApplicationImp::nodeIdentity_
std::pair< PublicKey, SecretKey > nodeIdentity_
Definition: Application.cpp:185
ripple::InboundLedgers::sweep
virtual void sweep()=0
ripple::ValidatorKeys
Validator keys and manifest as set in configuration file.
Definition: ValidatorKeys.h:36
ripple::HashRouter
Routing table for objects identified by hash.
Definition: HashRouter.h:53
ripple::forceValidity
void forceValidity(HashRouter &router, uint256 const &txid, Validity validity)
Sets the validity of a given transaction in the cache.
Definition: apply.cpp:89
ripple::ApplicationImp::validatorKeys_
const ValidatorKeys validatorKeys_
Definition: Application.cpp:186
ripple::ApplicationImp::timeKeeper_
std::unique_ptr< TimeKeeper > timeKeeper_
Definition: Application.cpp:166
ripple::OperatingMode::SYNCING
@ SYNCING
fallen slightly behind
ripple::Config::IO_WORKERS
int IO_WORKERS
Definition: Config.h:219
ripple::ApplicationImp::cv_
std::condition_variable cv_
Definition: Application.cpp:228
ripple::SHAMapMissingNode
Definition: SHAMapMissingNode.h:55
ripple::Validity::SigGoodOnly
@ SigGoodOnly
Signature is good, but local checks fail.
ripple::ApplicationImp::getShardArchiveHandler
RPC::ShardArchiveHandler * getShardArchiveHandler(bool tryRecovery) override
Definition: Application.cpp:677
ripple::ApplicationImp::m_inboundLedgers
std::unique_ptr< InboundLedgers > m_inboundLedgers
Definition: Application.cpp:200
ripple::ApplicationImp::peerReservations_
std::unique_ptr< PeerReservationTable > peerReservations_
Definition: Application.cpp:206
ripple::setup_ServerHandler
ServerHandler::Setup setup_ServerHandler(Config const &config, std::ostream &&log)
Definition: ServerHandlerImp.cpp:1197
ripple::ApplicationImp::loadLedgerFromFile
std::shared_ptr< Ledger > loadLedgerFromFile(std::string const &ledgerID)
Definition: Application.cpp:1772
ripple::ApplicationImp::checkSigs
bool checkSigs() const override
Definition: Application.cpp:1665
ripple::ApplicationImp::journal
beast::Journal journal(std::string const &name) override
Definition: Application.cpp:2138
ripple::base_uint< 256 >
ripple::ApplicationImp::entropyTimer_
boost::asio::steady_timer entropyTimer_
Definition: Application.cpp:220
ripple::ApplicationImp::getMaxDisallowedLedger
LedgerIndex getMaxDisallowedLedger() override
Ensure that a newly-started validator does not sign proposals older than the last ledger it persisted...
Definition: Application.cpp:1178
ripple::ApplicationImp::nodeToShards
bool nodeToShards()
Definition: Application.cpp:2144
ripple::ApplicationImp::hashRouter_
std::unique_ptr< HashRouter > hashRouter_
Definition: Application.cpp:214
ripple::ApplicationImp::getMasterMutex
Application::MutexType & getMasterMutex() override
Definition: Application.cpp:735
ripple::ApplicationImp::m_ledgerMaster
std::unique_ptr< LedgerMaster > m_ledgerMaster
Definition: Application.cpp:198
ripple::RPC::doCommand
Status doCommand(RPC::JsonContext &context, Json::Value &result)
Execute an RPC command and store the results in a Json::Value.
Definition: RPCHandler.cpp:245
ripple::setup_Overlay
Overlay::Setup setup_Overlay(BasicConfig const &config)
Definition: OverlayImpl.cpp:1537
ripple::ApplicationImp::logs
Logs & logs() override
Definition: Application.cpp:528
ripple::Config::reporting
bool reporting() const
Definition: Config.h:316
ripple::ApplicationImp::getPerfLog
perf::PerfLog & getPerfLog() override
Definition: Application.cpp:651
ripple::ApplicationImp::m_jobQueue
std::unique_ptr< JobQueue > m_jobQueue
Definition: Application.cpp:176
ripple::ApplicationImp::checkSigs_
std::atomic< bool > checkSigs_
Definition: Application.cpp:232
std::reference_wrapper
ripple::make_ServerHandler
std::unique_ptr< ServerHandler > make_ServerHandler(Application &app, boost::asio::io_service &io_service, JobQueue &jobQueue, NetworkOPs &networkOPs, Resource::Manager &resourceManager, CollectorManager &cm)
Definition: ServerHandlerImp.cpp:1209
ripple::RelationalDBInterface::getMaxLedgerSeq
virtual std::optional< LedgerIndex > getMaxLedgerSeq()=0
getMaxLedgerSeq Returns maximum ledger sequence in Ledgers table.
ripple::loadByHash
std::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Application &app, bool acquire)
Definition: Ledger.cpp:1077
ripple::TxQ
Transaction Queue.
Definition: TxQ.h:56
ripple::Config::FORCE_MULTI_THREAD
bool FORCE_MULTI_THREAD
Definition: Config.h:223
ripple::ApplicationImp::numberOfThreads
static std::size_t numberOfThreads(Config const &config)
Definition: Application.cpp:244
ripple::base_uint::isZero
bool isZero() const
Definition: base_uint.h:511
ripple::ApplicationImp::getSHAMapStore
SHAMapStore & getSHAMapStore() override
Definition: Application.cpp:831
ripple::Role::ADMIN
@ ADMIN
ripple::detail::supportedAmendments
std::map< std::string, DefaultVote > const & supportedAmendments()
Amendments that this server supports and the default voting behavior.
Definition: Feature.cpp:314
beast::PropertyStream::Source::add
void add(Source &source)
Add a child source.
Definition: beast_PropertyStream.cpp:196
ripple::ApplicationImp::getAmendmentTable
AmendmentTable & getAmendmentTable() override
Definition: Application.cpp:771
ripple::ApplicationImp::loadOldLedger
bool loadOldLedger(std::string const &ledgerID, bool replay, bool isFilename)
Definition: Application.cpp:1907
ripple::PublicKey
A public key.
Definition: PublicKey.h:59
std::atomic::load
T load(T... args)
ripple::Config
Definition: Config.h:68
ripple::ApplicationImp::io_latency_sampler::cancel
void cancel()
Definition: Application.cpp:151
ripple::PublicKey::size
std::size_t size() const noexcept
Definition: PublicKey.h:87
ripple::Cluster
Definition: Cluster.h:38
std::thread::hardware_concurrency
T hardware_concurrency(T... args)
ripple::ValidatorList
Definition: ValidatorList.h:172
chrono
ripple::ApplicationImp::getResourceManager
Resource::Manager & getResourceManager() override
Definition: Application.cpp:747
ripple::ApplicationImp::peerReservations
PeerReservationTable & peerReservations() override
Definition: Application.cpp:825
ripple::ApplicationImp::publisherManifests
ManifestCache & publisherManifests() override
Definition: Application.cpp:813
ripple::ApplicationImp::m_amendmentTable
std::unique_ptr< AmendmentTable > m_amendmentTable
Definition: Application.cpp:212
ripple::Config::NETWORK
@ NETWORK
Definition: Config.h:132
ripple::ApplicationImp::overlay
Overlay & overlay() override
Definition: Application.cpp:865
ripple::megabytes
constexpr auto megabytes(T value) noexcept
Definition: ByteUtilities.h:34
ripple::ApplicationImp::pendingSaves
PendingSaves & pendingSaves() override
Definition: Application.cpp:837
ripple::ApplicationImp::m_collectorManager
std::unique_ptr< CollectorManager > m_collectorManager
Definition: Application.cpp:175
ripple::Config::standalone
bool standalone() const
Definition: Config.h:311
ripple::ApplicationImp::nodeFamily_
NodeFamily nodeFamily_
Definition: Application.cpp:191
ripple::HashRouter::getDefaultHoldTime
static std::chrono::seconds getDefaultHoldTime()
Definition: HashRouter.h:139
ripple::LedgerFill::full
@ full
Definition: LedgerToJson.h:49
std::unique_lock
STL class.
beast::io_latency_probe::sample
void sample(Handler &&handler)
Initiate continuous i/o latency sampling.
Definition: io_latency_probe.h:119
ripple::ApplicationImp::m_txMaster
TransactionMaster m_txMaster
Definition: Application.cpp:173
ripple::NodeStore::DatabaseShard
A collection of historical shards.
Definition: DatabaseShard.h:37
ripple::LoadFeeTrack
Manages the current fee schedule.
Definition: LoadFeeTrack.h:44
ripple::set
bool set(T &target, std::string const &name, Section const &section)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
Definition: BasicConfig.h:313
ripple::ApplicationImp::mut_
std::mutex mut_
Definition: Application.cpp:229
ripple::ValidatorList::listed
bool listed(PublicKey const &identity) const
Returns true if public key is included on any lists.
Definition: ValidatorList.cpp:1349
ripple::ApplicationImp::validatorSites
ValidatorSite & validatorSites() override
Definition: Application.cpp:801
ripple::ApplicationImp::nodeIdentity
std::pair< PublicKey, SecretKey > const & nodeIdentity() override
Definition: Application.cpp:572
beast::Journal::error
Stream error() const
Definition: Journal.h:333
beast::Journal::info
Stream info() const
Definition: Journal.h:321
ripple::ApplicationImp::io_latency_sampler::m_event
beast::insight::Event m_event
Definition: Application.cpp:102
std::chrono::time_point
beast::insight::Event
A metric for reporting event timing.
Definition: Event.h:40
ripple::ApplicationImp::config_
std::unique_ptr< Config > config_
Definition: Application.cpp:164
ripple::BuildInfo::getVersionString
std::string const & getVersionString()
Server version.
Definition: BuildInfo.cpp:64
ripple::OrderBookDB::setup
void setup(std::shared_ptr< ReadView const > const &ledger)
Definition: OrderBookDB.cpp:43
beast::basic_logstream
Definition: Journal.h:428
ripple::ReportingETL
This class is responsible for continuously extracting data from a p2p node, and writing that data to ...
Definition: ReportingETL.h:70
ripple::ApplicationImp::getLastFullLedger
std::shared_ptr< Ledger > getLastFullLedger()
Definition: Application.cpp:1732
ripple::TimeKeeper::closeTime
virtual time_point closeTime() const =0
Returns the close time, in network time.
ripple::Family
Definition: Family.h:32
ripple::ValidatorKeys::configInvalid
bool configInvalid() const
Definition: ValidatorKeys.h:49
ripple::ClosureCounter
The role of a ClosureCounter is to assist in shutdown by letting callers wait for the completion of c...
Definition: ClosureCounter.h:54
ripple::ApplicationImp::isTimeToStop
bool isTimeToStop
Definition: Application.cpp:230
ripple::ApplicationImp::m_io_latency_sampler
io_latency_sampler m_io_latency_sampler
Definition: Application.cpp:236
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
ripple::SizedItem::burstSize
@ burstSize
std::uint32_t
ripple::Config::WORKERS
int WORKERS
Definition: Config.h:218
std::condition_variable::wait
T wait(T... args)
ripple::ApplicationImp::gotTXSet
void gotTXSet(std::shared_ptr< SHAMap > const &set, bool fromAcquire)
Definition: Application.cpp:638
std::atomic< std::chrono::milliseconds >
ripple::ApplicationImp::startGenesisLedger
void startGenesisLedger()
Definition: Application.cpp:1712
ripple::ApplicationImp::m_signals
boost::asio::signal_set m_signals
Definition: Application.cpp:226
ripple::TimeKeeper
Manages various times used by the server.
Definition: TimeKeeper.h:32
ripple::ApplicationImp::timeKeeper
TimeKeeper & timeKeeper() override
Definition: Application.cpp:560
beast::io_latency_probe< std::chrono::steady_clock >
ripple::OrderBookDB
Definition: OrderBookDB.h:31
ripple::ApplicationImp::io_latency_sampler::operator()
void operator()(Duration const &elapsed)
Definition: Application.cpp:128
ripple::NodeStore::Database::sweep
virtual void sweep()=0
Remove expired entries from the positive and negative caches.
ripple::ApplicationImp::getRelationalDBInterface
RelationalDBInterface & getRelationalDBInterface() override
Definition: Application.cpp:879
ripple::InboundLedgers
Manages the lifetime of inbound ledgers.
Definition: InboundLedgers.h:33
ripple::OpenLedger
Represents the open ledger.
Definition: OpenLedger.h:49
ripple::Validations::flush
void flush()
Flush all current validations.
Definition: Validations.h:1100
ripple::JobQueue
A pool of threads to perform work.
Definition: JobQueue.h:55
ripple::Application::Application
Application()
Definition: Application.cpp:2177
std::min
T min(T... args)
ripple::ApplicationImp::setMaxDisallowedLedger
void setMaxDisallowedLedger()
Definition: Application.cpp:2165
ripple::Resource::Manager
Tracks load and resource consumption.
Definition: ResourceManager.h:36
ripple::ApplicationImp::shardFamily_
std::unique_ptr< ShardFamily > shardFamily_
Definition: Application.cpp:193
ripple::ApplicationImp::io_latency_sampler::lastSample_
std::atomic< std::chrono::milliseconds > lastSample_
Definition: Application.cpp:105
ripple::ApplicationImp::setSweepTimer
void setSweepTimer()
Definition: Application.cpp:1080
ripple::ApplicationImp::overlay_
std::unique_ptr< Overlay > overlay_
Definition: Application.cpp:224
ripple::BuildInfo::getFullVersionString
std::string const & getFullVersionString()
Full server version string.
Definition: BuildInfo.cpp:77
ripple::ApplicationImp::openLedger
OpenLedger & openLedger() override
Definition: Application.cpp:849
ripple::ApplicationImp::pendingSaves_
PendingSaves pendingSaves_
Definition: Application.cpp:179
ripple::ApplicationImp::m_resolver
std::unique_ptr< ResolverAsio > m_resolver
Definition: Application.cpp:234
ripple::ApplicationImp::getTxQ
TxQ & getTxQ() override
Definition: Application.cpp:872
ripple::PeerReservationTable
Definition: PeerReservationTable.h:79
ripple::ManifestCache
Remembers manifests with the highest sequence number.
Definition: Manifest.h:223
ripple::LedgerReplayer::sweep
void sweep()
Remove completed tasks.
Definition: LedgerReplayer.cpp:219
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::Config::FRESH
@ FRESH
Definition: Config.h:132
ripple::Resource::make_Manager
std::unique_ptr< Manager > make_Manager(beast::insight::Collector::ptr const &collector, beast::Journal journal)
Definition: ResourceManager.cpp:175
ripple::ApplicationImp::getTempNodeCache
NodeCache & getTempNodeCache() override
Definition: Application.cpp:657
ripple::ApplicationImp::io_latency_sampler::get
std::chrono::milliseconds get() const
Definition: Application.cpp:145
beast::io_latency_probe::cancel
void cancel()
Cancel all pending i/o.
Definition: io_latency_probe.h:84
Json::Value::removeMember
Value removeMember(const char *key)
Remove and return the named member.
Definition: json_value.cpp:907
ripple::ApplicationImp::grpcServer_
std::unique_ptr< GRPCServer > grpcServer_
Definition: Application.cpp:238
std::endl
T endl(T... args)
ripple::OpenView::rawTxInsert
void rawTxInsert(key_type const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData) override
Add a transaction to the tx map.
Definition: OpenView.cpp:261
ripple::RPC::ShardArchiveHandler::tryMakeRecoveryHandler
static std::unique_ptr< ShardArchiveHandler > tryMakeRecoveryHandler(Application &app)
Definition: ShardArchiveHandler.cpp:55
ripple::ApplicationImp::getJobQueue
JobQueue & getJobQueue() override
Definition: Application.cpp:566
ripple::ApplicationImp::fdRequired
int fdRequired() const override
Definition: Application.cpp:1684
ripple::ApplicationImp::doSweep
void doSweep()
Definition: Application.cpp:1140
beast::PropertyStream::Source::Source
Source(std::string const &name)
Definition: beast_PropertyStream.cpp:176
ripple::Overlay
Manages the set of connected peers.
Definition: Overlay.h:51
ripple::ApplicationImp::io_latency_sampler
Definition: Application.cpp:99
limits
ripple::ApplicationImp::getOrderBookDB
OrderBookDB & getOrderBookDB() override
Definition: Application.cpp:753
ripple::ApplicationImp
Definition: Application.cpp:96
ripple::ApplicationImp::initRDBMS
bool initRDBMS()
Definition: Application.cpp:908
ripple::ApplicationImp::getLoadManager
LoadManager & getLoadManager() override
Definition: Application.cpp:741
beast::lexicalCastChecked
bool lexicalCastChecked(Out &out, In in)
Intelligently convert from one type to another.
Definition: LexicalCast.h:266
ripple::make_PeerSetBuilder
std::unique_ptr< PeerSetBuilder > make_PeerSetBuilder(Application &app)
Definition: PeerSet.cpp:144
ripple::ApplicationImp::io_latency_sampler::m_probe
beast::io_latency_probe< std::chrono::steady_clock > m_probe
Definition: Application.cpp:104
ripple::ApplicationImp::isStopping
bool isStopping() const override
Definition: Application.cpp:1677
ripple::ApplicationImp::accountIDCache_
AccountIDCache accountIDCache_
Definition: Application.cpp:180
std
STL namespace.
ripple::ApplicationImp::m_nodeStoreScheduler
NodeStoreScheduler m_nodeStoreScheduler
Definition: Application.cpp:177
ripple::ApplicationImp::m_loadManager
std::unique_ptr< LoadManager > m_loadManager
Definition: Application.cpp:216
ripple::create_genesis
const create_genesis_t create_genesis
Definition: Ledger.cpp:62
ripple::Config::REPLAY
@ REPLAY
Definition: Config.h:132
ripple::ApplicationImp::getInboundTransactions
InboundTransactions & getInboundTransactions() override
Definition: Application.cpp:626
ripple::makeWalletDB
std::unique_ptr< DatabaseCon > makeWalletDB(DatabaseCon::Setup const &setup)
makeWalletDB Opens wallet DB and returns it.
Definition: RelationalDBInterface_global.cpp:40
Json::Reader::parse
bool parse(std::string const &document, Value &root)
Read a Value from a JSON document.
Definition: json_reader.cpp:74
condition_variable
ripple::Resource::Consumer
An endpoint that consumes resources.
Definition: Consumer.h:34
ripple::Resource::Charge
A consumption charge.
Definition: Charge.h:30
ripple::SizedItem::sweepInterval
@ sweepInterval
ripple::DatabaseCon
Definition: DatabaseCon.h:81
ripple::RPC::apiMaximumSupportedVersion
constexpr unsigned int apiMaximumSupportedVersion
Definition: RPCHelpers.h:243
ripple::ApplicationImp::mFeeTrack
std::unique_ptr< LoadFeeTrack > mFeeTrack
Definition: Application.cpp:213
ripple::ApplicationImp::getFeeTrack
LoadFeeTrack & getFeeTrack() override
Definition: Application.cpp:777
ripple::addJson
void addJson(Json::Value &json, LedgerFill const &fill)
Given a Ledger and options, fill a Json::Object or Json::Value with a description of the ledger.
Definition: LedgerToJson.cpp:281
ripple::RPC::ShardArchiveHandler
Handles the download and import of one or more shard archives.
Definition: ShardArchiveHandler.h:42
ripple::LedgerReplayer
Manages the lifetime of ledger replay tasks.
Definition: LedgerReplayer.h:72
beast::severities::kDebug
@ kDebug
Definition: Journal.h:35
ripple::ApplicationImp::io_latency_sampler::m_journal
beast::Journal m_journal
Definition: Application.cpp:103
ripple::ApplicationImp::config
Config & config() override
Definition: Application.cpp:534
ripple::ApplicationImp::validators_
std::unique_ptr< ValidatorList > validators_
Definition: Application.cpp:209
std::string::empty
T empty(T... args)
ripple::ApplicationImp::getLedgerCleaner
LedgerCleaner & getLedgerCleaner() override
Definition: Application.cpp:608
ripple::ApplicationImp::m_journal
beast::Journal m_journal
Definition: Application.cpp:168
ripple::SizedItem::ledgerSize
@ ledgerSize
ripple::Validations< RCLValidationsAdaptor >
ripple::ClosureCounter::join
void join(char const *name, std::chrono::milliseconds wait, beast::Journal j)
Returns once all counted in-flight closures are destroyed.
Definition: ClosureCounter.h:166
optional
beast::io_latency_probe::cancel_async
void cancel_async()
Definition: io_latency_probe.h:91
mutex
ripple::ApplicationImp::io_latency_sampler::io_latency_sampler
io_latency_sampler(beast::insight::Event ev, beast::Journal journal, std::chrono::milliseconds interval, boost::asio::io_service &ios)
Definition: Application.cpp:108
beast::Journal::debug
Stream debug() const
Definition: Journal.h:315
ripple::ApplicationImp::serverHandler_
std::unique_ptr< ServerHandler > serverHandler_
Definition: Application.cpp:211
std::size_t
ripple::to_string
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
Definition: app/misc/impl/Manifest.cpp:38
ripple::make_AmendmentTable
std::unique_ptr< AmendmentTable > make_AmendmentTable(Application &app, std::chrono::seconds majorityTime, std::vector< AmendmentTable::FeatureInfo > const &supported, Section const &enabled, Section const &vetoed, beast::Journal journal)
Definition: AmendmentTable.cpp:789
ripple::ApplicationImp::validatorManifests_
std::unique_ptr< ManifestCache > validatorManifests_
Definition: Application.cpp:207
BasicApp
Definition: BasicApp.h:29
ripple::ApplicationImp::m_pathRequests
std::unique_ptr< PathRequests > m_pathRequests
Definition: Application.cpp:197
ripple::ApplicationImp::m_networkOPs
std::unique_ptr< NetworkOPs > m_networkOPs
Definition: Application.cpp:204
ripple::ApplicationImp::getNodeFamily
Family & getNodeFamily() override
Definition: Application.cpp:546
ripple::PathRequests
Definition: PathRequests.h:33
ripple::ApplicationImp::txQ_
std::unique_ptr< TxQ > txQ_
Definition: Application.cpp:217
ripple::ApplicationImp::cachedSLEs_
CachedSLEs cachedSLEs_
Definition: Application.cpp:184
std::max
T max(T... args)
ripple::base_uint::parseHex
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
Definition: base_uint.h:475
ripple::Validations::expire
void expire(beast::Journal &j)
Expire old validation sets.
Definition: Validations.h:725
ripple::NodeStore::Manager::instance
static Manager & instance()
Returns the instance of the manager singleton.
Definition: ManagerImp.cpp:120
ripple::ApplicationImp::m_masterMutex
Application::MutexType m_masterMutex
Definition: Application.cpp:170
ripple::NodeStore::Manager::make_Database
virtual std::unique_ptr< Database > make_Database(std::size_t burstSize, Scheduler &scheduler, int readThreads, Section const &backendParameters, beast::Journal journal)=0
Construct a NodeStore database.
ripple::getRegisteredFeature
std::optional< uint256 > getRegisteredFeature(std::string const &name)
Definition: Feature.cpp:336
ripple::LedgerCleaner
Check the ledger/transaction databases to make sure they have continuity.
Definition: LedgerCleaner.h:32
BasicApp::get_io_service
boost::asio::io_service & get_io_service()
Definition: BasicApp.h:41
ripple::ApplicationImp::initNodeStore
bool initNodeStore()
Definition: Application.cpp:934
ripple::ApplicationImp::maxDisallowedLedger_
std::atomic< LedgerIndex > maxDisallowedLedger_
Definition: Application.cpp:1186
ripple::make_SHAMapStore
std::unique_ptr< SHAMapStore > make_SHAMapStore(Application &app, NodeStore::Scheduler &scheduler, beast::Journal journal)
Definition: SHAMapStoreImp.cpp:761
ripple::ApplicationImp::publisherManifests_
std::unique_ptr< ManifestCache > publisherManifests_
Definition: Application.cpp:208
ripple::AmendmentTable
The amendment table stores the list of enabled and potential amendments.
Definition: AmendmentTable.h:37
ripple::ApplicationImp::getMasterTransaction
TransactionMaster & getMasterTransaction() override
Definition: Application.cpp:645
std::unique_ptr
STL class.
ripple::NetClock::time_point
std::chrono::time_point< NetClock > time_point
Definition: chrono.h:56
ripple::Config::LOAD_FILE
@ LOAD_FILE
Definition: Config.h:132
ripple::ApplicationImp::io_latency_sampler::start
void start()
Definition: Application.cpp:121
std::condition_variable::notify_all
T notify_all(T... args)
ripple::ApplicationImp::reportingETL_
std::unique_ptr< ReportingETL > reportingETL_
Definition: Application.cpp:239
Json::Value::isObjectOrNull
bool isObjectOrNull() const
Definition: json_value.cpp:1033
ripple::ApplicationImp::getValidations
RCLValidations & getValidations() override
Definition: Application.cpp:789
ripple::ApplicationImp::setEntropyTimer
void setEntropyTimer()
Definition: Application.cpp:1111
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:2184
ripple::ValidatorKeys::manifest
std::string manifest
Definition: ValidatorKeys.h:43
std::ref
T ref(T... args)
std::exception::what
T what(T... args)
ripple::ApplicationImp::start
void start(bool withTimers) override
Definition: Application.cpp:1606
Json::Value
Represents a JSON value.
Definition: json_value.h:145
beast::insight::Event::notify
void notify(std::chrono::duration< Rep, Period > const &value) const
Push an event notification.
Definition: Event.h:64
ripple::ApplicationImp::logs_
std::unique_ptr< Logs > logs_
Definition: Application.cpp:165
ripple::InboundTransactions
Manages the acquisition and lifetime of transaction sets.
Definition: InboundTransactions.h:35
variant
Json::Value::asString
std::string asString() const
Returns the unquoted string value.
Definition: json_value.cpp:469
ripple::ClosureCounter::wrap
std::optional< Substitute< Closure > > wrap(Closure &&closure)
Wrap the passed closure with a reference counter.
Definition: ClosureCounter.h:192
std::ifstream
STL class.
beast
Definition: base_uint.h:657
std::chrono