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  auto const cores = std::thread::hardware_concurrency();
250 
251  // Use a single thread when running on under-provisioned systems
252  // or if we are configured to use minimal resources.
253  if ((cores == 1) || ((config.NODE_SIZE == 0) && (cores == 2)))
254  return 1;
255 
256  // Otherwise, prefer two threads.
257  return 2;
258 #endif
259  }
260 
261  //--------------------------------------------------------------------------
262 
268  , config_(std::move(config))
269  , logs_(std::move(logs))
270  , timeKeeper_(std::move(timeKeeper))
271  , m_journal(logs_->journal("Application"))
272 
273  // PerfLog must be started before any other threads are launched.
274  , perfLog_(perf::make_PerfLog(
275  perf::setup_PerfLog(
276  config_->section("perf"),
277  config_->CONFIG_DIR),
278  logs_->journal("PerfLog"),
279  [this] { signalStop(); }))
280 
281  , m_txMaster(*this)
282 
284  config_->section(SECTION_INSIGHT),
285  logs_->journal("Collector")))
286 
287  , m_jobQueue(std::make_unique<JobQueue>(
288  [](std::unique_ptr<Config> const& config) {
289  if (config->standalone() && !config->reporting() &&
291  return 1;
292 
293  if (config->WORKERS)
294  return config->WORKERS;
295 
296  auto count =
297  static_cast<int>(std::thread::hardware_concurrency());
298 
299  // Be more aggressive about the number of threads to use
300  // for the job queue if the server is configured as "large"
301  // or "huge" if there are enough cores.
302  if (config->NODE_SIZE >= 4 && count >= 16)
303  count = 6 + std::min(count, 8);
304  else if (config->NODE_SIZE >= 3 && count >= 8)
305  count = 4 + std::min(count, 6);
306  else
307  count = 2 + std::min(count, 4);
308 
309  return count;
310  }(config_),
311  m_collectorManager->group("jobq"),
312  logs_->journal("JobQueue"),
313  *logs_,
314  *perfLog_))
315 
317 
319  *this,
321  logs_->journal("SHAMapStore")))
322 
323  , accountIDCache_(128000)
324 
325  , m_tempNodeCache(
326  "NodeCache",
327  16384,
329  stopwatch(),
330  logs_->journal("TaggedCache"))
331 
332  , cachedSLEs_(
333  "Cached SLEs",
334  0,
336  stopwatch(),
337  logs_->journal("CachedSLEs"))
338 
340 
342  m_collectorManager->collector(),
343  logs_->journal("Resource")))
344 
345  , m_nodeStore(m_shaMapStore->makeNodeStore(4))
346 
348 
349  // The shard store is optional and make_ShardStore can return null.
351  *this,
353  4,
354  logs_->journal("ShardStore")))
355 
356  , m_orderBookDB(*this)
357 
358  , m_pathRequests(std::make_unique<PathRequests>(
359  *this,
360  logs_->journal("PathRequest"),
361  m_collectorManager->collector()))
362 
363  , m_ledgerMaster(std::make_unique<LedgerMaster>(
364  *this,
365  stopwatch(),
366  m_collectorManager->collector(),
367  logs_->journal("LedgerMaster")))
368 
369  , ledgerCleaner_(
370  make_LedgerCleaner(*this, logs_->journal("LedgerCleaner")))
371 
372  // VFALCO NOTE must come before NetworkOPs to prevent a crash due
373  // to dependencies in the destructor.
374  //
376  *this,
377  stopwatch(),
378  m_collectorManager->collector()))
379 
381  *this,
382  m_collectorManager->collector(),
383  [this](std::shared_ptr<SHAMap> const& set, bool fromAcquire) {
384  gotTXSet(set, fromAcquire);
385  }))
386 
387  , m_ledgerReplayer(std::make_unique<LedgerReplayer>(
388  *this,
390  make_PeerSetBuilder(*this)))
391 
393  "AcceptedLedger",
394  4,
396  stopwatch(),
397  logs_->journal("TaggedCache"))
398 
400  *this,
401  stopwatch(),
402  config_->standalone(),
403  config_->NETWORK_QUORUM,
404  config_->START_VALID,
405  *m_jobQueue,
408  get_io_service(),
409  logs_->journal("NetworkOPs"),
410  m_collectorManager->collector()))
411 
412  , cluster_(std::make_unique<Cluster>(logs_->journal("Overlay")))
413 
414  , peerReservations_(std::make_unique<PeerReservationTable>(
415  logs_->journal("PeerReservationTable")))
416 
418  std::make_unique<ManifestCache>(logs_->journal("ManifestCache")))
419 
421  std::make_unique<ManifestCache>(logs_->journal("ManifestCache")))
422 
423  , validators_(std::make_unique<ValidatorList>(
426  *timeKeeper_,
427  config_->legacy("database_path"),
428  logs_->journal("ValidatorList"),
429  config_->VALIDATION_QUORUM))
430 
431  , validatorSites_(std::make_unique<ValidatorSite>(*this))
432 
434  *this,
435  get_io_service(),
436  *m_jobQueue,
437  *m_networkOPs,
440 
441  , mFeeTrack(
442  std::make_unique<LoadFeeTrack>(logs_->journal("LoadManager")))
443 
444  , hashRouter_(std::make_unique<HashRouter>(
445  stopwatch(),
448 
449  , mValidations(
450  ValidationParms(),
451  stopwatch(),
452  *this,
453  logs_->journal("Validations"))
454 
455  , m_loadManager(make_LoadManager(*this, logs_->journal("LoadManager")))
456 
457  , txQ_(
458  std::make_unique<TxQ>(setup_TxQ(*config_), logs_->journal("TxQ")))
459 
461 
463 
465 
466  , checkSigs_(true)
467 
468  , m_resolver(
469  ResolverAsio::New(get_io_service(), logs_->journal("Resolver")))
470 
472  m_collectorManager->collector()->make_event("ios_latency"),
473  logs_->journal("Application"),
475  get_io_service())
476  , grpcServer_(std::make_unique<GRPCServer>(*this))
477  , reportingETL_(
478  config_->reporting() ? std::make_unique<ReportingETL>(*this)
479  : nullptr)
480  {
481  add(m_resourceManager.get());
482 
483  //
484  // VFALCO - READ THIS!
485  //
486  // Do not start threads, open sockets, or do any sort of "real work"
487  // inside the constructor. Put it in start instead. Or if you must,
488  // put it in setup (but everything in setup should be moved to start
489  // anyway.
490  //
491  // The reason is that the unit tests require an Application object to
492  // be created. But we don't actually start all the threads, sockets,
493  // and services when running the unit tests. Therefore anything which
494  // needs to be stopped will not get stopped correctly if it is
495  // started in this constructor.
496  //
497 
498  add(ledgerCleaner_.get());
499  }
500 
501  //--------------------------------------------------------------------------
502 
503  bool
504  setup() override;
505  void
506  start(bool withTimers) override;
507  void
508  run() override;
509  void
510  signalStop() override;
511  bool
512  checkSigs() const override;
513  void
514  checkSigs(bool) override;
515  bool
516  isStopping() const override;
517  int
518  fdRequired() const override;
519 
520  //--------------------------------------------------------------------------
521 
522  Logs&
523  logs() override
524  {
525  return *logs_;
526  }
527 
528  Config&
529  config() override
530  {
531  return *config_;
532  }
533 
536  {
537  return *m_collectorManager;
538  }
539 
540  Family&
541  getNodeFamily() override
542  {
543  return nodeFamily_;
544  }
545 
546  // The shard store is an optional feature. If the sever is configured for
547  // shards, this function will return a valid pointer, otherwise a nullptr.
548  Family*
549  getShardFamily() override
550  {
551  return shardFamily_.get();
552  }
553 
554  TimeKeeper&
555  timeKeeper() override
556  {
557  return *timeKeeper_;
558  }
559 
560  JobQueue&
561  getJobQueue() override
562  {
563  return *m_jobQueue;
564  }
565 
567  nodeIdentity() override
568  {
569  return nodeIdentity_;
570  }
571 
572  PublicKey const&
573  getValidationPublicKey() const override
574  {
575  return validatorKeys_.publicKey;
576  }
577 
578  NetworkOPs&
579  getOPs() override
580  {
581  return *m_networkOPs;
582  }
583 
584  boost::asio::io_service&
585  getIOService() override
586  {
587  return get_io_service();
588  }
589 
591  getIOLatency() override
592  {
593  return m_io_latency_sampler.get();
594  }
595 
596  LedgerMaster&
597  getLedgerMaster() override
598  {
599  return *m_ledgerMaster;
600  }
601 
603  getLedgerCleaner() override
604  {
605  return *ledgerCleaner_;
606  }
607 
609  getLedgerReplayer() override
610  {
611  return *m_ledgerReplayer;
612  }
613 
615  getInboundLedgers() override
616  {
617  return *m_inboundLedgers;
618  }
619 
622  {
623  return *m_inboundTransactions;
624  }
625 
628  {
629  return m_acceptedLedgerCache;
630  }
631 
632  void
633  gotTXSet(std::shared_ptr<SHAMap> const& set, bool fromAcquire)
634  {
635  if (set)
636  m_networkOPs->mapComplete(set, fromAcquire);
637  }
638 
641  {
642  return m_txMaster;
643  }
644 
646  getPerfLog() override
647  {
648  return *perfLog_;
649  }
650 
651  NodeCache&
652  getTempNodeCache() override
653  {
654  return m_tempNodeCache;
655  }
656 
658  getNodeStore() override
659  {
660  return *m_nodeStore;
661  }
662 
663  // The shard store is an optional feature. If the sever is configured for
664  // shards, this function will return a valid pointer, otherwise a nullptr.
666  getShardStore() override
667  {
668  return shardStore_.get();
669  }
670 
672  getShardArchiveHandler(bool tryRecovery) override
673  {
674  static std::mutex handlerMutex;
675  std::lock_guard lock(handlerMutex);
676 
677  // After constructing the handler, try to
678  // initialize it. Log on error; set the
679  // member variable on success.
680  auto initAndSet =
682  if (!handler)
683  return false;
684 
685  if (!handler->init())
686  {
687  JLOG(m_journal.error())
688  << "Failed to initialize ShardArchiveHandler.";
689 
690  return false;
691  }
692 
693  shardArchiveHandler_ = std::move(handler);
694  return true;
695  };
696 
697  // Need to resume based on state from a previous
698  // run.
699  if (tryRecovery)
700  {
701  if (shardArchiveHandler_ != nullptr)
702  {
703  JLOG(m_journal.error())
704  << "ShardArchiveHandler already created at startup.";
705 
706  return nullptr;
707  }
708 
709  auto handler =
711 
712  if (!initAndSet(std::move(handler)))
713  return nullptr;
714  }
715 
716  // Construct the ShardArchiveHandler
717  if (shardArchiveHandler_ == nullptr)
718  {
719  auto handler =
721 
722  if (!initAndSet(std::move(handler)))
723  return nullptr;
724  }
725 
726  return shardArchiveHandler_.get();
727  }
728 
730  getMasterMutex() override
731  {
732  return m_masterMutex;
733  }
734 
735  LoadManager&
736  getLoadManager() override
737  {
738  return *m_loadManager;
739  }
740 
743  {
744  return *m_resourceManager;
745  }
746 
747  OrderBookDB&
748  getOrderBookDB() override
749  {
750  return m_orderBookDB;
751  }
752 
753  PathRequests&
754  getPathRequests() override
755  {
756  return *m_pathRequests;
757  }
758 
759  CachedSLEs&
760  cachedSLEs() override
761  {
762  return cachedSLEs_;
763  }
764 
766  getAmendmentTable() override
767  {
768  return *m_amendmentTable;
769  }
770 
771  LoadFeeTrack&
772  getFeeTrack() override
773  {
774  return *mFeeTrack;
775  }
776 
777  HashRouter&
778  getHashRouter() override
779  {
780  return *hashRouter_;
781  }
782 
784  getValidations() override
785  {
786  return mValidations;
787  }
788 
790  validators() override
791  {
792  return *validators_;
793  }
794 
796  validatorSites() override
797  {
798  return *validatorSites_;
799  }
800 
803  {
804  return *validatorManifests_;
805  }
806 
809  {
810  return *publisherManifests_;
811  }
812 
813  Cluster&
814  cluster() override
815  {
816  return *cluster_;
817  }
818 
820  peerReservations() override
821  {
822  return *peerReservations_;
823  }
824 
825  SHAMapStore&
826  getSHAMapStore() override
827  {
828  return *m_shaMapStore;
829  }
830 
831  PendingSaves&
832  pendingSaves() override
833  {
834  return pendingSaves_;
835  }
836 
837  AccountIDCache const&
838  accountIDCache() const override
839  {
840  return accountIDCache_;
841  }
842 
843  OpenLedger&
844  openLedger() override
845  {
846  if (config_->reporting())
847  Throw<ReportingShouldProxy>();
848  return *openLedger_;
849  }
850 
851  OpenLedger const&
852  openLedger() const override
853  {
854  if (config_->reporting())
855  Throw<ReportingShouldProxy>();
856  return *openLedger_;
857  }
858 
859  Overlay&
860  overlay() override
861  {
862  assert(overlay_);
863  return *overlay_;
864  }
865 
866  TxQ&
867  getTxQ() override
868  {
869  assert(txQ_.get() != nullptr);
870  return *txQ_;
871  }
872 
875  {
876  assert(mRelationalDBInterface.get() != nullptr);
877  return *mRelationalDBInterface;
878  }
879 
880  DatabaseCon&
881  getWalletDB() override
882  {
883  assert(mWalletDB.get() != nullptr);
884  return *mWalletDB;
885  }
886 
887  ReportingETL&
888  getReportingETL() override
889  {
890  assert(reportingETL_.get() != nullptr);
891  return *reportingETL_;
892  }
893 
894  bool
895  serverOkay(std::string& reason) override;
896 
898  journal(std::string const& name) override;
899 
900  //--------------------------------------------------------------------------
901 
902  bool
904  {
905  assert(mWalletDB.get() == nullptr);
906 
907  try
908  {
911 
912  // wallet database
914  setup.useGlobalPragma = false;
915 
917  }
918  catch (std::exception const& e)
919  {
920  JLOG(m_journal.fatal())
921  << "Failed to initialize SQL databases: " << e.what();
922  return false;
923  }
924 
925  return true;
926  }
927 
928  bool
930  {
931  if (config_->doImport)
932  {
933  auto j = logs_->journal("NodeObject");
934  NodeStore::DummyScheduler dummyScheduler;
937  megabytes(config_->getValueFor(
938  SizedItem::burstSize, std::nullopt)),
939  dummyScheduler,
940  0,
942  j);
943 
944  JLOG(j.warn()) << "Starting node import from '" << source->getName()
945  << "' to '" << m_nodeStore->getName() << "'.";
946 
947  using namespace std::chrono;
948  auto const start = steady_clock::now();
949 
950  m_nodeStore->importDatabase(*source);
951 
952  auto const elapsed =
953  duration_cast<seconds>(steady_clock::now() - start);
954  JLOG(j.warn()) << "Node import from '" << source->getName()
955  << "' took " << elapsed.count() << " seconds.";
956  }
957 
958  // tune caches
959  using namespace std::chrono;
960 
961  m_ledgerMaster->tune(
962  config_->getValueFor(SizedItem::ledgerSize),
963  seconds{config_->getValueFor(SizedItem::ledgerAge)});
964 
965  return true;
966  }
967 
968  //--------------------------------------------------------------------------
969 
970  // Called to indicate shutdown.
971  void
973  {
974  JLOG(m_journal.debug()) << "Application stopping";
975 
977 
978  // VFALCO Enormous hack, we have to force the probe to cancel
979  // before we stop the io_service queue or else it never
980  // unblocks in its destructor. The fix is to make all
981  // io_objects gracefully handle exit so that we can
982  // naturally return from io_service::run() instead of
983  // forcing a call to io_service::stop()
985 
986  m_resolver->stop_async();
987 
988  // NIKB This is a hack - we need to wait for the resolver to
989  // stop. before we stop the io_server_queue or weird
990  // things will happen.
991  m_resolver->stop();
992 
993  {
994  boost::system::error_code ec;
995  sweepTimer_.cancel(ec);
996  if (ec)
997  {
998  JLOG(m_journal.error())
999  << "Application: sweepTimer cancel error: " << ec.message();
1000  }
1001 
1002  ec.clear();
1003  entropyTimer_.cancel(ec);
1004  if (ec)
1005  {
1006  JLOG(m_journal.error())
1007  << "Application: entropyTimer cancel error: "
1008  << ec.message();
1009  }
1010  }
1011  // Make sure that any waitHandlers pending in our timers are done
1012  // before we declare ourselves stopped.
1013  using namespace std::chrono_literals;
1014  waitHandlerCounter_.join("Application", 1s, m_journal);
1015 
1016  mValidations.flush();
1017 
1018  validatorSites_->stop();
1019 
1020  // TODO Store manifests in manifests.sqlite instead of wallet.db
1021  validatorManifests_->save(
1022  getWalletDB(),
1023  "ValidatorManifests",
1024  [this](PublicKey const& pubKey) {
1025  return validators().listed(pubKey);
1026  });
1027 
1028  publisherManifests_->save(
1029  getWalletDB(),
1030  "PublisherManifests",
1031  [this](PublicKey const& pubKey) {
1032  return validators().trustedPublisher(pubKey);
1033  });
1034 
1035  // The order of these stop calls is delicate.
1036  // Re-ordering them risks undefined behavior.
1037  m_loadManager->stop();
1038  m_shaMapStore->stop();
1039  m_jobQueue->stop();
1041  shardArchiveHandler_->stop();
1042  if (overlay_)
1043  overlay_->stop();
1044  if (shardStore_)
1045  shardStore_->stop();
1046  grpcServer_->stop();
1047  m_networkOPs->stop();
1048  serverHandler_->stop();
1049  m_ledgerReplayer->stop();
1050  m_inboundTransactions->stop();
1051  m_inboundLedgers->stop();
1052  ledgerCleaner_->stop();
1053  if (reportingETL_)
1054  reportingETL_->stop();
1055  if (auto pg = dynamic_cast<RelationalDBInterfacePostgres*>(
1057  pg->stop();
1058  m_nodeStore->stop();
1059  perfLog_->stop();
1060  }
1061 
1062  //--------------------------------------------------------------------------
1063  //
1064  // PropertyStream
1065  //
1066 
1067  void
1069  {
1070  }
1071 
1072  //--------------------------------------------------------------------------
1073 
1074  void
1076  {
1077  // Only start the timer if waitHandlerCounter_ is not yet joined.
1078  if (auto optionalCountedHandler = waitHandlerCounter_.wrap(
1079  [this](boost::system::error_code const& e) {
1080  if (e.value() == boost::system::errc::success)
1081  {
1082  m_jobQueue->addJob(
1083  jtSWEEP, "sweep", [this](Job&) { doSweep(); });
1084  }
1085  // Recover as best we can if an unexpected error occurs.
1086  if (e.value() != boost::system::errc::success &&
1087  e.value() != boost::asio::error::operation_aborted)
1088  {
1089  // Try again later and hope for the best.
1090  JLOG(m_journal.error())
1091  << "Sweep timer got error '" << e.message()
1092  << "'. Restarting timer.";
1093  setSweepTimer();
1094  }
1095  }))
1096  {
1097  using namespace std::chrono;
1098  sweepTimer_.expires_from_now(
1099  seconds{config_->SWEEP_INTERVAL.value_or(
1100  config_->getValueFor(SizedItem::sweepInterval))});
1101  sweepTimer_.async_wait(std::move(*optionalCountedHandler));
1102  }
1103  }
1104 
1105  void
1107  {
1108  // Only start the timer if waitHandlerCounter_ is not yet joined.
1109  if (auto optionalCountedHandler = waitHandlerCounter_.wrap(
1110  [this](boost::system::error_code const& e) {
1111  if (e.value() == boost::system::errc::success)
1112  {
1113  crypto_prng().mix_entropy();
1114  setEntropyTimer();
1115  }
1116  // Recover as best we can if an unexpected error occurs.
1117  if (e.value() != boost::system::errc::success &&
1118  e.value() != boost::asio::error::operation_aborted)
1119  {
1120  // Try again later and hope for the best.
1121  JLOG(m_journal.error())
1122  << "Entropy timer got error '" << e.message()
1123  << "'. Restarting timer.";
1124  setEntropyTimer();
1125  }
1126  }))
1127  {
1128  using namespace std::chrono_literals;
1129  entropyTimer_.expires_from_now(5min);
1130  entropyTimer_.async_wait(std::move(*optionalCountedHandler));
1131  }
1132  }
1133 
1134  void
1136  {
1137  if (!config_->standalone() &&
1138  !getRelationalDBInterface().transactionDbHasSpace(*config_))
1139  {
1140  signalStop();
1141  }
1142 
1143  // VFALCO NOTE Does the order of calls matter?
1144  // VFALCO TODO fix the dependency inversion using an observer,
1145  // have listeners register for "onSweep ()" notification.
1146 
1147  nodeFamily_.sweep();
1148  if (shardFamily_)
1149  shardFamily_->sweep();
1151  getNodeStore().sweep();
1152  if (shardStore_)
1153  shardStore_->sweep();
1154  getLedgerMaster().sweep();
1155  getTempNodeCache().sweep();
1159  m_acceptedLedgerCache.sweep();
1160  cachedSLEs_.sweep();
1161 
1162 #ifdef RIPPLED_REPORTING
1163  if (auto pg = dynamic_cast<RelationalDBInterfacePostgres*>(
1165  pg->sweep();
1166 #endif
1167 
1168  // Set timer to do another sweep later.
1169  setSweepTimer();
1170  }
1171 
1172  LedgerIndex
1174  {
1175  return maxDisallowedLedger_;
1176  }
1177 
1178 private:
1179  // For a newly-started validator, this is the greatest persisted ledger
1180  // and new validations must be greater than this.
1182 
1183  bool
1184  nodeToShards();
1185 
1186  void
1188 
1191 
1193  loadLedgerFromFile(std::string const& ledgerID);
1194 
1195  bool
1196  loadOldLedger(std::string const& ledgerID, bool replay, bool isFilename);
1197 
1198  void
1200 };
1201 
1202 //------------------------------------------------------------------------------
1203 
1204 // TODO Break this up into smaller, more digestible initialization segments.
1205 bool
1207 {
1208  // We want to intercept CTRL-C and the standard termination signal SIGTERM
1209  // and terminate the process. This handler will NEVER be invoked twice.
1210  //
1211  // Note that async_wait is "one-shot": for each call, the handler will be
1212  // invoked exactly once, either when one of the registered signals in the
1213  // signal set occurs or the signal set is cancelled. Subsequent signals are
1214  // effectively ignored (technically, they are queued up, waiting for a call
1215  // to async_wait).
1216  m_signals.add(SIGINT);
1217  m_signals.add(SIGTERM);
1218  m_signals.async_wait(
1219  [this](boost::system::error_code const& ec, int signum) {
1220  // Indicates the signal handler has been aborted; do nothing
1221  if (ec == boost::asio::error::operation_aborted)
1222  return;
1223 
1224  JLOG(m_journal.info()) << "Received signal " << signum;
1225 
1226  if (signum == SIGTERM || signum == SIGINT)
1227  signalStop();
1228  });
1229 
1230  auto debug_log = config_->getDebugLogFile();
1231 
1232  if (!debug_log.empty())
1233  {
1234  // Let debug messages go to the file but only WARNING or higher to
1235  // regular output (unless verbose)
1236 
1237  if (!logs_->open(debug_log))
1238  std::cerr << "Can't open log file " << debug_log << '\n';
1239 
1240  using namespace beast::severities;
1241  if (logs_->threshold() > kDebug)
1242  logs_->threshold(kDebug);
1243  }
1244  JLOG(m_journal.info()) << "process starting: "
1246 
1247  if (numberOfThreads(*config_) < 2)
1248  {
1249  JLOG(m_journal.warn()) << "Limited to a single I/O service thread by "
1250  "system configuration.";
1251  }
1252 
1253  // Optionally turn off logging to console.
1254  logs_->silent(config_->silent());
1255 
1256  if (!config_->standalone())
1257  timeKeeper_->run(config_->SNTP_SERVERS);
1258 
1259  if (!initRDBMS() || !initNodeStore())
1260  return false;
1261 
1262  if (shardStore_)
1263  {
1264  shardFamily_ =
1265  std::make_unique<ShardFamily>(*this, *m_collectorManager);
1266 
1267  if (!shardStore_->init())
1268  return false;
1269  }
1270 
1271  if (!peerReservations_->load(getWalletDB()))
1272  {
1273  JLOG(m_journal.fatal()) << "Cannot find peer reservations!";
1274  return false;
1275  }
1276 
1279 
1280  // Configure the amendments the server supports
1281  {
1282  auto const supported = []() {
1283  auto const& amendments = detail::supportedAmendments();
1285  supported.reserve(amendments.size());
1286  for (auto const& [a, vote] : amendments)
1287  {
1288  auto const f = ripple::getRegisteredFeature(a);
1289  assert(f);
1290  if (f)
1291  supported.emplace_back(a, *f, vote);
1292  }
1293  return supported;
1294  }();
1295  Section const& downVoted = config_->section(SECTION_VETO_AMENDMENTS);
1296 
1297  Section const& upVoted = config_->section(SECTION_AMENDMENTS);
1298 
1300  *this,
1301  config().AMENDMENT_MAJORITY_TIME,
1302  supported,
1303  upVoted,
1304  downVoted,
1305  logs_->journal("Amendments"));
1306  }
1307 
1309 
1310  auto const startUp = config_->START_UP;
1311  if (!config_->reporting())
1312  {
1313  if (startUp == Config::FRESH)
1314  {
1315  JLOG(m_journal.info()) << "Starting new Ledger";
1316 
1318  }
1319  else if (
1320  startUp == Config::LOAD || startUp == Config::LOAD_FILE ||
1321  startUp == Config::REPLAY)
1322  {
1323  JLOG(m_journal.info()) << "Loading specified Ledger";
1324 
1325  if (!loadOldLedger(
1326  config_->START_LEDGER,
1327  startUp == Config::REPLAY,
1328  startUp == Config::LOAD_FILE))
1329  {
1330  JLOG(m_journal.error())
1331  << "The specified ledger could not be loaded.";
1332  return false;
1333  }
1334  }
1335  else if (startUp == Config::NETWORK)
1336  {
1337  // This should probably become the default once we have a stable
1338  // network.
1339  if (!config_->standalone())
1340  m_networkOPs->setNeedNetworkLedger();
1341 
1343  }
1344  else
1345  {
1347  }
1348  }
1349 
1350  if (!config().reporting())
1351  m_orderBookDB.setup(getLedgerMaster().getCurrentLedger());
1352 
1353  nodeIdentity_ = getNodeIdentity(*this);
1354 
1355  if (!cluster_->load(config().section(SECTION_CLUSTER_NODES)))
1356  {
1357  JLOG(m_journal.fatal()) << "Invalid entry in cluster configuration.";
1358  return false;
1359  }
1360 
1361  if (!config().reporting())
1362  {
1363  {
1365  return false;
1366 
1367  if (!validatorManifests_->load(
1368  getWalletDB(),
1369  "ValidatorManifests",
1371  config()
1372  .section(SECTION_VALIDATOR_KEY_REVOCATION)
1373  .values()))
1374  {
1375  JLOG(m_journal.fatal())
1376  << "Invalid configured validator manifest.";
1377  return false;
1378  }
1379 
1380  publisherManifests_->load(getWalletDB(), "PublisherManifests");
1381 
1382  // Setup trusted validators
1383  if (!validators_->load(
1385  config().section(SECTION_VALIDATORS).values(),
1386  config().section(SECTION_VALIDATOR_LIST_KEYS).values()))
1387  {
1388  JLOG(m_journal.fatal())
1389  << "Invalid entry in validator configuration.";
1390  return false;
1391  }
1392  }
1393 
1394  if (!validatorSites_->load(
1395  config().section(SECTION_VALIDATOR_LIST_SITES).values()))
1396  {
1397  JLOG(m_journal.fatal())
1398  << "Invalid entry in [" << SECTION_VALIDATOR_LIST_SITES << "]";
1399  return false;
1400  }
1401  }
1402  //----------------------------------------------------------------------
1403  //
1404  // Server
1405  //
1406  //----------------------------------------------------------------------
1407 
1408  // VFALCO NOTE Unfortunately, in stand-alone mode some code still
1409  // foolishly calls overlay(). When this is fixed we can
1410  // move the instantiation inside a conditional:
1411  //
1412  // if (!config_.standalone())
1413  if (!config_->reporting())
1414  {
1416  *this,
1418  *serverHandler_,
1420  *m_resolver,
1421  get_io_service(),
1422  *config_,
1423  m_collectorManager->collector());
1424  add(*overlay_); // add to PropertyStream
1425  }
1426 
1427  if (!config_->standalone())
1428  {
1429  // NodeStore import into the ShardStore requires the SQLite database
1430  if (config_->nodeToShard && !nodeToShards())
1431  return false;
1432  }
1433 
1434  // start first consensus round
1435  if (!config_->reporting() &&
1436  !m_networkOPs->beginConsensus(
1437  m_ledgerMaster->getClosedLedger()->info().hash))
1438  {
1439  JLOG(m_journal.fatal()) << "Unable to start consensus";
1440  return false;
1441  }
1442 
1443  {
1444  try
1445  {
1446  auto setup = setup_ServerHandler(
1448  setup.makeContexts();
1449  serverHandler_->setup(setup, m_journal);
1450  }
1451  catch (std::exception const& e)
1452  {
1453  if (auto stream = m_journal.fatal())
1454  {
1455  stream << "Unable to setup server handler";
1456  if (std::strlen(e.what()) > 0)
1457  stream << ": " << e.what();
1458  }
1459  return false;
1460  }
1461  }
1462 
1463  // Begin connecting to network.
1464  if (!config_->standalone())
1465  {
1466  // Should this message be here, conceptually? In theory this sort
1467  // of message, if displayed, should be displayed from PeerFinder.
1468  if (config_->PEER_PRIVATE && config_->IPS_FIXED.empty())
1469  {
1470  JLOG(m_journal.warn())
1471  << "No outbound peer connections will be made";
1472  }
1473 
1474  // VFALCO NOTE the state timer resets the deadlock detector.
1475  //
1476  m_networkOPs->setStateTimer();
1477  }
1478  else
1479  {
1480  JLOG(m_journal.warn()) << "Running in standalone mode";
1481 
1482  m_networkOPs->setStandAlone();
1483  }
1484 
1485  if (config_->canSign())
1486  {
1487  JLOG(m_journal.warn()) << "*** The server is configured to allow the "
1488  "'sign' and 'sign_for'";
1489  JLOG(m_journal.warn()) << "*** commands. These commands have security "
1490  "implications and have";
1491  JLOG(m_journal.warn()) << "*** been deprecated. They will be removed "
1492  "in a future release of";
1493  JLOG(m_journal.warn()) << "*** rippled.";
1494  JLOG(m_journal.warn()) << "*** If you do not use them to sign "
1495  "transactions please edit your";
1496  JLOG(m_journal.warn())
1497  << "*** configuration file and remove the [enable_signing] stanza.";
1498  JLOG(m_journal.warn()) << "*** If you do use them to sign transactions "
1499  "please migrate to a";
1500  JLOG(m_journal.warn())
1501  << "*** standalone signing solution as soon as possible.";
1502  }
1503 
1504  //
1505  // Execute start up rpc commands.
1506  //
1507  for (auto cmd : config_->section(SECTION_RPC_STARTUP).lines())
1508  {
1509  Json::Reader jrReader;
1510  Json::Value jvCommand;
1511 
1512  if (!jrReader.parse(cmd, jvCommand))
1513  {
1514  JLOG(m_journal.fatal()) << "Couldn't parse entry in ["
1515  << SECTION_RPC_STARTUP << "]: '" << cmd;
1516  }
1517 
1518  if (!config_->quiet())
1519  {
1520  JLOG(m_journal.fatal())
1521  << "Startup RPC: " << jvCommand << std::endl;
1522  }
1523 
1526  RPC::JsonContext context{
1527  {journal("RPCHandler"),
1528  *this,
1529  loadType,
1530  getOPs(),
1531  getLedgerMaster(),
1532  c,
1533  Role::ADMIN,
1534  {},
1535  {},
1537  jvCommand};
1538 
1539  Json::Value jvResult;
1540  RPC::doCommand(context, jvResult);
1541 
1542  if (!config_->quiet())
1543  {
1544  JLOG(m_journal.fatal()) << "Result: " << jvResult << std::endl;
1545  }
1546  }
1547 
1548  RPC::ShardArchiveHandler* shardArchiveHandler = nullptr;
1549  if (shardStore_)
1550  {
1551  try
1552  {
1553  // Create a ShardArchiveHandler if recovery
1554  // is needed (there's a state database left
1555  // over from a previous run).
1556  auto handler = getShardArchiveHandler(true);
1557 
1558  // Recovery is needed.
1559  if (handler)
1560  shardArchiveHandler = handler;
1561  }
1562  catch (std::exception const& e)
1563  {
1564  JLOG(m_journal.fatal())
1565  << "Exception when starting ShardArchiveHandler from "
1566  "state database: "
1567  << e.what();
1568 
1569  return false;
1570  }
1571  }
1572 
1573  if (shardArchiveHandler && !shardArchiveHandler->start())
1574  {
1575  JLOG(m_journal.fatal()) << "Failed to start ShardArchiveHandler.";
1576 
1577  return false;
1578  }
1579 
1580  validatorSites_->start();
1581 
1582  if (reportingETL_)
1583  reportingETL_->start();
1584 
1585  return true;
1586 }
1587 
1588 void
1589 ApplicationImp::start(bool withTimers)
1590 {
1591  JLOG(m_journal.info()) << "Application starting. Version is "
1593 
1594  if (withTimers)
1595  {
1596  setSweepTimer();
1597  setEntropyTimer();
1598  }
1599 
1601  m_resolver->start();
1602  m_loadManager->start();
1603  m_shaMapStore->start();
1604  if (overlay_)
1605  overlay_->start();
1606  grpcServer_->start();
1607  ledgerCleaner_->start();
1608  perfLog_->start();
1609 }
1610 
1611 void
1613 {
1614  if (!config_->standalone())
1615  {
1616  // VFALCO NOTE This seems unnecessary. If we properly refactor the load
1617  // manager then the deadlock detector can just always be
1618  // "armed"
1619  //
1621  }
1622 
1623  {
1625  cv_.wait(lk, [this] { return isTimeToStop; });
1626  }
1627 
1628  JLOG(m_journal.info()) << "Received shutdown request";
1629  stop();
1630  JLOG(m_journal.info()) << "Done.";
1631 }
1632 
1633 void
1635 {
1636  // Unblock the main thread (which is sitting in run()).
1637  // When we get C++20 this can use std::latch.
1638  std::lock_guard lk{mut_};
1639 
1640  if (!isTimeToStop)
1641  {
1642  isTimeToStop = true;
1643  cv_.notify_all();
1644  }
1645 }
1646 
1647 bool
1649 {
1650  return checkSigs_;
1651 }
1652 
1653 void
1655 {
1656  checkSigs_ = check;
1657 }
1658 
1659 bool
1661 {
1662  std::lock_guard lk{mut_};
1663  return isTimeToStop;
1664 }
1665 
1666 int
1668 {
1669  // Standard handles, config file, misc I/O etc:
1670  int needed = 128;
1671 
1672  // 2x the configured peer limit for peer connections:
1673  if (overlay_)
1674  needed += 2 * overlay_->limit();
1675 
1676  // the number of fds needed by the backend (internally
1677  // doubled if online delete is enabled).
1678  needed += std::max(5, m_shaMapStore->fdRequired());
1679 
1680  if (shardStore_)
1681  needed += shardStore_->fdRequired();
1682 
1683  // One fd per incoming connection a port can accept, or
1684  // if no limit is set, assume it'll handle 256 clients.
1685  for (auto const& p : serverHandler_->setup().ports)
1686  needed += std::max(256, p.limit);
1687 
1688  // The minimum number of file descriptors we need is 1024:
1689  return std::max(1024, needed);
1690 }
1691 
1692 //------------------------------------------------------------------------------
1693 
1694 void
1696 {
1697  std::vector<uint256> initialAmendments =
1698  (config_->START_UP == Config::FRESH) ? m_amendmentTable->getDesired()
1700 
1701  std::shared_ptr<Ledger> const genesis = std::make_shared<Ledger>(
1702  create_genesis, *config_, initialAmendments, nodeFamily_);
1703  m_ledgerMaster->storeLedger(genesis);
1704 
1705  auto const next =
1706  std::make_shared<Ledger>(*genesis, timeKeeper().closeTime());
1707  next->updateSkipList();
1708  next->setImmutable(*config_);
1709  openLedger_.emplace(next, cachedSLEs_, logs_->journal("OpenLedger"));
1710  m_ledgerMaster->storeLedger(next);
1711  m_ledgerMaster->switchLCL(next);
1712 }
1713 
1716 {
1717  auto j = journal("Ledger");
1718 
1719  try
1720  {
1721  auto const [ledger, seq, hash] = getLatestLedger(*this);
1722 
1723  if (!ledger)
1724  return ledger;
1725 
1726  ledger->setImmutable(*config_);
1727 
1728  if (getLedgerMaster().haveLedger(seq))
1729  ledger->setValidated();
1730 
1731  if (ledger->info().hash == hash)
1732  {
1733  JLOG(j.trace()) << "Loaded ledger: " << hash;
1734  return ledger;
1735  }
1736 
1737  if (auto stream = j.error())
1738  {
1739  stream << "Failed on ledger";
1740  Json::Value p;
1741  addJson(p, {*ledger, nullptr, LedgerFill::full});
1742  stream << p;
1743  }
1744 
1745  return {};
1746  }
1747  catch (SHAMapMissingNode const& mn)
1748  {
1749  JLOG(j.warn()) << "Ledger in database: " << mn.what();
1750  return {};
1751  }
1752 }
1753 
1756 {
1757  try
1758  {
1759  std::ifstream ledgerFile(name, std::ios::in);
1760 
1761  if (!ledgerFile)
1762  {
1763  JLOG(m_journal.fatal()) << "Unable to open file '" << name << "'";
1764  return nullptr;
1765  }
1766 
1767  Json::Reader reader;
1768  Json::Value jLedger;
1769 
1770  if (!reader.parse(ledgerFile, jLedger))
1771  {
1772  JLOG(m_journal.fatal()) << "Unable to parse ledger JSON";
1773  return nullptr;
1774  }
1775 
1776  std::reference_wrapper<Json::Value> ledger(jLedger);
1777 
1778  // accept a wrapped ledger
1779  if (ledger.get().isMember("result"))
1780  ledger = ledger.get()["result"];
1781 
1782  if (ledger.get().isMember("ledger"))
1783  ledger = ledger.get()["ledger"];
1784 
1785  std::uint32_t seq = 1;
1786  auto closeTime = timeKeeper().closeTime();
1787  using namespace std::chrono_literals;
1788  auto closeTimeResolution = 30s;
1789  bool closeTimeEstimated = false;
1790  std::uint64_t totalDrops = 0;
1791 
1792  if (ledger.get().isMember("accountState"))
1793  {
1794  if (ledger.get().isMember(jss::ledger_index))
1795  {
1796  seq = ledger.get()[jss::ledger_index].asUInt();
1797  }
1798 
1799  if (ledger.get().isMember("close_time"))
1800  {
1801  using tp = NetClock::time_point;
1802  using d = tp::duration;
1803  closeTime = tp{d{ledger.get()["close_time"].asUInt()}};
1804  }
1805  if (ledger.get().isMember("close_time_resolution"))
1806  {
1807  using namespace std::chrono;
1808  closeTimeResolution =
1809  seconds{ledger.get()["close_time_resolution"].asUInt()};
1810  }
1811  if (ledger.get().isMember("close_time_estimated"))
1812  {
1813  closeTimeEstimated =
1814  ledger.get()["close_time_estimated"].asBool();
1815  }
1816  if (ledger.get().isMember("total_coins"))
1817  {
1818  totalDrops = beast::lexicalCastThrow<std::uint64_t>(
1819  ledger.get()["total_coins"].asString());
1820  }
1821 
1822  ledger = ledger.get()["accountState"];
1823  }
1824 
1825  if (!ledger.get().isArrayOrNull())
1826  {
1827  JLOG(m_journal.fatal()) << "State nodes must be an array";
1828  return nullptr;
1829  }
1830 
1831  auto loadLedger =
1832  std::make_shared<Ledger>(seq, closeTime, *config_, nodeFamily_);
1833  loadLedger->setTotalDrops(totalDrops);
1834 
1835  for (Json::UInt index = 0; index < ledger.get().size(); ++index)
1836  {
1837  Json::Value& entry = ledger.get()[index];
1838 
1839  if (!entry.isObjectOrNull())
1840  {
1841  JLOG(m_journal.fatal()) << "Invalid entry in ledger";
1842  return nullptr;
1843  }
1844 
1845  uint256 uIndex;
1846 
1847  if (!uIndex.parseHex(entry[jss::index].asString()))
1848  {
1849  JLOG(m_journal.fatal()) << "Invalid entry in ledger";
1850  return nullptr;
1851  }
1852 
1853  entry.removeMember(jss::index);
1854 
1855  STParsedJSONObject stp("sle", ledger.get()[index]);
1856 
1857  if (!stp.object || uIndex.isZero())
1858  {
1859  JLOG(m_journal.fatal()) << "Invalid entry in ledger";
1860  return nullptr;
1861  }
1862 
1863  // VFALCO TODO This is the only place that
1864  // constructor is used, try to remove it
1865  STLedgerEntry sle(*stp.object, uIndex);
1866 
1867  if (!loadLedger->addSLE(sle))
1868  {
1869  JLOG(m_journal.fatal())
1870  << "Couldn't add serialized ledger: " << uIndex;
1871  return nullptr;
1872  }
1873  }
1874 
1875  loadLedger->stateMap().flushDirty(hotACCOUNT_NODE);
1876 
1877  loadLedger->setAccepted(
1878  closeTime, closeTimeResolution, !closeTimeEstimated, *config_);
1879 
1880  return loadLedger;
1881  }
1882  catch (std::exception const& x)
1883  {
1884  JLOG(m_journal.fatal()) << "Ledger contains invalid data: " << x.what();
1885  return nullptr;
1886  }
1887 }
1888 
1889 bool
1891  std::string const& ledgerID,
1892  bool replay,
1893  bool isFileName)
1894 {
1895  try
1896  {
1897  std::shared_ptr<Ledger const> loadLedger, replayLedger;
1898 
1899  if (isFileName)
1900  {
1901  if (!ledgerID.empty())
1902  loadLedger = loadLedgerFromFile(ledgerID);
1903  }
1904  else if (ledgerID.length() == 64)
1905  {
1906  uint256 hash;
1907 
1908  if (hash.parseHex(ledgerID))
1909  {
1910  loadLedger = loadByHash(hash, *this);
1911 
1912  if (!loadLedger)
1913  {
1914  // Try to build the ledger from the back end
1915  auto il = std::make_shared<InboundLedger>(
1916  *this,
1917  hash,
1918  0,
1920  stopwatch(),
1921  make_DummyPeerSet(*this));
1922  if (il->checkLocal())
1923  loadLedger = il->getLedger();
1924  }
1925  }
1926  }
1927  else if (ledgerID.empty() || boost::iequals(ledgerID, "latest"))
1928  {
1929  loadLedger = getLastFullLedger();
1930  }
1931  else
1932  {
1933  // assume by sequence
1934  std::uint32_t index;
1935 
1936  if (beast::lexicalCastChecked(index, ledgerID))
1937  loadLedger = loadByIndex(index, *this);
1938  }
1939 
1940  if (!loadLedger)
1941  return false;
1942 
1943  if (replay)
1944  {
1945  // Replay a ledger close with same prior ledger and transactions
1946 
1947  // this ledger holds the transactions we want to replay
1948  replayLedger = loadLedger;
1949 
1950  JLOG(m_journal.info()) << "Loading parent ledger";
1951 
1952  loadLedger = loadByHash(replayLedger->info().parentHash, *this);
1953  if (!loadLedger)
1954  {
1955  JLOG(m_journal.info())
1956  << "Loading parent ledger from node store";
1957 
1958  // Try to build the ledger from the back end
1959  auto il = std::make_shared<InboundLedger>(
1960  *this,
1961  replayLedger->info().parentHash,
1962  0,
1964  stopwatch(),
1965  make_DummyPeerSet(*this));
1966 
1967  if (il->checkLocal())
1968  loadLedger = il->getLedger();
1969 
1970  if (!loadLedger)
1971  {
1972  JLOG(m_journal.fatal()) << "Replay ledger missing/damaged";
1973  assert(false);
1974  return false;
1975  }
1976  }
1977  }
1978  using namespace std::chrono_literals;
1979  using namespace date;
1980  static constexpr NetClock::time_point ledgerWarnTimePoint{
1981  sys_days{January / 1 / 2018} - sys_days{January / 1 / 2000}};
1982  if (loadLedger->info().closeTime < ledgerWarnTimePoint)
1983  {
1984  JLOG(m_journal.fatal())
1985  << "\n\n*** WARNING ***\n"
1986  "You are replaying a ledger from before "
1987  << to_string(ledgerWarnTimePoint)
1988  << " UTC.\n"
1989  "This replay will not handle your ledger as it was "
1990  "originally "
1991  "handled.\nConsider running an earlier version of rippled "
1992  "to "
1993  "get the older rules.\n*** CONTINUING ***\n";
1994  }
1995 
1996  JLOG(m_journal.info()) << "Loading ledger " << loadLedger->info().hash
1997  << " seq:" << loadLedger->info().seq;
1998 
1999  if (loadLedger->info().accountHash.isZero())
2000  {
2001  JLOG(m_journal.fatal()) << "Ledger is empty.";
2002  assert(false);
2003  return false;
2004  }
2005 
2006  if (!loadLedger->walkLedger(journal("Ledger")))
2007  {
2008  JLOG(m_journal.fatal()) << "Ledger is missing nodes.";
2009  assert(false);
2010  return false;
2011  }
2012 
2013  if (!loadLedger->assertSensible(journal("Ledger")))
2014  {
2015  JLOG(m_journal.fatal()) << "Ledger is not sensible.";
2016  assert(false);
2017  return false;
2018  }
2019 
2020  m_ledgerMaster->setLedgerRangePresent(
2021  loadLedger->info().seq, loadLedger->info().seq);
2022 
2023  m_ledgerMaster->switchLCL(loadLedger);
2024  loadLedger->setValidated();
2025  m_ledgerMaster->setFullLedger(loadLedger, true, false);
2026  openLedger_.emplace(
2027  loadLedger, cachedSLEs_, logs_->journal("OpenLedger"));
2028 
2029  if (replay)
2030  {
2031  // inject transaction(s) from the replayLedger into our open ledger
2032  // and build replay structure
2033  auto replayData =
2034  std::make_unique<LedgerReplay>(loadLedger, replayLedger);
2035 
2036  for (auto const& [_, tx] : replayData->orderedTxns())
2037  {
2038  (void)_;
2039  auto txID = tx->getTransactionID();
2040 
2041  auto s = std::make_shared<Serializer>();
2042  tx->add(*s);
2043 
2045 
2046  openLedger_->modify(
2047  [&txID, &s](OpenView& view, beast::Journal j) {
2048  view.rawTxInsert(txID, std::move(s), nullptr);
2049  return true;
2050  });
2051  }
2052 
2053  m_ledgerMaster->takeReplay(std::move(replayData));
2054  }
2055  }
2056  catch (SHAMapMissingNode const& mn)
2057  {
2058  JLOG(m_journal.fatal())
2059  << "While loading specified ledger: " << mn.what();
2060  return false;
2061  }
2062  catch (boost::bad_lexical_cast&)
2063  {
2064  JLOG(m_journal.fatal())
2065  << "Ledger specified '" << ledgerID << "' is not valid";
2066  return false;
2067  }
2068 
2069  return true;
2070 }
2071 
2072 bool
2074 {
2075  if (!config().ELB_SUPPORT)
2076  return true;
2077 
2078  if (isStopping())
2079  {
2080  reason = "Server is shutting down";
2081  return false;
2082  }
2083 
2084  if (getOPs().isNeedNetworkLedger())
2085  {
2086  reason = "Not synchronized with network yet";
2087  return false;
2088  }
2089 
2090  if (getOPs().isAmendmentBlocked())
2091  {
2092  reason = "Server version too old";
2093  return false;
2094  }
2095 
2096  if (getOPs().isUNLBlocked())
2097  {
2098  reason = "No valid validator list available";
2099  return false;
2100  }
2101 
2102  if (getOPs().getOperatingMode() < OperatingMode::SYNCING)
2103  {
2104  reason = "Not synchronized with network";
2105  return false;
2106  }
2107 
2108  if (!getLedgerMaster().isCaughtUp(reason))
2109  return false;
2110 
2111  if (getFeeTrack().isLoadedLocal())
2112  {
2113  reason = "Too much load";
2114  return false;
2115  }
2116 
2117  return true;
2118 }
2119 
2122 {
2123  return logs_->journal(name);
2124 }
2125 
2126 bool
2128 {
2129  assert(overlay_);
2130  assert(!config_->standalone());
2131 
2132  if (config_->section(ConfigSection::shardDatabase()).empty())
2133  {
2134  JLOG(m_journal.fatal())
2135  << "The [shard_db] configuration setting must be set";
2136  return false;
2137  }
2138  if (!shardStore_)
2139  {
2140  JLOG(m_journal.fatal()) << "Invalid [shard_db] configuration";
2141  return false;
2142  }
2143  shardStore_->importDatabase(getNodeStore());
2144  return true;
2145 }
2146 
2147 void
2149 {
2151  if (seq)
2152  maxDisallowedLedger_ = *seq;
2153 
2154  JLOG(m_journal.trace())
2155  << "Max persisted ledger is " << maxDisallowedLedger_;
2156 }
2157 
2158 //------------------------------------------------------------------------------
2159 
2160 Application::Application() : beast::PropertyStream::Source("app")
2161 {
2162 }
2163 
2164 //------------------------------------------------------------------------------
2165 
2168  std::unique_ptr<Config> config,
2169  std::unique_ptr<Logs> logs,
2170  std::unique_ptr<TimeKeeper> timeKeeper)
2171 {
2172  return std::make_unique<ApplicationImp>(
2173  std::move(config), std::move(logs), std::move(timeKeeper));
2174 }
2175 
2176 } // 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:1839
ripple::ApplicationImp::getReportingETL
ReportingETL & getReportingETL() override
Definition: Application.cpp:888
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:573
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:2230
ripple::NodeFamily::sweep
void sweep() override
Definition: NodeFamily.cpp:49
ripple::ApplicationImp::getShardFamily
Family * getShardFamily() override
Definition: Application.cpp:549
ripple::LoadManager
Manages load sources.
Definition: LoadManager.h:45
ripple::ApplicationImp::validators
ValidatorList & validators() override
Definition: Application.cpp:790
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:760
std::shared_ptr
STL class.
ripple::ApplicationImp::getNodeStore
NodeStore::Database & getNodeStore() override
Definition: Application.cpp:658
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:2073
ripple::loadByIndex
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition: Ledger.cpp:1061
utility
ripple::LedgerMaster::sweep
void sweep()
Definition: LedgerMaster.cpp:1829
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:627
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:778
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:754
ripple::ApplicationImp::m_orderBookDB
OrderBookDB m_orderBookDB
Definition: Application.cpp:196
ripple::ApplicationImp::stop
void stop()
Definition: Application.cpp:972
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:1068
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:615
ripple::ApplicationImp::accountIDCache
AccountIDCache const & accountIDCache() const override
Definition: Application.cpp:838
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:609
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:579
ripple::ApplicationImp::run
void run() override
Definition: Application.cpp:1612
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:195
ripple::ApplicationImp::m_acceptedLedgerCache
TaggedCache< uint256, AcceptedLedger > m_acceptedLedgerCache
Definition: Application.cpp:203
ripple::ApplicationImp::setup
bool setup() override
Definition: Application.cpp:1206
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:802
ripple::ApplicationImp::getWalletDB
DatabaseCon & getWalletDB() override
Retrieve the "wallet database".
Definition: Application.cpp:881
ripple::getLatestLedger
std::tuple< std::shared_ptr< Ledger >, std::uint32_t, uint256 > getLatestLedger(Application &app)
Definition: Ledger.cpp:1051
ripple::ApplicationImp::getCollectorManager
CollectorManager & getCollectorManager() override
Definition: Application.cpp:535
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:666
ripple::ApplicationImp::openLedger
OpenLedger const & openLedger() const override
Definition: Application.cpp:852
ripple::ApplicationImp::getIOLatency
std::chrono::milliseconds getIOLatency() override
Definition: Application.cpp:591
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:585
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:47
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:263
ripple::ApplicationImp::signalStop
void signalStop() override
Definition: Application.cpp:1634
ripple::ApplicationImp::cluster
Cluster & cluster() override
Definition: Application.cpp:814
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:4432
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:597
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::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:672
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:1171
ripple::ApplicationImp::loadLedgerFromFile
std::shared_ptr< Ledger > loadLedgerFromFile(std::string const &ledgerID)
Definition: Application.cpp:1755
ripple::ApplicationImp::checkSigs
bool checkSigs() const override
Definition: Application.cpp:1648
ripple::ApplicationImp::journal
beast::Journal journal(std::string const &name) override
Definition: Application.cpp:2121
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:1173
ripple::ApplicationImp::nodeToShards
bool nodeToShards()
Definition: Application.cpp:2127
ripple::ApplicationImp::hashRouter_
std::unique_ptr< HashRouter > hashRouter_
Definition: Application.cpp:214
ripple::ApplicationImp::getMasterMutex
Application::MutexType & getMasterMutex() override
Definition: Application.cpp:730
ripple::HashRouter::getDefaultRecoverLimit
static std::uint32_t getDefaultRecoverLimit()
Definition: HashRouter.h:162
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:246
ripple::setup_Overlay
Overlay::Setup setup_Overlay(BasicConfig const &config)
Definition: OverlayImpl.cpp:1537
ripple::ApplicationImp::logs
Logs & logs() override
Definition: Application.cpp:523
ripple::Config::reporting
bool reporting() const
Definition: Config.h:308
ripple::ApplicationImp::getPerfLog
perf::PerfLog & getPerfLog() override
Definition: Application.cpp:646
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:1183
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:1074
ripple::TxQ
Transaction Queue.
Definition: TxQ.h:56
ripple::Config::FORCE_MULTI_THREAD
bool FORCE_MULTI_THREAD
Definition: Config.h:218
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:826
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:766
ripple::ApplicationImp::loadOldLedger
bool loadOldLedger(std::string const &ledgerID, bool replay, bool isFilename)
Definition: Application.cpp:1890
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:742
ripple::ApplicationImp::peerReservations
PeerReservationTable & peerReservations() override
Definition: Application.cpp:820
ripple::ApplicationImp::publisherManifests
ManifestCache & publisherManifests() override
Definition: Application.cpp:808
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:860
ripple::megabytes
constexpr auto megabytes(T value) noexcept
Definition: ByteUtilities.h:34
ripple::ApplicationImp::pendingSaves
PendingSaves & pendingSaves() override
Definition: Application.cpp:832
ripple::ApplicationImp::m_collectorManager
std::unique_ptr< CollectorManager > m_collectorManager
Definition: Application.cpp:175
ripple::Config::standalone
bool standalone() const
Definition: Config.h:303
ripple::ApplicationImp::nodeFamily_
NodeFamily nodeFamily_
Definition: Application.cpp:191
ripple::HashRouter::getDefaultHoldTime
static std::chrono::seconds getDefaultHoldTime()
Definition: HashRouter.h:154
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:43
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:796
ripple::ApplicationImp::nodeIdentity
std::pair< PublicKey, SecretKey > const & nodeIdentity() override
Definition: Application.cpp:567
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:61
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:1715
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:216
std::condition_variable::wait
T wait(T... args)
ripple::ApplicationImp::gotTXSet
void gotTXSet(std::shared_ptr< SHAMap > const &set, bool fromAcquire)
Definition: Application.cpp:633
std::atomic< std::chrono::milliseconds >
ripple::ApplicationImp::startGenesisLedger
void startGenesisLedger()
Definition: Application.cpp:1695
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:555
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:874
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:2160
std::min
T min(T... args)
ripple::ApplicationImp::setMaxDisallowedLedger
void setMaxDisallowedLedger()
Definition: Application.cpp:2148
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:1075
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:74
ripple::ApplicationImp::openLedger
OpenLedger & openLedger() override
Definition: Application.cpp:844
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:867
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:652
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:561
ripple::ApplicationImp::fdRequired
int fdRequired() const override
Definition: Application.cpp:1667
ripple::ApplicationImp::doSweep
void doSweep()
Definition: Application.cpp:1135
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:748
ripple::ApplicationImp
Definition: Application.cpp:96
ripple::ApplicationImp::initRDBMS
bool initRDBMS()
Definition: Application.cpp:903
ripple::ApplicationImp::getLoadManager
LoadManager & getLoadManager() override
Definition: Application.cpp:736
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:1660
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:621
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:33
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:224
ripple::ApplicationImp::mFeeTrack
std::unique_ptr< LoadFeeTrack > mFeeTrack
Definition: Application.cpp:213
ripple::ApplicationImp::getFeeTrack
LoadFeeTrack & getFeeTrack() override
Definition: Application.cpp:772
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:529
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:603
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:541
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:929
ripple::ApplicationImp::maxDisallowedLedger_
std::atomic< LedgerIndex > maxDisallowedLedger_
Definition: Application.cpp:1181
ripple::make_SHAMapStore
std::unique_ptr< SHAMapStore > make_SHAMapStore(Application &app, NodeStore::Scheduler &scheduler, beast::Journal journal)
Definition: SHAMapStoreImp.cpp:738
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:640
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:784
ripple::ApplicationImp::setEntropyTimer
void setEntropyTimer()
Definition: Application.cpp:1106
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:2167
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:1589
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