Kagome
Polkadot Runtime Engine in C++17
|
#include <app_configuration_impl.hpp>
Classes | |
struct | SegmentHandler |
Public Member Functions | |
AppConfigurationImpl (log::Logger logger) | |
~AppConfigurationImpl () override=default | |
AppConfigurationImpl (const AppConfigurationImpl &)=delete | |
AppConfigurationImpl & | operator= (const AppConfigurationImpl &)=delete |
AppConfigurationImpl (AppConfigurationImpl &&)=default | |
AppConfigurationImpl & | operator= (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::PeeringConfig & | peeringConfig () 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::BlockId > | recoverState () 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::TelemetryEndpoint > | parseTelemetryEndpoint (const std::string &record) const |
FilePtr | open_file (const std::string &filepath) |
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 |
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.
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.
Class Members | ||
---|---|---|
typedef function< void(Value &)> | Handler |
Class Members | ||
---|---|---|
Handler | handler | |
char const * | segment_name |
|
private |
Definition at line 54 of file app_configuration_impl.hpp.
|
explicit |
Definition at line 182 of file app_configuration_impl.cpp.
|
overridedefault |
|
delete |
|
default |
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 101 of file app_configuration_impl.hpp.
|
overridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 228 of file app_configuration_impl.cpp.
|
overridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 215 of file app_configuration_impl.cpp.
|
overridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 233 of file app_configuration_impl.cpp.
|
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.
|
private |
Convert given values into boost tcp::endpoint representation format
host | - host name |
port | - port value |
Definition at line 516 of file app_configuration_impl.cpp.
|
private |
Convert a given libp2p multiaddress into a boost tcp::endpoint format.
multiaddress | - an address to be converted. Should contain a valid interface name or IP4/IP6 address and a port value to listen on. |
Definition at line 532 of file app_configuration_impl.cpp.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 111 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 114 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 176 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 145 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 154 of file app_configuration_impl.hpp.
|
overridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 237 of file app_configuration_impl.cpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 91 of file app_configuration_impl.hpp.
|
private |
Definition at line 306 of file app_configuration_impl.cpp.
|
private |
Definition at line 343 of file app_configuration_impl.cpp.
|
private |
Definition at line 259 of file app_configuration_impl.cpp.
|
private |
Definition at line 249 of file app_configuration_impl.cpp.
|
private |
Definition at line 295 of file app_configuration_impl.cpp.
|
private |
Definition at line 275 of file app_configuration_impl.cpp.
|
private |
Definition at line 317 of file app_configuration_impl.cpp.
|
private |
Definition at line 329 of file app_configuration_impl.cpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 136 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 117 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 139 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 130 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 79 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 83 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 148 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 151 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 173 of file app_configuration_impl.hpp.
|
private |
Definition at line 242 of file app_configuration_impl.cpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 126 of file app_configuration_impl.hpp.
|
delete |
|
default |
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 108 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 105 of file app_configuration_impl.hpp.
|
private |
Definition at line 415 of file app_configuration_impl.cpp.
|
private |
Definition at line 366 of file app_configuration_impl.cpp.
|
private |
Definition at line 354 of file app_configuration_impl.cpp.
|
private |
Definition at line 393 of file app_configuration_impl.cpp.
|
private |
Definition at line 373 of file app_configuration_impl.cpp.
|
private |
Parses telemetry endpoint URI and verbosity level from a single string record of format: "<endpoint URI> <verbosity: 0-9>"
record | - input string |
Definition at line 604 of file app_configuration_impl.cpp.
|
inlineoverridevirtual |
Config for PeerManager
Implements kagome::application::AppConfiguration.
Definition at line 142 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 96 of file app_configuration_impl.hpp.
|
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.
|
private |
Definition at line 478 of file app_configuration_impl.cpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 182 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 68 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 120 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 123 of file app_configuration_impl.hpp.
|
overridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 219 of file app_configuration_impl.cpp.
|
overridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 223 of file app_configuration_impl.cpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 164 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 87 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 185 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 179 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
Implements kagome::application::AppConfiguration.
Definition at line 161 of file app_configuration_impl.hpp.
|
inlineoverridevirtual |
List of telemetry endpoints specified via CLI argument or config file
Implements kagome::application::AppConfiguration.
Definition at line 157 of file app_configuration_impl.hpp.
|
private |
Checks whether configured listen addresses are available.
Definition at line 577 of file app_configuration_impl.cpp.
|
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.
|
private |
Definition at line 421 of file app_configuration_impl.cpp.
|
private |
Definition at line 307 of file app_configuration_impl.hpp.
|
private |
Definition at line 294 of file app_configuration_impl.hpp.
|
private |
Definition at line 306 of file app_configuration_impl.hpp.
|
private |
Definition at line 331 of file app_configuration_impl.hpp.
|
private |
Definition at line 317 of file app_configuration_impl.hpp.
|
private |
Definition at line 327 of file app_configuration_impl.hpp.
|
private |
Definition at line 211 of file app_configuration_impl.hpp.
|
private |
Definition at line 313 of file app_configuration_impl.hpp.
|
private |
Definition at line 314 of file app_configuration_impl.hpp.
|
private |
Definition at line 296 of file app_configuration_impl.hpp.
|
private |
Definition at line 308 of file app_configuration_impl.hpp.
|
private |
Definition at line 292 of file app_configuration_impl.hpp.
|
private |
Definition at line 286 of file app_configuration_impl.hpp.
|
private |
Definition at line 301 of file app_configuration_impl.hpp.
|
private |
Definition at line 315 of file app_configuration_impl.hpp.
|
private |
Definition at line 302 of file app_configuration_impl.hpp.
|
private |
Definition at line 320 of file app_configuration_impl.hpp.
|
private |
Definition at line 289 of file app_configuration_impl.hpp.
|
private |
Definition at line 290 of file app_configuration_impl.hpp.
|
private |
Definition at line 318 of file app_configuration_impl.hpp.
|
private |
Definition at line 319 of file app_configuration_impl.hpp.
|
private |
Definition at line 326 of file app_configuration_impl.hpp.
|
private |
Definition at line 300 of file app_configuration_impl.hpp.
|
private |
Definition at line 305 of file app_configuration_impl.hpp.
|
private |
Definition at line 311 of file app_configuration_impl.hpp.
|
private |
Definition at line 312 of file app_configuration_impl.hpp.
|
private |
Definition at line 297 of file app_configuration_impl.hpp.
|
private |
Definition at line 316 of file app_configuration_impl.hpp.
|
private |
Definition at line 293 of file app_configuration_impl.hpp.
|
private |
Definition at line 325 of file app_configuration_impl.hpp.
|
private |
Definition at line 321 of file app_configuration_impl.hpp.
|
private |
Definition at line 329 of file app_configuration_impl.hpp.
|
private |
Definition at line 288 of file app_configuration_impl.hpp.
|
private |
Definition at line 298 of file app_configuration_impl.hpp.
|
private |
Definition at line 303 of file app_configuration_impl.hpp.
|
private |
Definition at line 309 of file app_configuration_impl.hpp.
|
private |
Definition at line 299 of file app_configuration_impl.hpp.
|
private |
Definition at line 304 of file app_configuration_impl.hpp.
|
private |
Definition at line 310 of file app_configuration_impl.hpp.
|
private |
Definition at line 323 of file app_configuration_impl.hpp.
|
private |
Definition at line 291 of file app_configuration_impl.hpp.
|
private |
Definition at line 330 of file app_configuration_impl.hpp.
|
private |
Definition at line 328 of file app_configuration_impl.hpp.
|
private |
Definition at line 322 of file app_configuration_impl.hpp.
|
private |
Definition at line 295 of file app_configuration_impl.hpp.
|
private |
Definition at line 324 of file app_configuration_impl.hpp.