Kagome
Polkadot Runtime Engine in C++17
kagome::application::AppConfiguration Class Referenceabstract

#include <app_configuration.hpp>

Inheritance diagram for kagome::application::AppConfiguration:
Collaboration diagram for kagome::application::AppConfiguration:

Public Types

enum  SyncMethod { SyncMethod::Full, SyncMethod::Fast }
 
enum  RuntimeExecutionMethod { RuntimeExecutionMethod::Compile, RuntimeExecutionMethod::Interpret }
 
enum  OffchainWorkerMode { OffchainWorkerMode::WhenValidating, OffchainWorkerMode::Always, OffchainWorkerMode::Never }
 
enum  StorageBackend { StorageBackend::RocksDB }
 

Public Member Functions

virtual ~AppConfiguration ()=default
 
virtual network::Roles roles () const =0
 
virtual boost::filesystem::path chainSpecPath () const =0
 
virtual boost::filesystem::path runtimeCacheDirPath () const =0
 
virtual boost::filesystem::path runtimeCachePath (std::string runtime_hash) const =0
 
virtual boost::filesystem::path chainPath (std::string chain_id) const =0
 
virtual boost::filesystem::path databasePath (std::string chain_id) const =0
 
virtual boost::filesystem::path keystorePath (std::string chain_id) const =0
 
virtual const std::optional< crypto::Ed25519PrivateKey > & nodeKey () const =0
 
virtual const std::optional< std::string > & nodeKeyFile () const =0
 
virtual bool shouldSaveNodeKey () const =0
 
virtual uint16_t p2pPort () const =0
 
virtual uint32_t outPeers () const =0
 
virtual uint32_t inPeers () const =0
 
virtual uint32_t inPeersLight () const =0
 
virtual int32_t luckyPeers () const =0
 
virtual const std::vector< libp2p::multi::Multiaddress > & bootNodes () const =0
 
virtual const std::vector< libp2p::multi::Multiaddress > & listenAddresses () const =0
 
virtual const std::vector< libp2p::multi::Multiaddress > & publicAddresses () const =0
 
virtual const boost::asio::ip::tcp::endpoint & rpcHttpEndpoint () const =0
 
virtual const boost::asio::ip::tcp::endpoint & rpcWsEndpoint () const =0
 
virtual const boost::asio::ip::tcp::endpoint & openmetricsHttpEndpoint () const =0
 
virtual uint32_t maxWsConnections () const =0
 
virtual std::chrono::seconds getRandomWalkInterval () const =0
 
virtual const std::vector< std::string > & log () const =0
 
virtual uint32_t maxBlocksInResponse () const =0
 
virtual const network::PeeringConfigpeeringConfig () const =0
 
virtual bool isRunInDevMode () const =0
 
virtual const std::string & nodeName () const =0
 
virtual const std::string & nodeVersion () const =0
 
virtual bool isTelemetryEnabled () const =0
 
virtual const std::vector< telemetry::TelemetryEndpoint > & telemetryEndpoints () const =0
 
virtual SyncMethod syncMethod () const =0
 
virtual RuntimeExecutionMethod runtimeExecMethod () const =0
 
virtual bool useWavmCache () const =0
 
virtual bool purgeWavmCache () const =0
 
virtual OffchainWorkerMode offchainWorkerMode () const =0
 
virtual bool isOffchainIndexingEnabled () const =0
 
virtual bool subcommandChainInfo () const =0
 
virtual std::optional< primitives::BlockIdrecoverState () const =0
 
virtual StorageBackend storageBackend () const =0
 
virtual std::optional< std::string_view > devMnemonicPhrase () const =0
 

Static Public Attributes

static constexpr uint32_t kAbsolutMinBlocksInResponse = 1
 
static constexpr uint32_t kAbsolutMaxBlocksInResponse = 128
 
static constexpr uint32_t kNodeNameMaxLength = 64
 

Detailed Description

Parse and store application config.

Definition at line 29 of file app_configuration.hpp.

Member Enumeration Documentation

Enumerator
WhenValidating 
Always 
Never 

Definition at line 231 of file app_configuration.hpp.

Enumerator
Compile 
Interpret 

Definition at line 213 of file app_configuration.hpp.

Enumerator
RocksDB 

Definition at line 243 of file app_configuration.hpp.

Enumerator
Full 
Fast 

Definition at line 207 of file app_configuration.hpp.

Constructor & Destructor Documentation

virtual kagome::application::AppConfiguration::~AppConfiguration ( )
virtualdefault

Member Function Documentation

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

Implemented in kagome::application::AppConfigurationImpl.

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

Implemented in kagome::application::AppConfigurationImpl.

virtual boost::filesystem::path kagome::application::AppConfiguration::chainSpecPath ( ) const
pure virtual
Returns
file path with genesis configuration.

Implemented in kagome::application::AppConfigurationImpl.

virtual boost::filesystem::path kagome::application::AppConfiguration::databasePath ( std::string  chain_id) const
pure virtual
Returns
path to the node's database for the chain
  • chain_id

Implemented in kagome::application::AppConfigurationImpl.

virtual std::optional<std::string_view> kagome::application::AppConfiguration::devMnemonicPhrase ( ) const
pure virtual

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

Implemented in kagome::application::AppConfigurationImpl.

virtual std::chrono::seconds kagome::application::AppConfiguration::getRandomWalkInterval ( ) const
pure virtual
Returns
Kademlia random walk interval

Implemented in kagome::application::AppConfigurationImpl.

virtual uint32_t kagome::application::AppConfiguration::inPeers ( ) const
pure virtual
Returns
maximum number of inbound full nodes peers

Implemented in kagome::application::AppConfigurationImpl.

virtual uint32_t kagome::application::AppConfiguration::inPeersLight ( ) const
pure virtual
Returns
maximum number of inbound light nodes peers

Implemented in kagome::application::AppConfigurationImpl.

virtual bool kagome::application::AppConfiguration::isOffchainIndexingEnabled ( ) const
pure virtual
virtual bool kagome::application::AppConfiguration::isRunInDevMode ( ) const
pure virtual
Returns
true if node allowed to run in development mode

Implemented in kagome::application::AppConfigurationImpl.

virtual bool kagome::application::AppConfiguration::isTelemetryEnabled ( ) const
pure virtual
Returns
true when telemetry broadcasting is enabled, otherwise - false

Implemented in kagome::application::AppConfigurationImpl.

virtual boost::filesystem::path kagome::application::AppConfiguration::keystorePath ( std::string  chain_id) const
pure virtual
Returns
path to the node's keystore for the chain
  • chain_id

Implemented in kagome::application::AppConfigurationImpl.

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

Implemented in kagome::application::AppConfigurationImpl.

virtual const std::vector<std::string>& kagome::application::AppConfiguration::log ( ) const
pure virtual
Returns
logging system tuning config

Implemented in kagome::application::AppConfigurationImpl.

virtual int32_t kagome::application::AppConfiguration::luckyPeers ( ) const
pure virtual
Returns
int32_t maximum number or lucky peers (peers being gossiped to)

Implemented in kagome::application::AppConfigurationImpl.

virtual uint32_t kagome::application::AppConfiguration::maxBlocksInResponse ( ) const
pure virtual
Returns
max blocks count per response while syncing

Implemented in kagome::application::AppConfigurationImpl.

virtual uint32_t kagome::application::AppConfiguration::maxWsConnections ( ) const
pure virtual
Returns
maximum number of WS RPC connections

Implemented in kagome::application::AppConfigurationImpl.

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

Implemented in kagome::application::AppConfigurationImpl.

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

Implemented in kagome::application::AppConfigurationImpl.

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

Implemented in kagome::application::AppConfigurationImpl.

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

Implemented in kagome::application::AppConfigurationImpl.

virtual OffchainWorkerMode kagome::application::AppConfiguration::offchainWorkerMode ( ) const
pure virtual
Returns
enum constant of the mode of run offchain workers

Implemented in kagome::application::AppConfigurationImpl.

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

Implemented in kagome::application::AppConfigurationImpl.

virtual uint32_t kagome::application::AppConfiguration::outPeers ( ) const
pure virtual
Returns
number of outgoing connections we're trying to maintain

Implemented in kagome::application::AppConfigurationImpl.

virtual uint16_t kagome::application::AppConfiguration::p2pPort ( ) const
pure virtual
Returns
port for peer to peer interactions.

Implemented in kagome::application::AppConfigurationImpl.

virtual const network::PeeringConfig& kagome::application::AppConfiguration::peeringConfig ( ) const
pure virtual

Config for PeerManager

Implemented in kagome::application::AppConfigurationImpl.

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

Implemented in kagome::application::AppConfigurationImpl.

virtual bool kagome::application::AppConfiguration::purgeWavmCache ( ) const
pure virtual

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

Implemented in kagome::application::AppConfigurationImpl.

virtual std::optional<primitives::BlockId> kagome::application::AppConfiguration::recoverState ( ) const
pure virtual
virtual network::Roles kagome::application::AppConfiguration::roles ( ) const
pure virtual
Returns
roles of current run

Implemented in kagome::application::AppConfigurationImpl.

virtual const boost::asio::ip::tcp::endpoint& kagome::application::AppConfiguration::rpcHttpEndpoint ( ) const
pure virtual
Returns
endpoint for RPC over HTTP.

Implemented in kagome::application::AppConfigurationImpl.

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

Implemented in kagome::application::AppConfigurationImpl.

virtual boost::filesystem::path kagome::application::AppConfiguration::runtimeCacheDirPath ( ) const
pure virtual
Returns
path to precompiled WAVM runtime cache directory

Implemented in kagome::application::AppConfigurationImpl.

virtual boost::filesystem::path kagome::application::AppConfiguration::runtimeCachePath ( std::string  runtime_hash) const
pure virtual
Returns
path to cached precompiled WAVM runtime

Implemented in kagome::application::AppConfigurationImpl.

virtual RuntimeExecutionMethod kagome::application::AppConfiguration::runtimeExecMethod ( ) const
pure virtual
Returns
enum constant of the chosen runtime backend

Implemented in kagome::application::AppConfigurationImpl.

virtual bool kagome::application::AppConfiguration::shouldSaveNodeKey ( ) const
pure virtual
Returns
true if generated libp2p networking key should be saved

Implemented in kagome::application::AppConfigurationImpl.

virtual StorageBackend kagome::application::AppConfiguration::storageBackend ( ) const
pure virtual
Returns
enum constant of the chosen storage backend

Implemented in kagome::application::AppConfigurationImpl.

virtual bool kagome::application::AppConfiguration::subcommandChainInfo ( ) const
pure virtual
virtual SyncMethod kagome::application::AppConfiguration::syncMethod ( ) const
pure virtual
Returns
enum constant of the chosen sync method

Implemented in kagome::application::AppConfigurationImpl.

virtual const std::vector<telemetry::TelemetryEndpoint>& kagome::application::AppConfiguration::telemetryEndpoints ( ) const
pure virtual

List of telemetry endpoints specified via CLI argument or config file

Returns
a vector of parsed telemetry endpoints

Implemented in kagome::application::AppConfigurationImpl.

virtual bool kagome::application::AppConfiguration::useWavmCache ( ) const
pure virtual

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

Implemented in kagome::application::AppConfigurationImpl.

Member Data Documentation

constexpr uint32_t kagome::application::AppConfiguration::kAbsolutMaxBlocksInResponse = 128
static

Definition at line 32 of file app_configuration.hpp.

constexpr uint32_t kagome::application::AppConfiguration::kAbsolutMinBlocksInResponse = 1
static

Definition at line 31 of file app_configuration.hpp.

constexpr uint32_t kagome::application::AppConfiguration::kNodeNameMaxLength = 64
static

Definition at line 33 of file app_configuration.hpp.


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