Trait polkadot_omni_node_lib::chain_spec::ChainSpec
source · pub trait ChainSpec: BuildStorage + Send + Sync {
Show 16 methods
// Required methods
fn name(&self) -> &str;
fn id(&self) -> &str;
fn chain_type(&self) -> ChainType;
fn boot_nodes(&self) -> &[MultiaddrWithPeerId];
fn telemetry_endpoints(&self) -> &Option<TelemetryEndpoints>;
fn protocol_id(&self) -> Option<&str>;
fn fork_id(&self) -> Option<&str>;
fn properties(&self) -> Map<String, Value>;
fn extensions(&self) -> &dyn GetExtension;
fn extensions_mut(&mut self) -> &mut dyn GetExtension;
fn add_boot_node(&mut self, addr: MultiaddrWithPeerId);
fn as_json(&self, raw: bool) -> Result<String, String>;
fn as_storage_builder(&self) -> &dyn BuildStorage;
fn cloned_box(&self) -> Box<dyn ChainSpec>;
fn set_storage(&mut self, storage: Storage);
fn code_substitutes(&self) -> BTreeMap<String, Vec<u8>>;
}
Expand description
Common interface of a chain specification.
Required Methods§
sourcefn chain_type(&self) -> ChainType
fn chain_type(&self) -> ChainType
Type of the chain.
sourcefn boot_nodes(&self) -> &[MultiaddrWithPeerId]
fn boot_nodes(&self) -> &[MultiaddrWithPeerId]
A list of bootnode addresses.
sourcefn telemetry_endpoints(&self) -> &Option<TelemetryEndpoints>
fn telemetry_endpoints(&self) -> &Option<TelemetryEndpoints>
Telemetry endpoints (if any)
sourcefn protocol_id(&self) -> Option<&str>
fn protocol_id(&self) -> Option<&str>
Network protocol id.
sourcefn properties(&self) -> Map<String, Value>
fn properties(&self) -> Map<String, Value>
Additional loosely-typed properties of the chain.
Returns an empty JSON object if ‘properties’ not defined in config
sourcefn extensions(&self) -> &dyn GetExtension
fn extensions(&self) -> &dyn GetExtension
Returns a reference to the defined chain spec extensions.
sourcefn extensions_mut(&mut self) -> &mut dyn GetExtension
fn extensions_mut(&mut self) -> &mut dyn GetExtension
Returns a mutable reference to the defined chain spec extensions.
sourcefn add_boot_node(&mut self, addr: MultiaddrWithPeerId)
fn add_boot_node(&mut self, addr: MultiaddrWithPeerId)
Add a bootnode to the list.
sourcefn as_storage_builder(&self) -> &dyn BuildStorage
fn as_storage_builder(&self) -> &dyn BuildStorage
Return StorageBuilder for this spec.
sourcefn cloned_box(&self) -> Box<dyn ChainSpec>
fn cloned_box(&self) -> Box<dyn ChainSpec>
Returns a cloned Box<dyn ChainSpec>
.
sourcefn set_storage(&mut self, storage: Storage)
fn set_storage(&mut self, storage: Storage)
Set the storage that should be used by this chain spec.
This will be used as storage at genesis.
Trait Implementations§
§impl IdentifyVariant for Box<dyn ChainSpec>
impl IdentifyVariant for Box<dyn ChainSpec>
§fn is_polkadot(&self) -> bool
fn is_polkadot(&self) -> bool
Returns if this is a configuration for the
Polkadot
network.§fn is_westend(&self) -> bool
fn is_westend(&self) -> bool
Returns if this is a configuration for the
Westend
network.§fn identify_chain(&self) -> Chain
fn identify_chain(&self) -> Chain
Identifies the variant of the chain.