[][src]Struct substrate_service::ChainSpec

pub struct ChainSpec<G: RuntimeGenesis> { /* fields omitted */ }

A configuration of a chain. Can be used to build a genesis block.


impl<G: RuntimeGenesis> ChainSpec<G>[src]

pub fn boot_nodes(&self) -> &[String][src]

A list of bootnode addresses.

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

Spec name.

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

Spec id.

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

Telemetry endpoints (if any)

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

Network protocol id.

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

Name of the consensus engine.

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

Additional loosly-typed properties of the chain.

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

Add a bootnode to the list.

pub fn from_embedded(json: &'static [u8]) -> Result<Self, String>[src]

Parse json content into a ChainSpec

pub fn from_json_file(path: PathBuf) -> Result<Self, String>[src]

Parse json file into a ChainSpec

pub fn from_genesis(
    name: &str,
    id: &str,
    constructor: fn() -> G,
    boot_nodes: Vec<String>,
    telemetry_endpoints: Option<TelemetryEndpoints>,
    protocol_id: Option<&str>,
    consensus_engine: Option<&str>,
    properties: Option<Properties>
) -> Self

Create hardcoded spec.

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

Dump to json string.

Trait Implementations

impl<G: RuntimeGenesis> Clone for ChainSpec<G>[src]

impl<'a, G: RuntimeGenesis> BuildStorage for &'a ChainSpec<G>[src]

Auto Trait Implementations

impl<G> Sync for ChainSpec<G>

impl<G> Send for ChainSpec<G>

impl<G> Unpin for ChainSpec<G>

impl<G> UnwindSafe for ChainSpec<G>

impl<G> RefUnwindSafe for ChainSpec<G>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Erased for T[src]

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Erased for T[src]

impl<T> Typeable for T where
    T: Any

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized