Trait sc_chain_spec::ChainSpec
source · [−]pub trait ChainSpec: BuildStorage + Send + Sync {
Show 14 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 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>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
;
fn set_storage(&mut self, storage: Storage);
fn set_light_sync_state(
&mut self,
light_sync_state: SerializableLightSyncState
);
}
Expand description
Common interface of a chain specification.
Required methods
fn chain_type(&self) -> ChainType
fn chain_type(&self) -> ChainType
Type of the chain.
fn boot_nodes(&self) -> &[MultiaddrWithPeerId]
fn boot_nodes(&self) -> &[MultiaddrWithPeerId]
A list of bootnode addresses.
fn telemetry_endpoints(&self) -> &Option<TelemetryEndpoints>
fn telemetry_endpoints(&self) -> &Option<TelemetryEndpoints>
Telemetry endpoints (if any)
fn protocol_id(&self) -> Option<&str>
fn protocol_id(&self) -> Option<&str>
Network protocol id.
fn properties(&self) -> Properties
fn properties(&self) -> Properties
Additional loosly-typed properties of the chain.
Returns an empty JSON object if ‘properties’ not defined in config
fn extensions(&self) -> &dyn GetExtension
fn extensions(&self) -> &dyn GetExtension
Returns a reference to defined chain spec extensions.
fn add_boot_node(&mut self, addr: MultiaddrWithPeerId)
fn add_boot_node(&mut self, addr: MultiaddrWithPeerId)
Add a bootnode to the list.
fn as_storage_builder(&self) -> &dyn BuildStorage
fn as_storage_builder(&self) -> &dyn BuildStorage
Return StorageBuilder for this spec.
fn cloned_box(&self) -> Box<dyn ChainSpec>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn cloned_box(&self) -> Box<dyn ChainSpec>ⓘNotable traits for Box<R, Global>impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
Returns a cloned Box<dyn ChainSpec>
.
fn 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.
fn set_light_sync_state(&mut self, light_sync_state: SerializableLightSyncState)
fn set_light_sync_state(&mut self, light_sync_state: SerializableLightSyncState)
Hardcode infomation to allow light clients to sync quickly into the chain spec.