xrpld
Loading...
Searching...
No Matches
Application.h
1#pragma once
2
3#include <xrpld/core/Config.h>
4
5#include <xrpl/basics/TaggedCache.h>
6#include <xrpl/beast/utility/PropertyStream.h>
7#include <xrpl/core/PeerReservationTable.h>
8#include <xrpl/core/ServiceRegistry.h>
9#include <xrpl/protocol/Protocol.h>
10#include <xrpl/shamap/TreeNodeCache.h>
11
12#include <boost/asio.hpp>
13#include <boost/program_options.hpp>
14
15#include <mutex>
16
17namespace xrpl {
18
19namespace perf {
20class PerfLog;
21} // namespace perf
22
23// VFALCO TODO Fix forward declares required for header dependency loops
24class AmendmentTable;
25
26template <
27 class Key,
28 class T,
29 bool IsKeyCache,
30 class SharedWeakUnionPointer,
31 class SharedPointerType,
32 class Hash,
33 class KeyEqual,
34 class Mutex>
35class TaggedCache;
36class STLedgerEntry;
37using SLE = STLedgerEntry;
39
41class Family;
42class HashRouter;
43class Logs;
44class LoadFeeTrack;
45class JobQueue;
46class InboundLedgers;
48class AcceptedLedger;
49class Ledger;
50class LedgerMaster;
51class LedgerCleaner;
52class LedgerReplayer;
53class LoadManager;
54class ManifestCache;
55class ValidatorKeys;
56class NetworkOPs;
57class OpenLedger;
58class OrderBookDB;
59class Overlay;
61class PendingSaves;
62class PublicKey;
63class ServerHandler;
64class SecretKey;
65class STLedgerEntry;
66class TimeKeeper;
68class TxQ;
69
70class ValidatorList;
71class ValidatorSite;
72class Cluster;
73
75class DatabaseCon;
76class SHAMapStore;
77
79
80template <class Adaptor>
81class Validations;
84
86{
87public:
88 /* VFALCO NOTE
89
90 The master mutex protects:
91
92 - The open ledger
93 - Server global state
94 * What the last closed ledger is
95 * State of the consensus engine
96
97 other things
98 */
100 virtual MutexType&
102
103public:
104 Application();
105
106 virtual bool
107 setup(boost::program_options::variables_map const& options) = 0;
108
109 virtual void
110 start(bool withTimers) = 0;
111 virtual void
112 run() = 0;
113 virtual void
114 signalStop(std::string const& msg) = 0;
115 [[nodiscard]] virtual bool
116 checkSigs() const = 0;
117 virtual void
118 checkSigs(bool) = 0;
119
120 //
121 // ---
122 //
123
125 [[nodiscard]] virtual std::uint64_t
126 instanceID() const = 0;
127
128 virtual Config&
129 config() = 0;
130
133
134 [[nodiscard]] virtual std::optional<PublicKey const>
136
139
140 virtual bool
142
143 /* Returns the number of file descriptors the application needs */
144 [[nodiscard]] virtual int
145 fdRequired() const = 0;
146
149 virtual LedgerIndex
151
153 [[nodiscard]] virtual size_t
155};
156
161 std::unique_ptr<TimeKeeper> timeKeeper);
162
163} // namespace xrpl
Subclasses can be called to write to a stream and have children.
A ledger that has become irrevocable.
The amendment table stores the list of enabled and potential amendments.
virtual size_t getNumberOfThreads() const =0
Returns the number of io_context (I/O worker) threads used by the application.
virtual bool setup(boost::program_options::variables_map const &options)=0
virtual std::chrono::milliseconds getIOLatency()=0
std::recursive_mutex MutexType
Definition Application.h:99
virtual Config & config()=0
virtual std::uint64_t instanceID() const =0
Returns a 64-bit instance identifier, generated at startup.
virtual bool checkSigs() const =0
virtual int fdRequired() const =0
virtual LedgerIndex getMaxDisallowedLedger()=0
Ensure that a newly-started validator does not sign proposals older than the last ledger it persisted...
virtual void signalStop(std::string const &msg)=0
virtual void run()=0
virtual std::optional< PublicKey const > getValidationPublicKey() const =0
virtual bool serverOkay(std::string &reason)=0
virtual void checkSigs(bool)=0
virtual MutexType & getMasterMutex()=0
virtual void start(bool withTimers)=0
virtual std::pair< PublicKey, SecretKey > const & nodeIdentity()=0
Provides the beast::insight::Collector service.
Routing table for objects identified by hash.
Definition HashRouter.h:77
Manages the lifetime of inbound ledgers.
Manages the acquisition and lifetime of transaction sets.
A pool of threads to perform work.
Definition JobQueue.h:43
Check the ledger/transaction databases to make sure they have continuity.
Manages the lifetime of ledger replay tasks.
Manages the current fee schedule.
Manages load sources.
Definition LoadManager.h:27
Manages partitions for logging.
Definition Log.h:20
Remembers manifests with the highest sequence number.
Definition Manifest.h:236
Provides server functionality for clients.
Definition NetworkOPs.h:71
Represents the open ledger.
Definition OpenLedger.h:33
Tracks order books in the ledger.
Definition OrderBookDB.h:29
Manages the set of connected peers.
Definition Overlay.h:25
Keeps track of which ledgers haven't been fully saved.
A public key.
Definition PublicKey.h:42
Generic validations adaptor class for RCL.
class to create database, launch online delete thread, and related SQLite database
Definition SHAMapStore.h:19
A secret key.
Definition SecretKey.h:18
Map/cache combination.
Definition TaggedCache.h:59
Manages various times used by the server.
Definition TimeKeeper.h:12
Transaction Queue.
Definition TxQ.h:40
Maintains current and recent ledger validations.
Validator keys and manifest as set in configuration file.
Singleton class that maintains performance counters and optionally writes Json-formatted data to a di...
Definition PerfLog.h:31
Dummy class for unit tests.
Definition Workers.h:14
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::uint32_t LedgerIndex
A ledger index.
Definition Protocol.h:259
STLedgerEntry SLE
Validations< RCLValidationsAdaptor > RCLValidations
Alias for RCL-specific instantiation of generic Validations.
TaggedCache< uint256, SLE const > CachedSLEs
std::unique_ptr< Application > makeApplication(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
TaggedCache< SHAMapHash, Blob > NodeCache