22 : app_config_(app_config),
23 injector_{std::make_unique<injector::KagomeNodeInjector>(app_config)},
32 auto mode =
injector_->injectPrintChainInfoMode();
37 logger_->info(
"Start in recovery mode with PID {}", getpid());
39 auto mode =
injector_->injectRecoveryMode();
60 logger_->info(
"Start as node version '{}' named as '{}' with PID {}",
71 "Chain path is {}, storage backend is {}", chain_path, storage_backend);
74 logger_->critical(
"Error initializing chain directory {}: {}",
76 res.error().message());
81 std::thread asio_runner([ctx{ctx}] { ctx->run(); });
91 constexpr
auto startTimeMetricName =
"kagome_process_start_time_seconds";
92 metrics_registry->registerGaugeFamily(
94 "UNIX timestamp of the moment the process started");
95 auto metric_start_time =
96 metrics_registry->registerGaugeMetric(startTimeMetricName);
97 metric_start_time->set(
clock_->nowUint64());
99 constexpr
auto nodeRolesMetricName =
"kagome_node_roles";
100 metrics_registry->registerGaugeFamily(nodeRolesMetricName,
101 "The roles the node is running as");
102 auto metric_node_roles =
103 metrics_registry->registerGaugeMetric(nodeRolesMetricName);
106 constexpr
auto buildInfoMetricName =
"kagome_build_info";
107 metrics_registry->registerGaugeFamily(
109 "A metric with a constant '1' value labeled by name, version");
110 auto metric_build_info = metrics_registry->registerGaugeMetric(
114 metric_build_info->set(1);
sptr< consensus::grandpa::Grandpa > grandpa_
sptr< metrics::MetricsWatcher > metrics_watcher_
virtual boost::filesystem::path chainPath(std::string chain_id) const =0
int recovery() override
Runs recovery mode.
sptr< api::ApiService > jrpc_api_service_
sptr< consensus::babe::Babe > babe_
virtual network::Roles roles() const =0
sptr< network::StateProtocolObserver > state_observer_
const AppConfiguration & app_config_
sptr< network::SyncProtocolObserver > sync_observer_
RegistryPtr createRegistry()
sptr< metrics::Exposer > exposer_
sptr< telemetry::TelemetryService > telemetry_service_
virtual const std::string & nodeVersion() const =0
sptr< boost::asio::io_context > io_context_
uptr< injector::KagomeNodeInjector > injector_
int chainInfo() override
Prints chain info.
sptr< AppStateManager > app_state_manager_
KagomeApplicationImpl(const AppConfiguration &config)
sptr< ChainSpec > chain_spec_
void run() override
Runs node.
virtual StorageBackend storageBackend() const =0
sptr< parachain::ParachainObserverImpl > parachain_observer_
outcome::result< void > init_directory(const boost::filesystem::path &path)
virtual const std::string & nodeName() const =0
Logger createLogger(const std::string &tag)
sptr< network::Router > router_
sptr< clock::SystemClock > clock_
void setTelemetryService(std::shared_ptr< TelemetryService > service)
sptr< network::PeerManager > peer_manager_