Kagome
Polkadot Runtime Engine in C++17
kagome::application::AppConfigurationImpl Class Referencefinal

#include <app_configuration_impl.hpp>

Inheritance diagram for kagome::application::AppConfigurationImpl:
Collaboration diagram for kagome::application::AppConfigurationImpl:

Classes

struct  SegmentHandler
 

Public Member Functions

 AppConfigurationImpl (log::Logger logger)
 
 ~AppConfigurationImpl () override=default
 
 AppConfigurationImpl (const AppConfigurationImpl &)=delete
 
AppConfigurationImploperator= (const AppConfigurationImpl &)=delete
 
 AppConfigurationImpl (AppConfigurationImpl &&)=default
 
AppConfigurationImploperator= (AppConfigurationImpl &&)=default
 
bool initializeFromArgs (int argc, const char **argv)
 
network::Roles roles () const override
 
boost::filesystem::path chainSpecPath () const override
 
boost::filesystem::path runtimeCacheDirPath () const override
 
boost::filesystem::path runtimeCachePath (std::string runtime_hash) const override
 
boost::filesystem::path chainPath (std::string chain_id) const override
 
boost::filesystem::path databasePath (std::string chain_id) const override
 
boost::filesystem::path keystorePath (std::string chain_id) const override
 
const std::optional< crypto::Ed25519PrivateKey > & nodeKey () const override
 
const std::optional< std::string > & nodeKeyFile () const override
 
bool shouldSaveNodeKey () const override
 
const std::vector< libp2p::multi::Multiaddress > & listenAddresses () const override
 
const std::vector< libp2p::multi::Multiaddress > & publicAddresses () const override
 
const std::vector< libp2p::multi::Multiaddress > & bootNodes () const override
 
uint16_t p2pPort () const override
 
uint32_t outPeers () const override
 
uint32_t inPeers () const override
 
uint32_t inPeersLight () const override
 
int32_t luckyPeers () const override
 
const boost::asio::ip::tcp::endpoint & rpcHttpEndpoint () const override
 
const boost::asio::ip::tcp::endpoint & rpcWsEndpoint () const override
 
const boost::asio::ip::tcp::endpoint & openmetricsHttpEndpoint () const override
 
uint32_t maxWsConnections () const override
 
std::chrono::seconds getRandomWalkInterval () const override
 
const std::vector< std::string > & log () const override
 
uint32_t maxBlocksInResponse () const override
 
const network::PeeringConfigpeeringConfig () const override
 
bool isRunInDevMode () const override
 
const std::string & nodeName () const override
 
const std::string & nodeVersion () const override
 
bool isTelemetryEnabled () const override
 
const std::vector< telemetry::TelemetryEndpoint > & telemetryEndpoints () const override
 
SyncMethod syncMethod () const override
 
RuntimeExecutionMethod runtimeExecMethod () const override
 
bool useWavmCache () const override
 
bool purgeWavmCache () const override
 
OffchainWorkerMode offchainWorkerMode () const override
 
bool isOffchainIndexingEnabled () const override
 
bool subcommandChainInfo () const override
 
std::optional< primitives::BlockIdrecoverState () const override
 
StorageBackend storageBackend () const override
 
std::optional< std::string_view > devMnemonicPhrase () const override
 
- Public Member Functions inherited from kagome::application::AppConfiguration
virtual ~AppConfiguration ()=default
 

Private Types

using FilePtr = std::unique_ptr< std::FILE, decltype(&std::fclose)>
 

Private Member Functions

void parse_general_segment (const rapidjson::Value &val)
 
void parse_blockchain_segment (const rapidjson::Value &val)
 
void parse_storage_segment (const rapidjson::Value &val)
 
void parse_network_segment (const rapidjson::Value &val)
 
void parse_additional_segment (const rapidjson::Value &val)
 
bool validate_config ()
 
void read_config_from_file (const std::string &filepath)
 
bool load_ms (const rapidjson::Value &val, char const *name, std::vector< std::string > &target)
 
bool load_ma (const rapidjson::Value &val, char const *name, std::vector< libp2p::multi::Multiaddress > &target)
 
bool load_telemetry_uris (const rapidjson::Value &val, char const *name, std::vector< telemetry::TelemetryEndpoint > &target)
 
bool load_str (const rapidjson::Value &val, char const *name, std::string &target)
 
bool load_u16 (const rapidjson::Value &val, char const *name, uint16_t &target)
 
bool load_u32 (const rapidjson::Value &val, char const *name, uint32_t &target)
 
bool load_i32 (const rapidjson::Value &val, char const *name, int32_t &target)
 
bool load_bool (const rapidjson::Value &val, char const *name, bool &target)
 
boost::asio::ip::tcp::endpoint getEndpointFrom (const std::string &host, uint16_t port) const
 
outcome::result< boost::asio::ip::tcp::endpoint > getEndpointFrom (const libp2p::multi::Multiaddress &multiaddress) const
 
bool testListenAddresses () const
 
std::optional< telemetry::TelemetryEndpointparseTelemetryEndpoint (const std::string &record) const
 
FilePtr open_file (const std::string &filepath)
 

Private Attributes

std::vector< SegmentHandlerhandlers_
 
log::Logger logger_
 
network::Roles roles_
 
std::optional< crypto::Ed25519PrivateKey > node_key_
 
std::optional< std::string > node_key_file_
 
bool save_node_key_
 
std::vector< libp2p::multi::Multiaddress > listen_addresses_
 
std::vector< libp2p::multi::Multiaddress > public_addresses_
 
std::vector< libp2p::multi::Multiaddress > boot_nodes_
 
std::vector< telemetry::TelemetryEndpointtelemetry_endpoints_
 
bool is_telemetry_enabled_
 
uint16_t p2p_port_
 
boost::asio::ip::tcp::endpoint rpc_http_endpoint_
 
boost::asio::ip::tcp::endpoint rpc_ws_endpoint_
 
boost::asio::ip::tcp::endpoint openmetrics_http_endpoint_
 
std::vector< std::string > logger_tuning_config_
 
uint32_t max_blocks_in_response_
 
std::string rpc_http_host_
 
std::string rpc_ws_host_
 
std::string openmetrics_http_host_
 
boost::filesystem::path chain_spec_path_
 
boost::filesystem::path base_path_
 
std::optional< boost::filesystem::path > keystore_path_
 
uint16_t rpc_http_port_
 
uint16_t rpc_ws_port_
 
uint16_t openmetrics_http_port_
 
uint32_t out_peers_
 
uint32_t in_peers_
 
uint32_t in_peers_light_
 
int32_t lucky_peers_
 
network::PeeringConfig peering_config_
 
bool dev_mode_
 
std::string node_name_
 
std::string node_version_
 
uint32_t max_ws_connections_
 
uint32_t random_walk_interval_
 
SyncMethod sync_method_
 
RuntimeExecutionMethod runtime_exec_method_
 
bool use_wavm_cache_
 
bool purge_wavm_cache_
 
OffchainWorkerMode offchain_worker_mode_
 
bool enable_offchain_indexing_
 
bool subcommand_chain_info_
 
std::optional< primitives::BlockIdrecovery_state_
 
StorageBackend storage_backend_ = StorageBackend::RocksDB
 
std::optional< std::string > dev_mnemonic_phrase_
 

Additional Inherited Members

- Public Types inherited from kagome::application::AppConfiguration
enum  SyncMethod { SyncMethod::Full, SyncMethod::Fast }
 
enum  RuntimeExecutionMethod { RuntimeExecutionMethod::Compile, RuntimeExecutionMethod::Interpret }
 
enum  OffchainWorkerMode { OffchainWorkerMode::WhenValidating, OffchainWorkerMode::Always, OffchainWorkerMode::Never }
 
enum  StorageBackend { StorageBackend::RocksDB }
 
- Static Public Attributes inherited from kagome::application::AppConfiguration
static constexpr uint32_t kAbsolutMinBlocksInResponse = 1
 
static constexpr uint32_t kAbsolutMaxBlocksInResponse = 128
 
static constexpr uint32_t kNodeNameMaxLength = 64
 

Detailed Description

Reads app configuration from multiple sources with the given priority:

 COMMAND LINE ARGUMENTS          <- max priority
           V
   CONFIGURATION FILE
           V
     DEFAULT VALUES              <- low priority

Definition at line 53 of file app_configuration_impl.hpp.


Class Documentation

struct kagome::application::AppConfigurationImpl::SegmentHandler

TODO(iceseer): PRE-476 make handler calls via lambda-calls, remove member-function ptrs

Definition at line 204 of file app_configuration_impl.hpp.

Collaboration diagram for kagome::application::AppConfigurationImpl::SegmentHandler:
Class Members
typedef function< void(Value &)> Handler
Class Members
Handler handler
char const * segment_name

Member Typedef Documentation

using kagome::application::AppConfigurationImpl::FilePtr = std::unique_ptr<std::FILE, decltype(&std::fclose)>
private

Definition at line 54 of file app_configuration_impl.hpp.

Constructor & Destructor Documentation

kagome::application::AppConfigurationImpl::AppConfigurationImpl ( log::Logger  logger)
explicit

Definition at line 182 of file app_configuration_impl.cpp.

kagome::application::AppConfigurationImpl::~AppConfigurationImpl ( )
overridedefault
kagome::application::AppConfigurationImpl::AppConfigurationImpl ( const AppConfigurationImpl )
delete
kagome::application::AppConfigurationImpl::AppConfigurationImpl ( AppConfigurationImpl &&  )
default

Member Function Documentation

const std::vector<libp2p::multi::Multiaddress>& kagome::application::AppConfigurationImpl::bootNodes ( ) const
inlineoverridevirtual
Returns
multiaddresses of bootstrat nodes

Implements kagome::application::AppConfiguration.

Definition at line 101 of file app_configuration_impl.hpp.

boost::filesystem::path kagome::application::AppConfigurationImpl::chainPath ( std::string  chain_id) const
overridevirtual
Returns
path to the node's directory for the chain
  • chain_id (contains key storage and database)

Implements kagome::application::AppConfiguration.

Definition at line 228 of file app_configuration_impl.cpp.

fs::path kagome::application::AppConfigurationImpl::chainSpecPath ( ) const
overridevirtual
Returns
file path with genesis configuration.

Implements kagome::application::AppConfiguration.

Definition at line 215 of file app_configuration_impl.cpp.

fs::path kagome::application::AppConfigurationImpl::databasePath ( std::string  chain_id) const
overridevirtual
Returns
path to the node's database for the chain
  • chain_id

Implements kagome::application::AppConfiguration.

Definition at line 233 of file app_configuration_impl.cpp.

std::optional<std::string_view> kagome::application::AppConfigurationImpl::devMnemonicPhrase ( ) const
inlineoverridevirtual

Optional phrase to use dev account (e.g. Alice and Bob)

Implements kagome::application::AppConfiguration.

Definition at line 188 of file app_configuration_impl.hpp.

boost::asio::ip::tcp::endpoint kagome::application::AppConfigurationImpl::getEndpointFrom ( const std::string &  host,
uint16_t  port 
) const
private

Convert given values into boost tcp::endpoint representation format

Parameters
host- host name
port- port value
Returns
boost tcp::endpoint constructed

Definition at line 516 of file app_configuration_impl.cpp.

outcome::result< boost::asio::ip::tcp::endpoint > kagome::application::AppConfigurationImpl::getEndpointFrom ( const libp2p::multi::Multiaddress &  multiaddress) const
private

Convert a given libp2p multiaddress into a boost tcp::endpoint format.

Parameters
multiaddress- an address to be converted. Should contain a valid interface name or IP4/IP6 address and a port value to listen on.
Returns
boost tcp::endpoint when well-formed multiaddress is passed, otherwise - an error

Definition at line 532 of file app_configuration_impl.cpp.

std::chrono::seconds kagome::application::AppConfigurationImpl::getRandomWalkInterval ( ) const
inlineoverridevirtual
Returns
Kademlia random walk interval

Implements kagome::application::AppConfiguration.

Definition at line 133 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::initializeFromArgs ( int  argc,
const char **  argv 
)

Definition at line 697 of file app_configuration_impl.cpp.

uint32_t kagome::application::AppConfigurationImpl::inPeers ( ) const
inlineoverridevirtual
Returns
maximum number of inbound full nodes peers

Implements kagome::application::AppConfiguration.

Definition at line 111 of file app_configuration_impl.hpp.

uint32_t kagome::application::AppConfigurationImpl::inPeersLight ( ) const
inlineoverridevirtual
Returns
maximum number of inbound light nodes peers

Implements kagome::application::AppConfiguration.

Definition at line 114 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::isOffchainIndexingEnabled ( ) const
inlineoverridevirtual

Implements kagome::application::AppConfiguration.

Definition at line 176 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::isRunInDevMode ( ) const
inlineoverridevirtual
Returns
true if node allowed to run in development mode

Implements kagome::application::AppConfiguration.

Definition at line 145 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::isTelemetryEnabled ( ) const
inlineoverridevirtual
Returns
true when telemetry broadcasting is enabled, otherwise - false

Implements kagome::application::AppConfiguration.

Definition at line 154 of file app_configuration_impl.hpp.

fs::path kagome::application::AppConfigurationImpl::keystorePath ( std::string  chain_id) const
overridevirtual
Returns
path to the node's keystore for the chain
  • chain_id

Implements kagome::application::AppConfiguration.

Definition at line 237 of file app_configuration_impl.cpp.

const std::vector<libp2p::multi::Multiaddress>& kagome::application::AppConfigurationImpl::listenAddresses ( ) const
inlineoverridevirtual
Returns
multiaddresses the node listens for open connections on

Implements kagome::application::AppConfiguration.

Definition at line 91 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::load_bool ( const rapidjson::Value &  val,
char const *  name,
bool &  target 
)
private

Definition at line 306 of file app_configuration_impl.cpp.

bool kagome::application::AppConfigurationImpl::load_i32 ( const rapidjson::Value &  val,
char const *  name,
int32_t &  target 
)
private

Definition at line 343 of file app_configuration_impl.cpp.

bool kagome::application::AppConfigurationImpl::load_ma ( const rapidjson::Value &  val,
char const *  name,
std::vector< libp2p::multi::Multiaddress > &  target 
)
private

Definition at line 259 of file app_configuration_impl.cpp.

bool kagome::application::AppConfigurationImpl::load_ms ( const rapidjson::Value &  val,
char const *  name,
std::vector< std::string > &  target 
)
private

Definition at line 249 of file app_configuration_impl.cpp.

bool kagome::application::AppConfigurationImpl::load_str ( const rapidjson::Value &  val,
char const *  name,
std::string &  target 
)
private

Definition at line 295 of file app_configuration_impl.cpp.

bool kagome::application::AppConfigurationImpl::load_telemetry_uris ( const rapidjson::Value &  val,
char const *  name,
std::vector< telemetry::TelemetryEndpoint > &  target 
)
private

Definition at line 275 of file app_configuration_impl.cpp.

bool kagome::application::AppConfigurationImpl::load_u16 ( const rapidjson::Value &  val,
char const *  name,
uint16_t &  target 
)
private

Definition at line 317 of file app_configuration_impl.cpp.

bool kagome::application::AppConfigurationImpl::load_u32 ( const rapidjson::Value &  val,
char const *  name,
uint32_t &  target 
)
private

Definition at line 329 of file app_configuration_impl.cpp.

const std::vector<std::string>& kagome::application::AppConfigurationImpl::log ( ) const
inlineoverridevirtual
Returns
logging system tuning config

Implements kagome::application::AppConfiguration.

Definition at line 136 of file app_configuration_impl.hpp.

int32_t kagome::application::AppConfigurationImpl::luckyPeers ( ) const
inlineoverridevirtual
Returns
int32_t maximum number or lucky peers (peers being gossiped to)

Implements kagome::application::AppConfiguration.

Definition at line 117 of file app_configuration_impl.hpp.

uint32_t kagome::application::AppConfigurationImpl::maxBlocksInResponse ( ) const
inlineoverridevirtual
Returns
max blocks count per response while syncing

Implements kagome::application::AppConfiguration.

Definition at line 139 of file app_configuration_impl.hpp.

uint32_t kagome::application::AppConfigurationImpl::maxWsConnections ( ) const
inlineoverridevirtual
Returns
maximum number of WS RPC connections

Implements kagome::application::AppConfiguration.

Definition at line 130 of file app_configuration_impl.hpp.

const std::optional<crypto::Ed25519PrivateKey>& kagome::application::AppConfigurationImpl::nodeKey ( ) const
inlineoverridevirtual
Returns
the secret key to use for libp2p networking

Implements kagome::application::AppConfiguration.

Definition at line 79 of file app_configuration_impl.hpp.

const std::optional<std::string>& kagome::application::AppConfigurationImpl::nodeKeyFile ( ) const
inlineoverridevirtual
Returns
the path to key used for libp2p networking

Implements kagome::application::AppConfiguration.

Definition at line 83 of file app_configuration_impl.hpp.

const std::string& kagome::application::AppConfigurationImpl::nodeName ( ) const
inlineoverridevirtual
Returns
string representation of human-readable node name. The name of node is going to be used in telemetry, etc.

Implements kagome::application::AppConfiguration.

Definition at line 148 of file app_configuration_impl.hpp.

const std::string& kagome::application::AppConfigurationImpl::nodeVersion ( ) const
inlineoverridevirtual
Returns
string representation of node version . The version of node is going to be used in telemetry, etc.

Implements kagome::application::AppConfiguration.

Definition at line 151 of file app_configuration_impl.hpp.

OffchainWorkerMode kagome::application::AppConfigurationImpl::offchainWorkerMode ( ) const
inlineoverridevirtual
Returns
enum constant of the mode of run offchain workers

Implements kagome::application::AppConfiguration.

Definition at line 173 of file app_configuration_impl.hpp.

AppConfigurationImpl::FilePtr kagome::application::AppConfigurationImpl::open_file ( const std::string &  filepath)
private

Definition at line 242 of file app_configuration_impl.cpp.

const boost::asio::ip::tcp::endpoint& kagome::application::AppConfigurationImpl::openmetricsHttpEndpoint ( ) const
inlineoverridevirtual
Returns
endpoint for OpenMetrics over HTTP protocol.

Implements kagome::application::AppConfiguration.

Definition at line 126 of file app_configuration_impl.hpp.

AppConfigurationImpl& kagome::application::AppConfigurationImpl::operator= ( const AppConfigurationImpl )
delete
AppConfigurationImpl& kagome::application::AppConfigurationImpl::operator= ( AppConfigurationImpl &&  )
default
uint32_t kagome::application::AppConfigurationImpl::outPeers ( ) const
inlineoverridevirtual
Returns
number of outgoing connections we're trying to maintain

Implements kagome::application::AppConfiguration.

Definition at line 108 of file app_configuration_impl.hpp.

uint16_t kagome::application::AppConfigurationImpl::p2pPort ( ) const
inlineoverridevirtual
Returns
port for peer to peer interactions.

Implements kagome::application::AppConfiguration.

Definition at line 105 of file app_configuration_impl.hpp.

void kagome::application::AppConfigurationImpl::parse_additional_segment ( const rapidjson::Value &  val)
private

Definition at line 415 of file app_configuration_impl.cpp.

void kagome::application::AppConfigurationImpl::parse_blockchain_segment ( const rapidjson::Value &  val)
private

Definition at line 366 of file app_configuration_impl.cpp.

void kagome::application::AppConfigurationImpl::parse_general_segment ( const rapidjson::Value &  val)
private

Definition at line 354 of file app_configuration_impl.cpp.

void kagome::application::AppConfigurationImpl::parse_network_segment ( const rapidjson::Value &  val)
private

Definition at line 393 of file app_configuration_impl.cpp.

void kagome::application::AppConfigurationImpl::parse_storage_segment ( const rapidjson::Value &  val)
private

Definition at line 373 of file app_configuration_impl.cpp.

std::optional< telemetry::TelemetryEndpoint > kagome::application::AppConfigurationImpl::parseTelemetryEndpoint ( const std::string &  record) const
private

Parses telemetry endpoint URI and verbosity level from a single string record of format: "<endpoint URI> <verbosity: 0-9>"

Parameters
record- input string
Returns
- constructed instance of kagome::telemetry::TelemetryEndpoint or std::nullopt in case of error

Definition at line 604 of file app_configuration_impl.cpp.

const network::PeeringConfig& kagome::application::AppConfigurationImpl::peeringConfig ( ) const
inlineoverridevirtual

Config for PeerManager

Implements kagome::application::AppConfiguration.

Definition at line 142 of file app_configuration_impl.hpp.

const std::vector<libp2p::multi::Multiaddress>& kagome::application::AppConfigurationImpl::publicAddresses ( ) const
inlineoverridevirtual
Returns
multiaddresses the node could be accessed from the network

Implements kagome::application::AppConfiguration.

Definition at line 96 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::purgeWavmCache ( ) const
inlineoverridevirtual

A flag marking if we must force-purge WAVM runtime cache

Implements kagome::application::AppConfiguration.

Definition at line 170 of file app_configuration_impl.hpp.

void kagome::application::AppConfigurationImpl::read_config_from_file ( const std::string &  filepath)
private

Definition at line 478 of file app_configuration_impl.cpp.

std::optional<primitives::BlockId> kagome::application::AppConfigurationImpl::recoverState ( ) const
inlineoverridevirtual

Implements kagome::application::AppConfiguration.

Definition at line 182 of file app_configuration_impl.hpp.

network::Roles kagome::application::AppConfigurationImpl::roles ( ) const
inlineoverridevirtual
Returns
roles of current run

Implements kagome::application::AppConfiguration.

Definition at line 68 of file app_configuration_impl.hpp.

const boost::asio::ip::tcp::endpoint& kagome::application::AppConfigurationImpl::rpcHttpEndpoint ( ) const
inlineoverridevirtual
Returns
endpoint for RPC over HTTP.

Implements kagome::application::AppConfiguration.

Definition at line 120 of file app_configuration_impl.hpp.

const boost::asio::ip::tcp::endpoint& kagome::application::AppConfigurationImpl::rpcWsEndpoint ( ) const
inlineoverridevirtual
Returns
endpoint for RPC over Websocket protocol.

Implements kagome::application::AppConfiguration.

Definition at line 123 of file app_configuration_impl.hpp.

boost::filesystem::path kagome::application::AppConfigurationImpl::runtimeCacheDirPath ( ) const
overridevirtual
Returns
path to precompiled WAVM runtime cache directory

Implements kagome::application::AppConfiguration.

Definition at line 219 of file app_configuration_impl.cpp.

boost::filesystem::path kagome::application::AppConfigurationImpl::runtimeCachePath ( std::string  runtime_hash) const
overridevirtual
Returns
path to cached precompiled WAVM runtime

Implements kagome::application::AppConfiguration.

Definition at line 223 of file app_configuration_impl.cpp.

RuntimeExecutionMethod kagome::application::AppConfigurationImpl::runtimeExecMethod ( ) const
inlineoverridevirtual
Returns
enum constant of the chosen runtime backend

Implements kagome::application::AppConfiguration.

Definition at line 164 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::shouldSaveNodeKey ( ) const
inlineoverridevirtual
Returns
true if generated libp2p networking key should be saved

Implements kagome::application::AppConfiguration.

Definition at line 87 of file app_configuration_impl.hpp.

StorageBackend kagome::application::AppConfigurationImpl::storageBackend ( ) const
inlineoverridevirtual
Returns
enum constant of the chosen storage backend

Implements kagome::application::AppConfiguration.

Definition at line 185 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::subcommandChainInfo ( ) const
inlineoverridevirtual

Implements kagome::application::AppConfiguration.

Definition at line 179 of file app_configuration_impl.hpp.

SyncMethod kagome::application::AppConfigurationImpl::syncMethod ( ) const
inlineoverridevirtual
Returns
enum constant of the chosen sync method

Implements kagome::application::AppConfiguration.

Definition at line 161 of file app_configuration_impl.hpp.

const std::vector<telemetry::TelemetryEndpoint>& kagome::application::AppConfigurationImpl::telemetryEndpoints ( ) const
inlineoverridevirtual

List of telemetry endpoints specified via CLI argument or config file

Returns
a vector of parsed telemetry endpoints

Implements kagome::application::AppConfiguration.

Definition at line 157 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::testListenAddresses ( ) const
private

Checks whether configured listen addresses are available.

Returns
true when addresses are available, false - when at least one address is not available

Definition at line 577 of file app_configuration_impl.cpp.

bool kagome::application::AppConfigurationImpl::useWavmCache ( ) const
inlineoverridevirtual

A flag marking if we use and store precompiled WAVM runtimes. Significantly increases node restart speed. Especially useful when debugging.

Implements kagome::application::AppConfiguration.

Definition at line 167 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::validate_config ( )
private

Definition at line 421 of file app_configuration_impl.cpp.

Member Data Documentation

boost::filesystem::path kagome::application::AppConfigurationImpl::base_path_
private

Definition at line 307 of file app_configuration_impl.hpp.

std::vector<libp2p::multi::Multiaddress> kagome::application::AppConfigurationImpl::boot_nodes_
private

Definition at line 294 of file app_configuration_impl.hpp.

boost::filesystem::path kagome::application::AppConfigurationImpl::chain_spec_path_
private

Definition at line 306 of file app_configuration_impl.hpp.

std::optional<std::string> kagome::application::AppConfigurationImpl::dev_mnemonic_phrase_
private

Definition at line 331 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::dev_mode_
private

Definition at line 317 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::enable_offchain_indexing_
private

Definition at line 327 of file app_configuration_impl.hpp.

std::vector<SegmentHandler> kagome::application::AppConfigurationImpl::handlers_
private
Initial value:
= {
SegmentHandler{"general", std::bind(&AppConfigurationImpl::parse_general_segment, this, std::placeholders::_1)},
SegmentHandler{"blockchain", std::bind(&AppConfigurationImpl::parse_blockchain_segment, this, std::placeholders::_1)},
SegmentHandler{"storage", std::bind(&AppConfigurationImpl::parse_storage_segment, this, std::placeholders::_1)},
SegmentHandler{"network", std::bind(&AppConfigurationImpl::parse_network_segment, this, std::placeholders::_1)},
SegmentHandler{"additional", std::bind(&AppConfigurationImpl::parse_additional_segment, this, std::placeholders::_1)},
}

Definition at line 211 of file app_configuration_impl.hpp.

uint32_t kagome::application::AppConfigurationImpl::in_peers_
private

Definition at line 313 of file app_configuration_impl.hpp.

uint32_t kagome::application::AppConfigurationImpl::in_peers_light_
private

Definition at line 314 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::is_telemetry_enabled_
private

Definition at line 296 of file app_configuration_impl.hpp.

std::optional<boost::filesystem::path> kagome::application::AppConfigurationImpl::keystore_path_
private

Definition at line 308 of file app_configuration_impl.hpp.

std::vector<libp2p::multi::Multiaddress> kagome::application::AppConfigurationImpl::listen_addresses_
private

Definition at line 292 of file app_configuration_impl.hpp.

log::Logger kagome::application::AppConfigurationImpl::logger_
private

Definition at line 286 of file app_configuration_impl.hpp.

std::vector<std::string> kagome::application::AppConfigurationImpl::logger_tuning_config_
private

Definition at line 301 of file app_configuration_impl.hpp.

int32_t kagome::application::AppConfigurationImpl::lucky_peers_
private

Definition at line 315 of file app_configuration_impl.hpp.

uint32_t kagome::application::AppConfigurationImpl::max_blocks_in_response_
private

Definition at line 302 of file app_configuration_impl.hpp.

uint32_t kagome::application::AppConfigurationImpl::max_ws_connections_
private

Definition at line 320 of file app_configuration_impl.hpp.

std::optional<crypto::Ed25519PrivateKey> kagome::application::AppConfigurationImpl::node_key_
private

Definition at line 289 of file app_configuration_impl.hpp.

std::optional<std::string> kagome::application::AppConfigurationImpl::node_key_file_
private

Definition at line 290 of file app_configuration_impl.hpp.

std::string kagome::application::AppConfigurationImpl::node_name_
private

Definition at line 318 of file app_configuration_impl.hpp.

std::string kagome::application::AppConfigurationImpl::node_version_
private

Definition at line 319 of file app_configuration_impl.hpp.

OffchainWorkerMode kagome::application::AppConfigurationImpl::offchain_worker_mode_
private

Definition at line 326 of file app_configuration_impl.hpp.

boost::asio::ip::tcp::endpoint kagome::application::AppConfigurationImpl::openmetrics_http_endpoint_
private

Definition at line 300 of file app_configuration_impl.hpp.

std::string kagome::application::AppConfigurationImpl::openmetrics_http_host_
private

Definition at line 305 of file app_configuration_impl.hpp.

uint16_t kagome::application::AppConfigurationImpl::openmetrics_http_port_
private

Definition at line 311 of file app_configuration_impl.hpp.

uint32_t kagome::application::AppConfigurationImpl::out_peers_
private

Definition at line 312 of file app_configuration_impl.hpp.

uint16_t kagome::application::AppConfigurationImpl::p2p_port_
private

Definition at line 297 of file app_configuration_impl.hpp.

network::PeeringConfig kagome::application::AppConfigurationImpl::peering_config_
private

Definition at line 316 of file app_configuration_impl.hpp.

std::vector<libp2p::multi::Multiaddress> kagome::application::AppConfigurationImpl::public_addresses_
private

Definition at line 293 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::purge_wavm_cache_
private

Definition at line 325 of file app_configuration_impl.hpp.

uint32_t kagome::application::AppConfigurationImpl::random_walk_interval_
private

Definition at line 321 of file app_configuration_impl.hpp.

std::optional<primitives::BlockId> kagome::application::AppConfigurationImpl::recovery_state_
private

Definition at line 329 of file app_configuration_impl.hpp.

network::Roles kagome::application::AppConfigurationImpl::roles_
private

Definition at line 288 of file app_configuration_impl.hpp.

boost::asio::ip::tcp::endpoint kagome::application::AppConfigurationImpl::rpc_http_endpoint_
private

Definition at line 298 of file app_configuration_impl.hpp.

std::string kagome::application::AppConfigurationImpl::rpc_http_host_
private

Definition at line 303 of file app_configuration_impl.hpp.

uint16_t kagome::application::AppConfigurationImpl::rpc_http_port_
private

Definition at line 309 of file app_configuration_impl.hpp.

boost::asio::ip::tcp::endpoint kagome::application::AppConfigurationImpl::rpc_ws_endpoint_
private

Definition at line 299 of file app_configuration_impl.hpp.

std::string kagome::application::AppConfigurationImpl::rpc_ws_host_
private

Definition at line 304 of file app_configuration_impl.hpp.

uint16_t kagome::application::AppConfigurationImpl::rpc_ws_port_
private

Definition at line 310 of file app_configuration_impl.hpp.

RuntimeExecutionMethod kagome::application::AppConfigurationImpl::runtime_exec_method_
private

Definition at line 323 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::save_node_key_
private

Definition at line 291 of file app_configuration_impl.hpp.

StorageBackend kagome::application::AppConfigurationImpl::storage_backend_ = StorageBackend::RocksDB
private

Definition at line 330 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::subcommand_chain_info_
private

Definition at line 328 of file app_configuration_impl.hpp.

SyncMethod kagome::application::AppConfigurationImpl::sync_method_
private

Definition at line 322 of file app_configuration_impl.hpp.

std::vector<telemetry::TelemetryEndpoint> kagome::application::AppConfigurationImpl::telemetry_endpoints_
private

Definition at line 295 of file app_configuration_impl.hpp.

bool kagome::application::AppConfigurationImpl::use_wavm_cache_
private

Definition at line 324 of file app_configuration_impl.hpp.


The documentation for this class was generated from the following files: