rippled
Loading...
Searching...
No Matches
Application.h
1#ifndef XRPL_APP_MAIN_APPLICATION_H_INCLUDED
2#define XRPL_APP_MAIN_APPLICATION_H_INCLUDED
3
4#include <xrpld/core/Config.h>
5#include <xrpld/overlay/PeerReservationTable.h>
6
7#include <xrpl/basics/TaggedCache.h>
8#include <xrpl/beast/utility/PropertyStream.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 ripple {
18
19namespace unl {
20class Manager;
21}
22namespace Resource {
23class Manager;
24}
25namespace NodeStore {
26class Database;
27} // namespace NodeStore
28namespace perf {
29class PerfLog;
30}
31
32// VFALCO TODO Fix forward declares required for header dependency loops
33class AmendmentTable;
34
35template <
36 class Key,
37 class T,
38 bool IsKeyCache,
39 class SharedWeakUnionPointer,
40 class SharedPointerType,
41 class Hash,
42 class KeyEqual,
43 class Mutex>
44class TaggedCache;
45class STLedgerEntry;
46using SLE = STLedgerEntry;
47using CachedSLEs = TaggedCache<uint256, SLE const>;
48
49class CollectorManager;
50class Family;
51class HashRouter;
52class Logs;
53class LoadFeeTrack;
54class JobQueue;
55class InboundLedgers;
56class InboundTransactions;
57class AcceptedLedger;
58class Ledger;
59class LedgerMaster;
60class LedgerCleaner;
61class LedgerReplayer;
62class LoadManager;
63class ManifestCache;
64class ValidatorKeys;
65class NetworkOPs;
66class OpenLedger;
67class OrderBookDB;
68class Overlay;
69class PathRequests;
70class PendingSaves;
71class PublicKey;
72class ServerHandler;
73class SecretKey;
74class STLedgerEntry;
75class TimeKeeper;
76class TransactionMaster;
77class TxQ;
78
79class ValidatorList;
80class ValidatorSite;
81class Cluster;
82
83class RelationalDatabase;
84class DatabaseCon;
85class SHAMapStore;
86
88
89template <class Adaptor>
90class Validations;
93
95{
96public:
97 /* VFALCO NOTE
98
99 The master mutex protects:
100
101 - The open ledger
102 - Server global state
103 * What the last closed ledger is
104 * State of the consensus engine
105
106 other things
107 */
109 virtual MutexType&
111
112public:
113 Application();
114
115 virtual ~Application() = default;
116
117 virtual bool
118 setup(boost::program_options::variables_map const& options) = 0;
119
120 virtual void
121 start(bool withTimers) = 0;
122 virtual void
123 run() = 0;
124 virtual void
126 virtual bool
127 checkSigs() const = 0;
128 virtual void
129 checkSigs(bool) = 0;
130 virtual bool
131 isStopping() const = 0;
132
133 //
134 // ---
135 //
136
138 virtual std::uint64_t
139 instanceID() const = 0;
140
141 virtual Logs&
142 logs() = 0;
143 virtual Config&
144 config() = 0;
145
146 virtual boost::asio::io_context&
148
149 virtual CollectorManager&
151 virtual Family&
153 virtual TimeKeeper&
155 virtual JobQueue&
157 virtual NodeCache&
159 virtual CachedSLEs&
161 virtual AmendmentTable&
163 virtual HashRouter&
165 virtual LoadFeeTrack&
167 virtual LoadManager&
169 virtual Overlay&
170 overlay() = 0;
171 virtual TxQ&
172 getTxQ() = 0;
173 virtual ValidatorList&
175 virtual ValidatorSite&
177 virtual ManifestCache&
179 virtual ManifestCache&
181 virtual Cluster&
182 cluster() = 0;
183 virtual PeerReservationTable&
185 virtual RCLValidations&
187 virtual NodeStore::Database&
189 virtual InboundLedgers&
191 virtual InboundTransactions&
193
196
197 virtual LedgerMaster&
199 virtual LedgerCleaner&
201 virtual LedgerReplayer&
203 virtual NetworkOPs&
204 getOPs() = 0;
205 virtual OrderBookDB&
207 virtual ServerHandler&
209 virtual TransactionMaster&
211 virtual perf::PerfLog&
213
216
219
220 virtual Resource::Manager&
222 virtual PathRequests&
224 virtual SHAMapStore&
226 virtual PendingSaves&
228 virtual OpenLedger&
230 virtual OpenLedger const&
231 openLedger() const = 0;
232 virtual RelationalDatabase&
234
237
238 virtual bool
240
241 virtual beast::Journal
243
244 /* Returns the number of file descriptors the application needs */
245 virtual int
246 fdRequired() const = 0;
247
249 virtual DatabaseCon&
251
254 virtual LedgerIndex
256
257 virtual std::optional<uint256> const&
258 trapTxID() const = 0;
259};
260
265 std::unique_ptr<TimeKeeper> timeKeeper);
266
267} // namespace ripple
268
269#endif
A generic endpoint for log messages.
Definition Journal.h:41
Subclasses can be called to write to a stream and have children.
std::string const & name() const
Returns the name of this source.
The amendment table stores the list of enabled and potential amendments.
virtual bool serverOkay(std::string &reason)=0
virtual std::optional< uint256 > const & trapTxID() const =0
virtual CollectorManager & getCollectorManager()=0
virtual CachedSLEs & cachedSLEs()=0
virtual Config & config()=0
virtual void start(bool withTimers)=0
virtual Overlay & overlay()=0
virtual LoadFeeTrack & getFeeTrack()=0
virtual OpenLedger & openLedger()=0
virtual beast::Journal journal(std::string const &name)=0
virtual SHAMapStore & getSHAMapStore()=0
virtual bool setup(boost::program_options::variables_map const &options)=0
virtual bool isStopping() const =0
virtual LedgerCleaner & getLedgerCleaner()=0
virtual NodeStore::Database & getNodeStore()=0
virtual RCLValidations & getValidations()=0
virtual ServerHandler & getServerHandler()=0
virtual std::chrono::milliseconds getIOLatency()=0
virtual bool checkSigs() const =0
virtual OrderBookDB & getOrderBookDB()=0
virtual InboundTransactions & getInboundTransactions()=0
virtual LedgerReplayer & getLedgerReplayer()=0
virtual TimeKeeper & timeKeeper()=0
virtual TaggedCache< uint256, AcceptedLedger > & getAcceptedLedgerCache()=0
virtual MutexType & getMasterMutex()=0
virtual NodeCache & getTempNodeCache()=0
virtual void run()=0
virtual JobQueue & getJobQueue()=0
virtual ValidatorSite & validatorSites()=0
virtual DatabaseCon & getWalletDB()=0
Retrieve the "wallet database".
virtual Resource::Manager & getResourceManager()=0
virtual NetworkOPs & getOPs()=0
virtual InboundLedgers & getInboundLedgers()=0
virtual ValidatorList & validators()=0
virtual Family & getNodeFamily()=0
virtual std::optional< PublicKey const > getValidationPublicKey() const =0
virtual LedgerMaster & getLedgerMaster()=0
virtual ~Application()=default
virtual std::uint64_t instanceID() const =0
Returns a 64-bit instance identifier, generated at startup.
virtual RelationalDatabase & getRelationalDatabase()=0
virtual ManifestCache & validatorManifests()=0
virtual int fdRequired() const =0
virtual PathRequests & getPathRequests()=0
virtual TxQ & getTxQ()=0
virtual PeerReservationTable & peerReservations()=0
virtual perf::PerfLog & getPerfLog()=0
virtual Cluster & cluster()=0
virtual LedgerIndex getMaxDisallowedLedger()=0
Ensure that a newly-started validator does not sign proposals older than the last ledger it persisted...
virtual void checkSigs(bool)=0
virtual LoadManager & getLoadManager()=0
virtual TransactionMaster & getMasterTransaction()=0
virtual AmendmentTable & getAmendmentTable()=0
virtual Logs & logs()=0
virtual ManifestCache & publisherManifests()=0
virtual HashRouter & getHashRouter()=0
virtual boost::asio::io_context & getIOContext()=0
virtual void signalStop(std::string msg)=0
virtual std::pair< PublicKey, SecretKey > const & nodeIdentity()=0
virtual PendingSaves & pendingSaves()=0
virtual OpenLedger const & openLedger() const =0
Provides the beast::insight::Collector service.
Routing table for objects identified by hash.
Definition HashRouter.h:78
Manages the lifetime of inbound ledgers.
Manages the acquisition and lifetime of transaction sets.
A pool of threads to perform work.
Definition JobQueue.h:39
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:33
Remembers manifests with the highest sequence number.
Definition Manifest.h:237
Provides server functionality for clients.
Definition NetworkOPs.h:70
Persistency layer for NodeObject.
Definition Database.h:32
Represents the open ledger.
Definition OpenLedger.h:33
Manages the set of connected peers.
Definition Overlay.h:30
Keeps track of which ledgers haven't been fully saved.
Generic validations adaptor class for RCL.
Tracks load and resource consumption.
class to create database, launch online delete thread, and related SQLite database
Definition SHAMapStore.h:19
Manages various times used by the server.
Definition TimeKeeper.h:13
Transaction Queue.
Definition TxQ.h:42
Maintains current and recent ledger validations.
Singleton class that maintains performance counters and optionally writes Json-formatted data to a di...
Definition PerfLog.h:33
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
std::unique_ptr< Application > make_Application(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
TaggedCache< uint256, SLE const > CachedSLEs
Definition CachedSLEs.h:9
STLedgerEntry SLE