referrerpolicy=no-referrer-when-downgrade
polkadot_omni_node_lib::chain_spec

Trait 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§

Source

fn name(&self) -> &str

Spec name.

Source

fn id(&self) -> &str

Spec id.

Source

fn chain_type(&self) -> ChainType

Type of the chain.

Source

fn boot_nodes(&self) -> &[MultiaddrWithPeerId]

A list of bootnode addresses.

Source

fn telemetry_endpoints(&self) -> &Option<TelemetryEndpoints>

Telemetry endpoints (if any)

Source

fn protocol_id(&self) -> Option<&str>

Network protocol id.

Source

fn fork_id(&self) -> Option<&str>

Optional network fork identifier. None by default.

Source

fn properties(&self) -> Map<String, Value>

Additional loosely-typed properties of the chain.

Returns an empty JSON object if ‘properties’ not defined in config

Source

fn extensions(&self) -> &dyn GetExtension

Returns a reference to the defined chain spec extensions.

Source

fn extensions_mut(&mut self) -> &mut dyn GetExtension

Returns a mutable reference to the defined chain spec extensions.

Source

fn add_boot_node(&mut self, addr: MultiaddrWithPeerId)

Add a bootnode to the list.

Source

fn as_json(&self, raw: bool) -> Result<String, String>

Return spec as JSON.

Source

fn as_storage_builder(&self) -> &dyn BuildStorage

Return StorageBuilder for this spec.

Source

fn cloned_box(&self) -> Box<dyn ChainSpec>

Returns a cloned Box<dyn ChainSpec>.

Source

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.

Source

fn code_substitutes(&self) -> BTreeMap<String, Vec<u8>>

Returns code substitutes that should be used for the on chain wasm.

Trait Implementations§

Source§

impl Debug for dyn ChainSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl IdentifyNetworkBackend for Box<dyn ChainSpec>

§

fn network_backend(&self) -> NetworkBackendType

Returns the default network backend.
§

impl IdentifyVariant for Box<dyn ChainSpec>

§

fn is_polkadot(&self) -> bool

Returns if this is a configuration for the Polkadot network.
§

fn is_kusama(&self) -> bool

Returns if this is a configuration for the Kusama network.
§

fn is_westend(&self) -> bool

Returns if this is a configuration for the Westend network.
§

fn is_rococo(&self) -> bool

Returns if this is a configuration for the Rococo network.
§

fn is_versi(&self) -> bool

Returns if this is a configuration for the Versi test network.
§

fn is_dev(&self) -> bool

Returns true if this configuration is for a development network.
§

fn identify_chain(&self) -> Chain

Identifies the variant of the chain.

Implementors§

Source§

impl<E, EHF> ChainSpec for ChainSpec<E, EHF>
where E: GetExtension + Serialize + Clone + Send + Sync + 'static, EHF: HostFunctions,