rippled
Loading...
Searching...
No Matches
ServiceRegistry.h
1#pragma once
2
3#include <xrpl/basics/Blob.h>
4#include <xrpl/basics/SHAMapHash.h>
5#include <xrpl/basics/TaggedCache.h>
6#include <xrpl/ledger/CachedSLEs.h>
7
8#include <boost/asio.hpp>
9
10namespace xrpl {
11
12// Forward declarations
13namespace NodeStore {
14class Database;
15}
16namespace Resource {
17class Manager;
18}
19namespace perf {
20class PerfLog;
21}
22
23// This is temporary until we migrate all code to use ServiceRegistry.
24class Application;
25
26// Forward declarations
27class AcceptedLedger;
28class AmendmentTable;
29class Cluster;
30class CollectorManager;
31class DatabaseCon;
32class Family;
33class HashRouter;
34class InboundLedgers;
35class InboundTransactions;
36class JobQueue;
37class LedgerCleaner;
38class LedgerMaster;
39class LedgerReplayer;
40class LoadFeeTrack;
41class LoadManager;
42class ManifestCache;
43class NetworkOPs;
44class OpenLedger;
45class OrderBookDB;
46class Overlay;
47class PathRequests;
48class PeerReservationTable;
49class PendingSaves;
50class RelationalDatabase;
51class ServerHandler;
52class SHAMapStore;
53class TimeKeeper;
54class TransactionMaster;
55class TxQ;
56class ValidatorList;
57class ValidatorSite;
58
59template <class Adaptor>
60class Validations;
61class RCLValidationsAdaptor;
63
65
78{
79public:
80 ServiceRegistry() = default;
81 virtual ~ServiceRegistry() = default;
82
83 // Core infrastructure services
84 virtual CollectorManager&
86
87 virtual Family&
89
90 virtual TimeKeeper&
92
93 virtual JobQueue&
95
96 virtual NodeCache&
98
99 virtual CachedSLEs&
101
102 // Protocol and validation services
103 virtual AmendmentTable&
105
106 virtual HashRouter&
108
109 virtual LoadFeeTrack&
111
112 virtual LoadManager&
114
115 virtual RCLValidations&
117
118 virtual ValidatorList&
120
121 virtual ValidatorSite&
123
124 virtual ManifestCache&
126
127 virtual ManifestCache&
129
130 // Network services
131 virtual Overlay&
132 overlay() = 0;
133
134 virtual Cluster&
135 cluster() = 0;
136
137 virtual PeerReservationTable&
139
140 virtual Resource::Manager&
142
143 // Storage services
144 virtual NodeStore::Database&
146
147 virtual SHAMapStore&
149
150 virtual RelationalDatabase&
152
153 // Ledger services
154 virtual InboundLedgers&
156
157 virtual InboundTransactions&
159
162
163 virtual LedgerMaster&
165
166 virtual LedgerCleaner&
168
169 virtual LedgerReplayer&
171
172 virtual PendingSaves&
174
175 virtual OpenLedger&
177
178 virtual OpenLedger const&
179 openLedger() const = 0;
180
181 // Transaction and operation services
182 virtual NetworkOPs&
183 getOPs() = 0;
184
185 virtual OrderBookDB&
187
188 virtual TransactionMaster&
190
191 virtual TxQ&
192 getTxQ() = 0;
193
194 virtual PathRequests&
196
197 // Server services
198 virtual ServerHandler&
200
201 virtual perf::PerfLog&
203
204 // Configuration and state
205 virtual bool
206 isStopping() const = 0;
207
208 virtual beast::Journal
209 journal(std::string const& name) = 0;
210
211 virtual boost::asio::io_context&
213
214 virtual Logs&
215 logs() = 0;
216
217 virtual std::optional<uint256> const&
218 trapTxID() const = 0;
219
221 virtual DatabaseCon&
223
224 // Temporary: Get the underlying Application for functions that haven't
225 // been migrated yet. This should be removed once all code is migrated.
226 virtual Application&
227 app() = 0;
228};
229
230} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:40
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: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:37
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:26
Manages partitions for logging.
Definition Log.h:32
Remembers manifests with the highest sequence number.
Definition Manifest.h:224
Provides server functionality for clients.
Definition NetworkOPs.h:71
Persistency layer for NodeObject.
Definition Database.h:31
Represents the open ledger.
Definition OpenLedger.h:32
Tracks order books in the ledger.
Definition OrderBookDB.h:29
Manages the set of connected peers.
Definition Overlay.h:29
Keeps track of which ledgers haven't been fully saved.
Tracks load and resource consumption.
class to create database, launch online delete thread, and related SQLite database
Definition SHAMapStore.h:18
Service registry for dependency injection.
virtual NodeCache & getTempNodeCache()=0
virtual perf::PerfLog & getPerfLog()=0
virtual Logs & logs()=0
virtual JobQueue & getJobQueue()=0
virtual RelationalDatabase & getRelationalDatabase()=0
virtual AmendmentTable & getAmendmentTable()=0
virtual PendingSaves & pendingSaves()=0
virtual ValidatorList & validators()=0
virtual TxQ & getTxQ()=0
virtual CollectorManager & getCollectorManager()=0
virtual NetworkOPs & getOPs()=0
virtual TransactionMaster & getMasterTransaction()=0
virtual SHAMapStore & getSHAMapStore()=0
virtual Overlay & overlay()=0
virtual NodeStore::Database & getNodeStore()=0
virtual PathRequests & getPathRequests()=0
virtual ManifestCache & publisherManifests()=0
virtual Resource::Manager & getResourceManager()=0
virtual LoadManager & getLoadManager()=0
virtual RCLValidations & getValidations()=0
virtual LoadFeeTrack & getFeeTrack()=0
virtual OpenLedger const & openLedger() const =0
virtual ServerHandler & getServerHandler()=0
virtual PeerReservationTable & peerReservations()=0
virtual std::optional< uint256 > const & trapTxID() const =0
virtual OpenLedger & openLedger()=0
virtual Cluster & cluster()=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 Family & getNodeFamily()=0
virtual DatabaseCon & getWalletDB()=0
Retrieve the "wallet database".
virtual LedgerReplayer & getLedgerReplayer()=0
virtual ValidatorSite & validatorSites()=0
virtual TimeKeeper & timeKeeper()=0
virtual CachedSLEs & cachedSLEs()=0
virtual OrderBookDB & getOrderBookDB()=0
virtual TaggedCache< uint256, AcceptedLedger > & getAcceptedLedgerCache()=0
virtual ManifestCache & validatorManifests()=0
virtual beast::Journal journal(std::string const &name)=0
virtual LedgerCleaner & getLedgerCleaner()=0
virtual InboundTransactions & getInboundTransactions()=0
virtual ~ServiceRegistry()=default
virtual Application & app()=0
Manages various times used by the server.
Definition TimeKeeper.h:12
Transaction Queue.
Definition TxQ.h:41
Singleton class that maintains performance counters and optionally writes Json-formatted data to a di...
Definition PerfLog.h:31
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5