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]() { 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.
1343  }
1344  else
1345  {
1346  return false;
1347  }
1348  }
1349  }
1350  else if (startUp == Config::NETWORK)
1351  {
1352  // This should probably become the default once we have a stable
1353  // network.
1354  if (!config_->standalone())
1355  m_networkOPs->setNeedNetworkLedger();
1356 
1358  }
1359  else
1360  {
1362  }
1363  }
1364 
1365  if (!config().reporting())
1366  m_orderBookDB.setup(getLedgerMaster().getCurrentLedger());
1367 
1368  nodeIdentity_ = getNodeIdentity(*this);
1369 
1370  if (!cluster_->load(config().section(SECTION_CLUSTER_NODES)))
1371  {
1372  JLOG(m_journal.fatal()) << "Invalid entry in cluster configuration.";
1373  return false;
1374  }
1375 
1376  if (!config().reporting())
1377  {
1378  {
1380  return false;
1381 
1382  if (!validatorManifests_->load(
1383  getWalletDB(),
1384  "ValidatorManifests",
1386  config()
1387  .section(SECTION_VALIDATOR_KEY_REVOCATION)
1388  .values()))
1389  {
1390  JLOG(m_journal.fatal())
1391  << "Invalid configured validator manifest.";
1392  return false;
1393  }
1394 
1395  publisherManifests_->load(getWalletDB(), "PublisherManifests");
1396 
1397  // Setup trusted validators
1398  if (!validators_->load(
1400  config().section(SECTION_VALIDATORS).values(),
1401  config().section(SECTION_VALIDATOR_LIST_KEYS).values()))
1402  {
1403  JLOG(m_journal.fatal())
1404  << "Invalid entry in validator configuration.";
1405  return false;
1406  }
1407  }
1408 
1409  if (!validatorSites_->load(
1410  config().section(SECTION_VALIDATOR_LIST_SITES).values()))
1411  {
1412  JLOG(m_journal.fatal())
1413  << "Invalid entry in [" << SECTION_VALIDATOR_LIST_SITES << "]";
1414  return false;
1415  }
1416  }
1417  //----------------------------------------------------------------------
1418  //
1419  // Server
1420  //
1421  //----------------------------------------------------------------------
1422 
1423  // VFALCO NOTE Unfortunately, in stand-alone mode some code still
1424  // foolishly calls overlay(). When this is fixed we can
1425  // move the instantiation inside a conditional:
1426  //
1427  // if (!config_.standalone())
1428  if (!config_->reporting())
1429  {
1431  *this,
1433  *serverHandler_,
1435  *m_resolver,
1436  get_io_service(),
1437  *config_,
1438  m_collectorManager->collector());
1439  add(*overlay_); // add to PropertyStream
1440  }
1441 
1442  if (!config_->standalone())
1443  {
1444  // NodeStore import into the ShardStore requires the SQLite database
1445  if (config_->nodeToShard && !nodeToShards())
1446  return false;
1447  }
1448 
1449  // start first consensus round
1450  if (!config_->reporting() &&
1451  !m_networkOPs->beginConsensus(
1452  m_ledgerMaster->getClosedLedger()->info().hash))
1453  {
1454  JLOG(m_journal.fatal()) << "Unable to start consensus";
1455  return false;
1456  }
1457 
1458  {
1459  try
1460  {
1461  auto setup = setup_ServerHandler(
1463  setup.makeContexts();
1464  serverHandler_->setup(setup, m_journal);
1465  }
1466  catch (std::exception const& e)
1467  {
1468  if (auto stream = m_journal.fatal())
1469  {
1470  stream << "Unable to setup server handler";
1471  if (std::strlen(e.what()) > 0)
1472  stream << ": " << e.what();
1473  }
1474  return false;
1475  }
1476  }
1477 
1478  // Begin connecting to network.
1479  if (!config_->standalone())
1480  {
1481  // Should this message be here, conceptually? In theory this sort
1482  // of message, if displayed, should be displayed from PeerFinder.
1483  if (config_->PEER_PRIVATE && config_->IPS_FIXED.empty())
1484  {
1485  JLOG(m_journal.warn())
1486  << "No outbound peer connections will be made";
1487  }
1488 
1489  // VFALCO NOTE the state timer resets the deadlock detector.
1490  //
1491  m_networkOPs->setStateTimer();
1492  }
1493  else
1494  {
1495  JLOG(m_journal.warn()) << "Running in standalone mode";
1496 
1497  m_networkOPs->setStandAlone();
1498  }
1499 
1500  if (config_->canSign())
1501  {
1502  JLOG(m_journal.warn()) << "*** The server is configured to allow the "
1503  "'sign' and 'sign_for'";
1504  JLOG(m_journal.warn()) << "*** commands. These commands have security "
1505  "implications and have";
1506  JLOG(m_journal.warn()) << "*** been deprecated. They will be removed "
1507  "in a future release of";
1508  JLOG(m_journal.warn()) << "*** rippled.";
1509  JLOG(m_journal.warn()) << "*** If you do not use them to sign "
1510  "transactions please edit your";
1511  JLOG(m_journal.warn())
1512  << "*** configuration file and remove the [enable_signing] stanza.";
1513  JLOG(m_journal.warn()) << "*** If you do use them to sign transactions "
1514  "please migrate to a";
1515  JLOG(m_journal.warn())
1516  << "*** standalone signing solution as soon as possible.";
1517  }
1518 
1519  //
1520  // Execute start up rpc commands.
1521  //
1522  for (auto cmd : config_->section(SECTION_RPC_STARTUP).lines())
1523  {
1524  Json::Reader jrReader;
1525  Json::Value jvCommand;
1526 
1527  if (!jrReader.parse(cmd, jvCommand))
1528  {
1529  JLOG(m_journal.fatal()) << "Couldn't parse entry in ["
1530  << SECTION_RPC_STARTUP << "]: '" << cmd;
1531  }
1532 
1533  if (!config_->quiet())
1534  {
1535  JLOG(m_journal.fatal())
1536  << "Startup RPC: " << jvCommand << std::endl;
1537  }
1538 
1541  RPC::JsonContext context{
1542  {journal("RPCHandler"),
1543  *this,
1544  loadType,
1545  getOPs(),
1546  getLedgerMaster(),
1547  c,
1548  Role::ADMIN,
1549  {},
1550  {},
1552  jvCommand};
1553 
1554  Json::Value jvResult;
1555  RPC::doCommand(context, jvResult);
1556 
1557  if (!config_->quiet())
1558  {
1559  JLOG(m_journal.fatal()) << "Result: " << jvResult << std::endl;
1560  }
1561  }
1562 
1563  RPC::ShardArchiveHandler* shardArchiveHandler = nullptr;
1564  if (shardStore_)
1565  {
1566  try
1567  {
1568  // Create a ShardArchiveHandler if recovery
1569  // is needed (there's a state database left
1570  // over from a previous run).
1571  auto handler = getShardArchiveHandler(true);
1572 
1573  // Recovery is needed.
1574  if (handler)
1575  shardArchiveHandler = handler;
1576  }
1577  catch (std::exception const& e)
1578  {
1579  JLOG(m_journal.fatal())
1580  << "Exception when starting ShardArchiveHandler from "
1581  "state database: "
1582  << e.what();
1583 
1584  return false;
1585  }
1586  }
1587 
1588  if (shardArchiveHandler && !shardArchiveHandler->start())
1589  {
1590  JLOG(m_journal.fatal()) << "Failed to start ShardArchiveHandler.";
1591 
1592  return false;
1593  }
1594 
1595  validatorSites_->start();
1596 
1597  if (reportingETL_)
1598  reportingETL_->start();
1599 
1600  return true;
1601 }
1602 
1603 void
1604 ApplicationImp::start(bool withTimers)
1605 {
1606  JLOG(m_journal.info()) << "Application starting. Version is "
1608 
1609  if (withTimers)
1610  {
1611  setSweepTimer();
1612  setEntropyTimer();
1613  }
1614 
1616  m_resolver->start();
1617  m_loadManager->start();
1618  m_shaMapStore->start();
1619  if (overlay_)
1620  overlay_->start();
1621  grpcServer_->start();
1622  ledgerCleaner_->start();
1623  perfLog_->start();
1624 }
1625 
1626 void
1628 {
1629  if (!config_->standalone())
1630  {
1631  // VFALCO NOTE This seems unnecessary. If we properly refactor the load
1632  // manager then the deadlock detector can just always be
1633  // "armed"
1634  //
1636  }
1637 
1638  {
1640  cv_.wait(lk, [this] { return isTimeToStop; });
1641  }
1642 
1643  JLOG(m_journal.info()) << "Received shutdown request";
1644  stop();
1645  JLOG(m_journal.info()) << "Done.";
1646 }
1647 
1648 void
1650 {
1651  // Unblock the main thread (which is sitting in run()).
1652  // When we get C++20 this can use std::latch.
1653  std::lock_guard lk{mut_};
1654 
1655  if (!isTimeToStop)
1656  {
1657  isTimeToStop = true;
1658  cv_.notify_all();
1659  }
1660 }
1661 
1662 bool
1664 {
1665  return checkSigs_;
1666 }
1667 
1668 void
1670 {
1671  checkSigs_ = check;
1672 }
1673 
1674 bool
1676 {
1677  std::lock_guard lk{mut_};
1678  return isTimeToStop;
1679 }
1680 
1681 int
1683 {
1684  // Standard handles, config file, misc I/O etc:
1685  int needed = 128;
1686 
1687  // 2x the configured peer limit for peer connections:
1688  if (overlay_)
1689  needed += 2 * overlay_->limit();
1690 
1691  // the number of fds needed by the backend (internally
1692  // doubled if online delete is enabled).
1693  needed += std::max(5, m_shaMapStore->fdRequired());
1694 
1695  if (shardStore_)
1696  needed += shardStore_->fdRequired();
1697 
1698  // One fd per incoming connection a port can accept, or
1699  // if no limit is set, assume it'll handle 256 clients.
1700  for (auto const& p : serverHandler_->setup().ports)
1701  needed += std::max(256, p.limit);
1702 
1703  // The minimum number of file descriptors we need is 1024:
1704  return std::max(1024, needed);
1705 }
1706 
1707 //------------------------------------------------------------------------------
1708 
1709 void
1711 {
1712  std::vector<uint256> initialAmendments =
1713  (config_->START_UP == Config::FRESH) ? m_amendmentTable->getDesired()
1715 
1716  std::shared_ptr<Ledger> const genesis = std::make_shared<Ledger>(
1717  create_genesis, *config_, initialAmendments, nodeFamily_);
1718  m_ledgerMaster->storeLedger(genesis);
1719 
1720  auto const next =
1721  std::make_shared<Ledger>(*genesis, timeKeeper().closeTime());
1722  next->updateSkipList();
1723  next->setImmutable(*config_);
1724  openLedger_.emplace(next, cachedSLEs_, logs_->journal("OpenLedger"));
1725  m_ledgerMaster->storeLedger(next);
1726  m_ledgerMaster->switchLCL(next);
1727 }
1728 
1731 {
1732  auto j = journal("Ledger");
1733 
1734  try
1735  {
1736  auto const [ledger, seq, hash] = getLatestLedger(*this);
1737 
1738  if (!ledger)
1739  return ledger;
1740 
1741  ledger->setImmutable(*config_);
1742 
1743  if (getLedgerMaster().haveLedger(seq))
1744  ledger->setValidated();
1745 
1746  if (ledger->info().hash == hash)
1747  {
1748  JLOG(j.trace()) << "Loaded ledger: " << hash;
1749  return ledger;
1750  }
1751 
1752  if (auto stream = j.error())
1753  {
1754  stream << "Failed on ledger";
1755  Json::Value p;
1756  addJson(p, {*ledger, nullptr, LedgerFill::full});
1757  stream << p;
1758  }
1759 
1760  return {};
1761  }
1762  catch (SHAMapMissingNode const& mn)
1763  {
1764  JLOG(j.warn()) << "Ledger in database: " << mn.what();
1765  return {};
1766  }
1767 }
1768 
1771 {
1772  try
1773  {
1774  std::ifstream ledgerFile(name, std::ios::in);
1775 
1776  if (!ledgerFile)
1777  {
1778  JLOG(m_journal.fatal()) << "Unable to open file '" << name << "'";
1779  return nullptr;
1780  }
1781 
1782  Json::Reader reader;
1783  Json::Value jLedger;
1784 
1785  if (!reader.parse(ledgerFile, jLedger))
1786  {
1787  JLOG(m_journal.fatal()) << "Unable to parse ledger JSON";
1788  return nullptr;
1789  }
1790 
1791  std::reference_wrapper<Json::Value> ledger(jLedger);
1792 
1793  // accept a wrapped ledger
1794  if (ledger.get().isMember("result"))
1795  ledger = ledger.get()["result"];
1796 
1797  if (ledger.get().isMember("ledger"))
1798  ledger = ledger.get()["ledger"];
1799 
1800  std::uint32_t seq = 1;
1801  auto closeTime = timeKeeper().closeTime();
1802  using namespace std::chrono_literals;
1803  auto closeTimeResolution = 30s;
1804  bool closeTimeEstimated = false;
1805  std::uint64_t totalDrops = 0;
1806 
1807  if (ledger.get().isMember("accountState"))
1808  {
1809  if (ledger.get().isMember(jss::ledger_index))
1810  {
1811  seq = ledger.get()[jss::ledger_index].asUInt();
1812  }
1813 
1814  if (ledger.get().isMember("close_time"))
1815  {
1816  using tp = NetClock::time_point;
1817  using d = tp::duration;
1818  closeTime = tp{d{ledger.get()["close_time"].asUInt()}};
1819  }
1820  if (ledger.get().isMember("close_time_resolution"))
1821  {
1822  using namespace std::chrono;
1823  closeTimeResolution =
1824  seconds{ledger.get()["close_time_resolution"].asUInt()};
1825  }
1826  if (ledger.get().isMember("close_time_estimated"))
1827  {
1828  closeTimeEstimated =
1829  ledger.get()["close_time_estimated"].asBool();
1830  }
1831  if (ledger.get().isMember("total_coins"))
1832  {
1833  totalDrops = beast::lexicalCastThrow<std::uint64_t>(
1834  ledger.get()["total_coins"].asString());
1835  }
1836 
1837  ledger = ledger.get()["accountState"];
1838  }
1839 
1840  if (!ledger.get().isArrayOrNull())
1841  {
1842  JLOG(m_journal.fatal()) << "State nodes must be an array";
1843  return nullptr;
1844  }
1845 
1846  auto loadLedger =
1847  std::make_shared<Ledger>(seq, closeTime, *config_, nodeFamily_);
1848  loadLedger->setTotalDrops(totalDrops);
1849 
1850  for (Json::UInt index = 0; index < ledger.get().size(); ++index)
1851  {
1852  Json::Value& entry = ledger.get()[index];
1853 
1854  if (!entry.isObjectOrNull())
1855  {
1856  JLOG(m_journal.fatal()) << "Invalid entry in ledger";
1857  return nullptr;
1858  }
1859 
1860  uint256 uIndex;
1861 
1862  if (!uIndex.parseHex(entry[jss::index].asString()))
1863  {
1864  JLOG(m_journal.fatal()) << "Invalid entry in ledger";
1865  return nullptr;
1866  }
1867 
1868  entry.removeMember(jss::index);
1869 
1870  STParsedJSONObject stp("sle", ledger.get()[index]);
1871 
1872  if (!stp.object || uIndex.isZero())
1873  {
1874  JLOG(m_journal.fatal()) << "Invalid entry in ledger";
1875  return nullptr;
1876  }
1877 
1878  // VFALCO TODO This is the only place that
1879  // constructor is used, try to remove it
1880  STLedgerEntry sle(*stp.object, uIndex);
1881 
1882  if (!loadLedger->addSLE(sle))
1883  {
1884  JLOG(m_journal.fatal())
1885  << "Couldn't add serialized ledger: " << uIndex;
1886  return nullptr;
1887  }
1888  }
1889 
1890  loadLedger->stateMap().flushDirty(hotACCOUNT_NODE);
1891 
1892  loadLedger->setAccepted(
1893  closeTime, closeTimeResolution, !closeTimeEstimated, *config_);
1894 
1895  return loadLedger;
1896  }
1897  catch (std::exception const& x)
1898  {
1899  JLOG(m_journal.fatal()) << "Ledger contains invalid data: " << x.what();
1900  return nullptr;
1901  }
1902 }
1903 
1904 bool
1906  std::string const& ledgerID,
1907  bool replay,
1908  bool isFileName)
1909 {
1910  try
1911  {
1912  std::shared_ptr<Ledger const> loadLedger, replayLedger;
1913 
1914  if (isFileName)
1915  {
1916  if (!ledgerID.empty())
1917  loadLedger = loadLedgerFromFile(ledgerID);
1918  }
1919  else if (ledgerID.length() == 64)
1920  {
1921  uint256 hash;
1922 
1923  if (hash.parseHex(ledgerID))
1924  {
1925  loadLedger = loadByHash(hash, *this);
1926 
1927  if (!loadLedger)
1928  {
1929  // Try to build the ledger from the back end
1930  auto il = std::make_shared<InboundLedger>(
1931  *this,
1932  hash,
1933  0,
1935  stopwatch(),
1936  make_DummyPeerSet(*this));
1937  if (il->checkLocal())
1938  loadLedger = il->getLedger();
1939  }
1940  }
1941  }
1942  else if (ledgerID.empty() || boost::iequals(ledgerID, "latest"))
1943  {
1944  loadLedger = getLastFullLedger();
1945  }
1946  else
1947  {
1948  // assume by sequence
1949  std::uint32_t index;
1950 
1951  if (beast::lexicalCastChecked(index, ledgerID))
1952  loadLedger = loadByIndex(index, *this);
1953  }
1954 
1955  if (!loadLedger)
1956  return false;
1957 
1958  if (replay)
1959  {
1960  // Replay a ledger close with same prior ledger and transactions
1961 
1962  // this ledger holds the transactions we want to replay
1963  replayLedger = loadLedger;
1964 
1965  JLOG(m_journal.info()) << "Loading parent ledger";
1966 
1967  loadLedger = loadByHash(replayLedger->info().parentHash, *this);
1968  if (!loadLedger)
1969  {
1970  JLOG(m_journal.info())
1971  << "Loading parent ledger from node store";
1972 
1973  // Try to build the ledger from the back end
1974  auto il = std::make_shared<InboundLedger>(
1975  *this,
1976  replayLedger->info().parentHash,
1977  0,
1979  stopwatch(),
1980  make_DummyPeerSet(*this));
1981 
1982  if (il->checkLocal())
1983  loadLedger = il->getLedger();
1984 
1985  if (!loadLedger)
1986  {
1987  JLOG(m_journal.fatal()) << "Replay ledger missing/damaged";
1988  assert(false);
1989  return false;
1990  }
1991  }
1992  }
1993  using namespace std::chrono_literals;
1994  using namespace date;
1995  static constexpr NetClock::time_point ledgerWarnTimePoint{
1996  sys_days{January / 1 / 2018} - sys_days{January / 1 / 2000}};
1997  if (loadLedger->info().closeTime < ledgerWarnTimePoint)
1998  {
1999  JLOG(m_journal.fatal())
2000  << "\n\n*** WARNING ***\n"
2001  "You are replaying a ledger from before "
2002  << to_string(ledgerWarnTimePoint)
2003  << " UTC.\n"
2004  "This replay will not handle your ledger as it was "
2005  "originally "
2006  "handled.\nConsider running an earlier version of rippled "
2007  "to "
2008  "get the older rules.\n*** CONTINUING ***\n";
2009  }
2010 
2011  JLOG(m_journal.info()) << "Loading ledger " << loadLedger->info().hash
2012  << " seq:" << loadLedger->info().seq;
2013 
2014  if (loadLedger->info().accountHash.isZero())
2015  {
2016  JLOG(m_journal.fatal()) << "Ledger is empty.";
2017  assert(false);
2018  return false;
2019  }
2020 
2021  if (!loadLedger->walkLedger(journal("Ledger"), true))
2022  {
2023  JLOG(m_journal.fatal()) << "Ledger is missing nodes.";
2024  assert(false);
2025  return false;
2026  }
2027 
2028  if (!loadLedger->assertSensible(journal("Ledger")))
2029  {
2030  JLOG(m_journal.fatal()) << "Ledger is not sensible.";
2031  assert(false);
2032  return false;
2033  }
2034 
2035  m_ledgerMaster->setLedgerRangePresent(
2036  loadLedger->info().seq, loadLedger->info().seq);
2037 
2038  m_ledgerMaster->switchLCL(loadLedger);
2039  loadLedger->setValidated();
2040  m_ledgerMaster->setFullLedger(loadLedger, true, false);
2041  openLedger_.emplace(
2042  loadLedger, cachedSLEs_, logs_->journal("OpenLedger"));
2043 
2044  if (replay)
2045  {
2046  // inject transaction(s) from the replayLedger into our open ledger
2047  // and build replay structure
2048  auto replayData =
2049  std::make_unique<LedgerReplay>(loadLedger, replayLedger);
2050 
2051  for (auto const& [_, tx] : replayData->orderedTxns())
2052  {
2053  (void)_;
2054  auto txID = tx->getTransactionID();
2055 
2056  auto s = std::make_shared<Serializer>();
2057  tx->add(*s);
2058 
2060 
2061  openLedger_->modify(
2062  [&txID, &s](OpenView& view, beast::Journal j) {
2063  view.rawTxInsert(txID, std::move(s), nullptr);
2064  return true;
2065  });
2066  }
2067 
2068  m_ledgerMaster->takeReplay(std::move(replayData));
2069  }
2070  }
2071  catch (SHAMapMissingNode const& mn)
2072  {
2073  JLOG(m_journal.fatal())
2074  << "While loading specified ledger: " << mn.what();
2075  return false;
2076  }
2077  catch (boost::bad_lexical_cast&)
2078  {
2079  JLOG(m_journal.fatal())
2080  << "Ledger specified '" << ledgerID << "' is not valid";
2081  return false;
2082  }
2083 
2084  return true;
2085 }
2086 
2087 bool
2089 {
2090  if (!config().ELB_SUPPORT)
2091  return true;
2092 
2093  if (isStopping())
2094  {
2095  reason = "Server is shutting down";
2096  return false;
2097  }
2098 
2099  if (getOPs().isNeedNetworkLedger())
2100  {
2101  reason = "Not synchronized with network yet";
2102  return false;
2103  }
2104 
2105  if (getOPs().isAmendmentBlocked())
2106  {
2107  reason = "Server version too old";
2108  return false;
2109  }
2110 
2111  if (getOPs().isUNLBlocked())
2112  {
2113  reason = "No valid validator list available";
2114  return false;
2115  }
2116 
2117  if (getOPs().getOperatingMode() < OperatingMode::SYNCING)
2118  {
2119  reason = "Not synchronized with network";
2120  return false;
2121  }
2122 
2123  if (!getLedgerMaster().isCaughtUp(reason))
2124  return false;
2125 
2126  if (getFeeTrack().isLoadedLocal())
2127  {
2128  reason = "Too much load";
2129  return false;
2130  }
2131 
2132  return true;
2133 }
2134 
2137 {
2138  return logs_->journal(name);
2139 }
2140 
2141 bool
2143 {
2144  assert(overlay_);
2145  assert(!config_->standalone());
2146 
2147  if (config_->section(ConfigSection::shardDatabase()).empty())
2148  {
2149  JLOG(m_journal.fatal())
2150  << "The [shard_db] configuration setting must be set";
2151  return false;
2152  }
2153  if (!shardStore_)
2154  {
2155  JLOG(m_journal.fatal()) << "Invalid [shard_db] configuration";
2156  return false;
2157  }
2158  shardStore_->importDatabase(getNodeStore());
2159  return true;
2160 }
2161 
2162 void
2164 {
2166  if (seq)
2167  maxDisallowedLedger_ = *seq;
2168 
2169  JLOG(m_journal.trace())
2170  << "Max persisted ledger is " << maxDisallowedLedger_;
2171 }
2172 
2173 //------------------------------------------------------------------------------
2174 
2175 Application::Application() : beast::PropertyStream::Source("app")
2176 {
2177 }
2178 
2179 //------------------------------------------------------------------------------
2180 
2183  std::unique_ptr<Config> config,
2184  std::unique_ptr<Logs> logs,
2185  std::unique_ptr<TimeKeeper> timeKeeper)
2186 {
2187  return std::make_unique<ApplicationImp>(
2188  std::move(config), std::move(logs), std::move(timeKeeper));
2189 }
2190 
2191 } // 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:2088
ripple::loadByIndex
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Application &app, bool acquire)
Definition: Ledger.cpp:1063
utility
ripple::LedgerMaster::sweep
void sweep()
Definition: LedgerMaster.cpp:1838
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:1627
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:1053
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:1649
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:4447
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:1770
ripple::ApplicationImp::checkSigs
bool checkSigs() const override
Definition: Application.cpp:1663
ripple::ApplicationImp::journal
beast::Journal journal(std::string const &name) override
Definition: Application.cpp:2136
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:2142
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:1076
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:1905
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:65
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:1730
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:1710
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:2175
std::min
T min(T... args)
ripple::ApplicationImp::setMaxDisallowedLedger
void setMaxDisallowedLedger()
Definition: Application.cpp:2163
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:78
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:1682
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:1675
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:766
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:2182
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:1604
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