xrpld
Loading...
Searching...
No Matches
ServiceRegistry.h
1#pragma once
2
3#include <xrpl/basics/Blob.h>
4#include <xrpl/basics/Log.h>
5#include <xrpl/basics/SHAMapHash.h>
6#include <xrpl/basics/TaggedCache.h>
7#include <xrpl/basics/base_uint.h>
8#include <xrpl/beast/utility/Journal.h>
9
10#include <boost/asio.hpp>
11
12#include <optional>
13#include <string>
14
15namespace xrpl {
16
17// Forward declarations
18namespace node_store {
19class Database;
20} // namespace node_store
21namespace resource {
22class Manager;
23} // namespace resource
24namespace perf {
25class PerfLog;
26} // namespace perf
27
28// This is temporary until we migrate all code to use ServiceRegistry.
29class Application;
30
31template <
32 class Key,
33 class T,
34 bool IsKeyCache,
35 class SharedWeakUnionPointer,
36 class SharedPointerType,
37 class Hash,
38 class KeyEqual,
39 class Mutex>
40class TaggedCache;
41class STLedgerEntry;
44
45// Forward declarations
46class AcceptedLedger;
47class AmendmentTable;
48class Cluster;
50class DatabaseCon;
51class Family;
52class HashRouter;
53class InboundLedgers;
55class JobQueue;
56class LedgerCleaner;
57class LedgerMaster;
58class LedgerReplayer;
59class LoadFeeTrack;
60class LoadManager;
61class ManifestCache;
62class NetworkOPs;
64class OpenLedger;
65class OrderBookDB;
66class Overlay;
69class PendingSaves;
71class ServerHandler;
72class SHAMapStore;
73class TimeKeeper;
75class TxQ;
76class ValidatorList;
77class ValidatorSite;
78
79template <class Adaptor>
80class Validations;
83
85
98{
99public:
100 ServiceRegistry() = default;
101 virtual ~ServiceRegistry() = default;
102
103 // Core infrastructure services
104 virtual CollectorManager&
106
107 virtual Family&
109
110 virtual TimeKeeper&
112
113 virtual JobQueue&
115
116 virtual NodeCache&
118
119 virtual CachedSLEs&
121
122 virtual NetworkIDService&
124
125 // Protocol and validation services
126 virtual AmendmentTable&
128
129 virtual HashRouter&
131
132 virtual LoadFeeTrack&
134
135 virtual LoadManager&
137
138 virtual RCLValidations&
140
141 virtual ValidatorList&
143
144 virtual ValidatorSite&
146
147 virtual ManifestCache&
149
150 virtual ManifestCache&
152
153 // Network services
154 virtual Overlay&
156
157 virtual Cluster&
159
160 virtual PeerReservationTable&
162
163 virtual resource::Manager&
165
166 // Storage services
167 virtual node_store::Database&
169
170 virtual SHAMapStore&
172
173 virtual RelationalDatabase&
175
176 // Ledger services
177 virtual InboundLedgers&
179
180 virtual InboundTransactions&
182
185
186 virtual LedgerMaster&
188
189 virtual LedgerCleaner&
191
192 virtual LedgerReplayer&
194
195 virtual PendingSaves&
197
198 virtual OpenLedger&
200
201 [[nodiscard]] virtual OpenLedger const&
202 getOpenLedger() const = 0;
203
204 // Transaction and operation services
205 virtual NetworkOPs&
206 getOPs() = 0;
207
208 virtual OrderBookDB&
210
211 virtual TransactionMaster&
213
214 virtual TxQ&
215 getTxQ() = 0;
216
217 virtual PathRequestManager&
219
220 // Server services
221 virtual ServerHandler&
223
224 virtual perf::PerfLog&
226
227 // Configuration and state
228 [[nodiscard]] virtual bool
229 isStopping() const = 0;
230
231 virtual beast::Journal
232 getJournal(std::string const& name) = 0;
233
234 virtual boost::asio::io_context&
236
237 virtual Logs&
238 getLogs() = 0;
239
240 [[nodiscard]] virtual std::optional<uint256> const&
241 getTrapTxID() const = 0;
242
246 virtual DatabaseCon&
248
249 // Temporary: Get the underlying Application for functions that haven't
250 // been migrated yet. This should be removed once all code is migrated.
251 virtual Application&
252 getApp() = 0;
253};
254
255} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
A ledger that has become irrevocable.
The amendment table stores the list of enabled and potential amendments.
Provides the beast::insight::Collector service.
Routing table for objects identified by hash.
Definition HashRouter.h:86
Manages the lifetime of inbound ledgers.
Manages the acquisition and lifetime of transaction sets.
A pool of threads to perform work.
Definition JobQueue.h:60
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:28
Manages partitions for logging.
Definition Log.h:23
Remembers manifests with the highest sequence number.
Definition Manifest.h:374
Service that provides access to the network ID.
Provides server functionality for clients.
Definition NetworkOPs.h:82
Represents the open ledger.
Definition OpenLedger.h:43
Tracks order books in the ledger.
Definition OrderBookDB.h:30
Manages the set of connected peers.
Definition Overlay.h:38
Keeps track of which ledgers haven't been fully saved.
Generic validations adaptor class for RCL.
class to create database, launch online delete thread, and related SQLite database
Definition SHAMapStore.h:24
virtual NodeCache & getTempNodeCache()=0
virtual PendingSaves & getPendingSaves()=0
virtual perf::PerfLog & getPerfLog()=0
virtual JobQueue & getJobQueue()=0
virtual RelationalDatabase & getRelationalDatabase()=0
virtual PeerReservationTable & getPeerReservations()=0
virtual AmendmentTable & getAmendmentTable()=0
virtual TxQ & getTxQ()=0
virtual CollectorManager & getCollectorManager()=0
virtual beast::Journal getJournal(std::string const &name)=0
virtual NetworkOPs & getOPs()=0
virtual TransactionMaster & getMasterTransaction()=0
virtual SHAMapStore & getSHAMapStore()=0
virtual OpenLedger & getOpenLedger()=0
virtual ManifestCache & getPublisherManifests()=0
virtual ValidatorList & getValidators()=0
virtual LoadManager & getLoadManager()=0
virtual NetworkIDService & getNetworkIDService()=0
virtual PathRequestManager & getPathRequestManager()=0
virtual ValidatorSite & getValidatorSites()=0
virtual RCLValidations & getValidations()=0
virtual LoadFeeTrack & getFeeTrack()=0
virtual node_store::Database & getNodeStore()=0
virtual ServerHandler & getServerHandler()=0
virtual InboundLedgers & getInboundLedgers()=0
virtual LedgerMaster & getLedgerMaster()=0
virtual HashRouter & getHashRouter()=0
virtual bool isStopping() const =0
virtual boost::asio::io_context & getIOContext()=0
virtual Cluster & getCluster()=0
virtual Family & getNodeFamily()=0
virtual Application & getApp()=0
virtual DatabaseCon & getWalletDB()=0
Retrieve the "wallet database".
virtual LedgerReplayer & getLedgerReplayer()=0
virtual OpenLedger const & getOpenLedger() const =0
virtual resource::Manager & getResourceManager()=0
virtual OrderBookDB & getOrderBookDB()=0
virtual TaggedCache< uint256, AcceptedLedger > & getAcceptedLedgerCache()=0
virtual Overlay & getOverlay()=0
virtual Logs & getLogs()=0
virtual TimeKeeper & getTimeKeeper()=0
virtual LedgerCleaner & getLedgerCleaner()=0
virtual InboundTransactions & getInboundTransactions()=0
virtual CachedSLEs & getCachedSLEs()=0
virtual ManifestCache & getValidatorManifests()=0
virtual ~ServiceRegistry()=default
virtual std::optional< uint256 > const & getTrapTxID() const =0
Map/cache combination.
Definition TaggedCache.h:67
Manages various times used by the server.
Definition TimeKeeper.h:15
Transaction Queue.
Definition TxQ.h:58
Maintains current and recent ledger validations.
Persistency layer for NodeObject.
Definition Database.h:45
Singleton class that maintains performance counters and optionally writes Json-formatted data to a di...
Definition PerfLog.h:31
Tracks load and resource consumption.
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
STLedgerEntry SLE
Validations< RCLValidationsAdaptor > RCLValidations
Alias for RCL-specific instantiation of generic Validations.
TaggedCache< uint256, SLE const > CachedSLEs
TaggedCache< SHAMapHash, Blob > NodeCache