TARAXA
Loading...
Searching...
No Matches
app_base.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <memory>
7
8#include "config/config.hpp"
9
10namespace taraxa {
11struct FullNodeConfig;
12class Network;
13class TransactionManager;
14class DagManager;
15class DbStorage;
16class PbftManager;
17class VoteManager;
18class PbftChain;
19class DagBlockProposer;
20class GasPricer;
21class Plugin;
22
23namespace final_chain {
24class FinalChain;
25}
26namespace pillar_chain {
28}
29
30namespace metrics {
31class MetricsService;
32}
33
34class AppBase {
35 public:
37
38 virtual ~AppBase() = default;
39
40 virtual const FullNodeConfig &getConfig() const = 0;
42 virtual std::shared_ptr<Network> getNetwork() const = 0;
43 virtual std::shared_ptr<TransactionManager> getTransactionManager() const = 0;
44 virtual std::shared_ptr<DagManager> getDagManager() const = 0;
45 virtual std::shared_ptr<DbStorage> getDB() const = 0;
46 virtual std::shared_ptr<PbftManager> getPbftManager() const = 0;
47 virtual std::shared_ptr<VoteManager> getVoteManager() const = 0;
48 virtual std::shared_ptr<PbftChain> getPbftChain() const = 0;
49 virtual std::shared_ptr<final_chain::FinalChain> getFinalChain() const = 0;
50 virtual std::shared_ptr<metrics::MetricsService> getMetrics() const = 0;
51 // used only in tests
52 virtual std::shared_ptr<DagBlockProposer> getDagBlockProposer() const = 0;
53 virtual std::shared_ptr<GasPricer> getGasPricer() const = 0;
54
56 const Secret &getSecretKey() const { return conf_.getFirstWallet().node_secret; }
58
59 virtual std::shared_ptr<pillar_chain::PillarChainManager> getPillarChainManager() const = 0;
60
61 virtual std::shared_ptr<Plugin> getPlugin(const std::string &name) const = 0;
62
63 bool isStarted() const { return started_; }
64
65 virtual void start() = 0;
66
67 protected:
68 // configuration
70
71 std::atomic_bool started_ = 0;
72 std::atomic_bool stopped_ = true;
73};
74
75} // namespace taraxa
Definition FixedHash.h:35
Definition app_base.hpp:34
virtual std::shared_ptr< GasPricer > getGasPricer() const =0
virtual std::shared_ptr< PbftChain > getPbftChain() const =0
const dev::Address & getAddress() const
Definition app_base.hpp:55
virtual std::shared_ptr< DagManager > getDagManager() const =0
virtual ~AppBase()=default
AppBase()
Definition app_base.hpp:36
const Secret & getSecretKey() const
Definition app_base.hpp:56
virtual std::shared_ptr< VoteManager > getVoteManager() const =0
vrf_wrapper::vrf_sk_t getVrfSecretKey() const
Definition app_base.hpp:57
bool isStarted() const
Definition app_base.hpp:63
virtual std::shared_ptr< pillar_chain::PillarChainManager > getPillarChainManager() const =0
FullNodeConfig conf_
Definition app_base.hpp:69
virtual FullNodeConfig & getMutableConfig()=0
virtual std::shared_ptr< PbftManager > getPbftManager() const =0
std::atomic_bool started_
Definition app_base.hpp:71
virtual std::shared_ptr< Plugin > getPlugin(const std::string &name) const =0
std::atomic_bool stopped_
Definition app_base.hpp:72
virtual std::shared_ptr< DagBlockProposer > getDagBlockProposer() const =0
virtual const FullNodeConfig & getConfig() const =0
virtual std::shared_ptr< Network > getNetwork() const =0
virtual std::shared_ptr< DbStorage > getDB() const =0
virtual std::shared_ptr< final_chain::FinalChain > getFinalChain() const =0
virtual std::shared_ptr< TransactionManager > getTransactionManager() const =0
virtual std::shared_ptr< metrics::MetricsService > getMetrics() const =0
virtual void start()=0
class for metrics collecting. Registering specific metrics classes and creating prometheus server(exp...
Definition metrics_service.hpp:16
main responsibility is blocks execution in EVM, getting data from EVM state
Definition final_chain.hpp:28
PillarChainMgr class contains functionality related to pillar chain.
Definition pillar_chain_manager.hpp:31
Definition app.hpp:16
Definition config.hpp:40
const WalletConfig & getFirstWallet() const
Definition config.cpp:176
const vrf_wrapper::vrf_sk_t vrf_secret
Definition config.hpp:36
const dev::Secret node_secret
Definition config.hpp:32
const addr_t node_addr
Definition config.hpp:34