Trait tc_chain_spec::ChainSpec[][src]

pub trait ChainSpec: BuildStorage + Send + Sync {
    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 properties(&self) -> Properties;
fn extensions(&self) -> &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 set_light_sync_state(
        &mut self,
        light_sync_state: SerializableLightSyncState
    ); }

Common interface of a chain specification.

Required methods

fn name(&self) -> &str[src]

Spec name.

fn id(&self) -> &str[src]

Spec id.

fn chain_type(&self) -> ChainType[src]

Type of the chain.

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

A list of bootnode addresses.

fn telemetry_endpoints(&self) -> &Option<TelemetryEndpoints>[src]

Telemetry endpoints (if any)

fn protocol_id(&self) -> Option<&str>[src]

Network protocol id.

fn properties(&self) -> Properties[src]

Additional loosly-typed properties of the chain.

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

fn extensions(&self) -> &dyn GetExtension[src]

Returns a reference to defined chain spec extensions.

fn add_boot_node(&mut self, addr: MultiaddrWithPeerId)[src]

Add a bootnode to the list.

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

Return spec as JSON.

fn as_storage_builder(&self) -> &dyn BuildStorage[src]

Return StorageBuilder for this spec.

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

Returns a cloned Box<dyn ChainSpec>.

fn set_storage(&mut self, storage: Storage)[src]

Set the storage that should be used by this chain spec.

This will be used as storage at genesis.

fn set_light_sync_state(&mut self, light_sync_state: SerializableLightSyncState)[src]

Hardcode infomation to allow light clients to sync quickly into the chain spec.

Loading content...

Trait Implementations

impl Debug for dyn ChainSpec[src]

Implementors

impl<G, E> ChainSpec for ChainSpec<G, E> where
    G: RuntimeGenesis + 'static,
    E: GetExtension + Serialize + Clone + Send + Sync + 'static, 
[src]

Loading content...