Kagome
Polkadot Runtime Engine in C++17
application_injector.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_INJECTOR_APPLICATION_INJECTOR_HPP
7 #define KAGOME_CORE_INJECTOR_APPLICATION_INJECTOR_HPP
8 
9 #include <memory>
10 
11 #include <boost/asio/io_context.hpp>
12 
13 #include "clock/clock.hpp"
15 
16 namespace soralog {
17  class LoggingSystem;
18 }
19 
20 namespace kagome {
21  namespace application {
22  class AppConfiguration;
23  class ChainSpec;
24  class AppStateManager;
25  } // namespace application
26 
27  namespace application::mode {
28  class PrintChainInfoMode;
29  class RecoveryMode;
30  } // namespace application::mode
31 
32  namespace metrics {
33  class Exposer;
34  class MetricsWatcher;
35  } // namespace metrics
36 
37  namespace network {
38  class Router;
39  class PeerManager;
40  class StateProtocolObserver;
41  class SyncProtocolObserver;
42  } // namespace network
43 
44  namespace parachain {
45  struct ParachainObserverImpl;
47  } // namespace parachain
48 
49  namespace runtime {
50  class Executor;
51  }
52 
53 
54  namespace api {
55  class ApiService;
56  }
57 
58  namespace consensus::babe {
59  class Babe;
60  }
61 
62  namespace consensus::grandpa {
63  class Grandpa;
64  }
65 
66  namespace blockchain {
67  class BlockStorage;
68  class BlockTree;
69  }
70 
71  namespace storage::trie {
72  class TrieStorage;
73  }
74 
75  namespace telemetry {
76  class TelemetryService;
77  }
78 
79 } // namespace kagome
80 
81 namespace kagome::injector {
82 
87  class KagomeNodeInjector final {
88  public:
90 
91  std::shared_ptr<application::ChainSpec> injectChainSpec();
92  std::shared_ptr<blockchain::BlockStorage> injectBlockStorage();
93  std::shared_ptr<application::AppStateManager> injectAppStateManager();
94  std::shared_ptr<boost::asio::io_context> injectIoContext();
95  std::shared_ptr<metrics::Exposer> injectOpenMetricsService();
96  std::shared_ptr<network::Router> injectRouter();
97  std::shared_ptr<network::PeerManager> injectPeerManager();
98  std::shared_ptr<api::ApiService> injectRpcApiService();
99  std::shared_ptr<clock::SystemClock> injectSystemClock();
100  std::shared_ptr<consensus::babe::Babe> injectBabe();
101  std::shared_ptr<network::StateProtocolObserver> injectStateObserver();
102  std::shared_ptr<network::SyncProtocolObserver> injectSyncObserver();
103  std::shared_ptr<parachain::ParachainObserverImpl> injectParachainObserver();
104  std::shared_ptr<parachain::ParachainProcessorImpl>
105  injectParachainProcessor();
106  std::shared_ptr<consensus::grandpa::Grandpa> injectGrandpa();
107  std::shared_ptr<soralog::LoggingSystem> injectLoggingSystem();
108  std::shared_ptr<storage::trie::TrieStorage> injectTrieStorage();
109  std::shared_ptr<metrics::MetricsWatcher> injectMetricsWatcher();
110  std::shared_ptr<telemetry::TelemetryService> injectTelemetryService();
111  std::shared_ptr<blockchain::BlockTree> injectBlockTree();
112  std::shared_ptr<runtime::Executor> injectExecutor();
113  std::shared_ptr<storage::BufferStorage> injectStorage();
114 
115  std::shared_ptr<application::mode::PrintChainInfoMode>
116  injectPrintChainInfoMode();
117  std::shared_ptr<application::mode::RecoveryMode> injectRecoveryMode();
118 
119  protected:
120  std::shared_ptr<class KagomeNodeInjectorImpl> pimpl_;
121  };
122 
123 } // namespace kagome::injector
124 
125 #endif // KAGOME_CORE_INJECTOR_APPLICATION_INJECTOR_HPP
std::shared_ptr< class KagomeNodeInjectorImpl > pimpl_
an http server interface to expose metrics on request with custom request handler ...
Definition: exposer.hpp:21