rippled
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 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
87using NodeCache = TaggedCache<SHAMapHash, Blob>;
88
89template <class Adaptor>
90class Validations;
91class RCLValidationsAdaptor;
92using RCLValidations = Validations<RCLValidationsAdaptor>;
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 bool
116 setup(boost::program_options::variables_map const& options) = 0;
117
118 virtual void
119 start(bool withTimers) = 0;
120 virtual void
121 run() = 0;
122 virtual void
124 virtual bool
125 checkSigs() const = 0;
126 virtual void
127 checkSigs(bool) = 0;
128
129 //
130 // ---
131 //
132
134 virtual std::uint64_t
135 instanceID() const = 0;
136
137 virtual Config&
138 config() = 0;
139
142
145
148
149 virtual bool
151
152 /* Returns the number of file descriptors the application needs */
153 virtual int
154 fdRequired() const = 0;
155
158 virtual LedgerIndex
160};
161
164
165} // namespace xrpl
Subclasses can be called to write to a stream and have children.
virtual bool setup(boost::program_options::variables_map const &options)=0
virtual std::chrono::milliseconds getIOLatency()=0
virtual Config & config()=0
virtual void signalStop(std::string msg)=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 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
Service registry for dependency injection.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
TaggedCache< uint256, SLE const > CachedSLEs
Definition CachedSLEs.h:8
std::unique_ptr< Application > make_Application(std::unique_ptr< Config > config, std::unique_ptr< Logs > logs, std::unique_ptr< TimeKeeper > timeKeeper)
STLedgerEntry SLE
TaggedCache< SHAMapHash, Blob > NodeCache
Validations< RCLValidationsAdaptor > RCLValidations
Alias for RCL-specific instantiation of generic Validations.