6 #ifndef KAGOME_CHAIN_SPEC_IMPL_HPP 7 #define KAGOME_CHAIN_SPEC_IMPL_HPP 11 #include <boost/property_tree/ptree.hpp> 27 static outcome::result<std::shared_ptr<ChainSpecImpl>>
loadFrom(
28 const std::string &config_path);
32 const std::string &
name()
const override {
36 const std::string &
id()
const override {
44 const std::vector<libp2p::multi::Multiaddress> &
bootNodes()
const override {
57 const std::map<std::string, std::string> &
properties()
const override {
61 std::optional<std::reference_wrapper<const std::string>>
getProperty(
62 const std::string &property)
const override {
65 return {{it->second}};
70 const std::set<primitives::BlockHash> &
forkBlocks()
const override {
74 const std::set<primitives::BlockHash> &
badBlocks()
const override {
100 outcome::result<void>
loadFromJson(
const std::string &file_path);
101 outcome::result<void>
loadFields(
const boost::property_tree::ptree &tree);
102 outcome::result<void>
loadGenesis(
const boost::property_tree::ptree &tree);
104 const boost::property_tree::ptree &tree);
106 template <
typename T>
107 outcome::result<std::decay_t<T>>
ensure(std::string_view entry_name,
108 boost::optional<T> opt_entry) {
110 log_->error(
"Required '{}' entry not found in the chain spec",
114 return opt_entry.value();
118 const std::string_view block_id_str)
const;
143 #endif // KAGOME_CHAIN_SPEC_IMPL_HPP std::shared_ptr< primitives::CodeSubstituteBlockIds > known_code_substitutes_
std::vector< libp2p::multi::Multiaddress > boot_nodes_
const std::set< primitives::BlockHash > & badBlocks() const override
std::map< std::string, std::string > properties_
outcome::result< void > loadFromJson(const std::string &file_path)
outcome::result< primitives::BlockId > parseBlockId(const std::string_view block_id_str) const
const std::string & id() const override
outcome::result< common::Buffer > fetchCodeSubstituteByBlockInfo(const primitives::BlockInfo &block_info) const override
std::vector< std::pair< std::string, size_t > > telemetry_endpoints_
ChildrenDefaultRawData children_default_
std::optional< std::reference_wrapper< const std::string > > getProperty(const std::string &property) const override
static outcome::result< std::shared_ptr< ChainSpecImpl > > loadFrom(const std::string &config_path)
outcome::result< void > loadFields(const boost::property_tree::ptree &tree)
const std::string & protocolId() const override
OUTCOME_HPP_DECLARE_ERROR(kagome::api, JRpcServerImpl::Error)
const std::string & chainType() const override
std::set< primitives::BlockHash > fork_blocks_
std::vector< std::pair< common::Buffer, common::Buffer >> GenesisRawData
std::optional< std::string > consensusEngine() const override
std::shared_ptr< soralog::Logger > Logger
std::optional< std::string > consensus_engine_
std::set< primitives::BlockHash > bad_blocks_
std::shared_ptr< const primitives::CodeSubstituteBlockIds > codeSubstitutes() const override
const ChildrenDefaultRawData & getGenesisChildrenDefaultSection() const override
const std::vector< libp2p::multi::Multiaddress > & bootNodes() const override
Return ids of peer nodes of the current node.
~ChainSpecImpl() override=default
const std::vector< std::pair< std::string, size_t > > & telemetryEndpoints() const override
std::map< common::Buffer, GenesisRawData > ChildrenDefaultRawData
const std::set< primitives::BlockHash > & forkBlocks() const override
outcome::result< void > loadGenesis(const boost::property_tree::ptree &tree)
const std::map< std::string, std::string > & properties() const override
Logger createLogger(const std::string &tag)
outcome::result< void > loadBootNodes(const boost::property_tree::ptree &tree)
const GenesisRawData & getGenesisTopSection() const override
const std::string & name() const override
outcome::result< std::decay_t< T > > ensure(std::string_view entry_name, boost::optional< T > opt_entry)