4#include <boost/program_options/options_description.hpp>
5#include <boost/program_options/variables_map.hpp>
20class App :
public std::enable_shared_from_this<App>,
public AppBase {
35 std::shared_ptr<DbStorage>
getDB()
const {
return db_; }
49 std::shared_ptr<boost::program_options::variables_map> options)
const;
51 template <
typename PluginType>
53 auto plug = std::make_shared<PluginType>(shared_from_this());
55 std::string cli_plugin_desc = plug->name() +
" plugin. " + plug->description() +
"\nOptions";
56 boost::program_options::options_description plugin_cli_options(cli_plugin_desc);
57 plug->addOptions(plugin_cli_options);
58 if (!plugin_cli_options.options().empty()) {
70 [](
const auto& a,
const auto& b) { return a.empty() ? b.first : a +
" " + b.first; });
72 std::shared_ptr<Plugin>
getPlugin(
const std::string& name)
const;
74 template <
typename PluginType>
75 std::shared_ptr<PluginType>
getPlugin(
const std::string& name)
const {
76 std::shared_ptr<Plugin> abs_plugin =
getPlugin(name);
77 std::shared_ptr<PluginType> result = std::dynamic_pointer_cast<PluginType>(abs_plugin);
92 std::shared_ptr<DbStorage>
db_;
Definition app_base.hpp:33
FullNodeConfig conf_
Definition app_base.hpp:65
std::shared_ptr< final_chain::FinalChain > getFinalChain() const
Definition app.hpp:39
util::ThreadPool config_update_executor_
Definition app.hpp:89
std::shared_ptr< VoteManager > vote_mgr_
Definition app.hpp:99
virtual ~App()
Definition app.cpp:32
std::shared_ptr< DagBlockProposer > getDagBlockProposer() const
Definition app.hpp:42
std::shared_ptr< Network > getNetwork() const
Definition app.hpp:32
App()
Definition app.cpp:30
std::map< std::string, std::shared_ptr< Plugin > > available_plugins_
Definition app.hpp:108
std::shared_ptr< VoteManager > getVoteManager() const
Definition app.hpp:37
const FullNodeConfig & getConfig() const
Definition app.hpp:31
std::shared_ptr< DagManager > dag_mgr_
Definition app.hpp:95
std::shared_ptr< DbStorage > db_
Definition app.hpp:92
std::shared_ptr< pillar_chain::PillarChainManager > getPillarChainManager() const
Definition app.hpp:44
App & operator=(App &&)=delete
std::shared_ptr< PluginType > registerPlugin(cli::Config &cli_conf)
Definition app.hpp:52
std::shared_ptr< GasPricer > getGasPricer() const
Definition app.hpp:43
std::map< std::string, std::shared_ptr< Plugin > > active_plugins_
Definition app.hpp:107
std::shared_ptr< PluginType > getPlugin(const std::string &name) const
Definition app.hpp:75
std::shared_ptr< DagBlockProposer > dag_block_proposer_
Definition app.hpp:98
std::shared_ptr< metrics::MetricsService > metrics_
Definition app.hpp:105
std::shared_ptr< PbftManager > pbft_mgr_
Definition app.hpp:100
std::shared_ptr< PbftManager > getPbftManager() const
Definition app.hpp:36
std::shared_ptr< DagManager > getDagManager() const
Definition app.hpp:34
std::shared_ptr< KeyManager > key_manager_
Definition app.hpp:103
void initialize(const std::filesystem::path &data_dir, std::shared_ptr< boost::program_options::variables_map > options) const
void setupMetricsUpdaters()
Method that is used to register metrics updaters. So we don't need to pass metrics classes instances ...
Definition app.cpp:213
std::shared_ptr< DbStorage > old_db_
Definition app.hpp:93
std::shared_ptr< final_chain::FinalChain > final_chain_
Definition app.hpp:104
App & operator=(const App &)=delete
void addAvailablePlugin(std::shared_ptr< Plugin > plugin)
Definition app.cpp:34
std::shared_ptr< util::ThreadPool > subscription_pool_
Definition app.hpp:88
std::shared_ptr< DbStorage > getDB() const
Definition app.hpp:35
std::shared_ptr< TransactionManager > getTransactionManager() const
Definition app.hpp:33
std::shared_ptr< Plugin > getPlugin(const std::string &name) const
void rebuildDb()
Definition app.cpp:253
void start()
Definition app.cpp:155
void enablePlugin(const std::string &name)
Definition app.cpp:36
std::shared_ptr< TransactionManager > trx_mgr_
Definition app.hpp:96
logger::Logger logger_
Definition app.hpp:119
std::shared_ptr< PbftChain > getPbftChain() const
Definition app.hpp:38
std::shared_ptr< GasPricer > gas_pricer_
Definition app.hpp:94
std::string registeredPlugins() const
Definition app.hpp:67
bool isPluginEnabled(const std::string &name) const
Definition app.cpp:43
std::shared_ptr< PbftChain > pbft_chain_
Definition app.hpp:101
std::shared_ptr< pillar_chain::PillarChainManager > pillar_chain_mgr_
Definition app.hpp:102
void close()
Definition app.cpp:240
std::shared_ptr< Network > network_
Definition app.hpp:97
std::shared_ptr< metrics::MetricsService > getMetrics() const
Definition app.hpp:40
void init(const cli::Config &cli_conf)
Definition app.cpp:45
void addCliOptions(const bpo::options_description &options)
Definition config.cpp:16
Definition thread_pool.hpp:7
std::shared_ptr< spdlog::logger > Logger
Definition logging.hpp:12