Trait tc_cli::ChainSpec [−]
Common interface of a chain specification.
Required methods
pub fn name(&self) -> &str
Spec name.
pub fn id(&self) -> &str
Spec id.
pub fn chain_type(&self) -> ChainType
Type of the chain.
pub fn boot_nodes(&self) -> &[MultiaddrWithPeerId]
A list of bootnode addresses.
pub fn telemetry_endpoints(&self) -> &Option<TelemetryEndpoints>
Telemetry endpoints (if any)
pub fn protocol_id(&self) -> Option<&str>
Network protocol id.
pub fn properties(&self) -> Map<String, Value>
Additional loosly-typed properties of the chain.
Returns an empty JSON object if ‘properties’ not defined in config
pub fn extensions(&self) -> &dyn GetExtension
Returns a reference to defined chain spec extensions.
pub fn add_boot_node(&mut self, addr: MultiaddrWithPeerId)
Add a bootnode to the list.
pub fn as_json(&self, raw: bool) -> Result<String, String>
Return spec as JSON.
pub fn as_storage_builder(&self) -> &dyn BuildStorage
Return StorageBuilder for this spec.
pub fn cloned_box(&self) -> Box<dyn ChainSpec + 'static, Global>
Returns a cloned Box<dyn ChainSpec>
.
pub 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.
pub fn set_light_sync_state(
&mut self,
light_sync_state: SerializableLightSyncState
)
&mut self,
light_sync_state: SerializableLightSyncState
)
Hardcode infomation to allow light clients to sync quickly into the chain spec.
Trait Implementations
Implementations on Foreign Types
impl<G, E> ChainSpec for ChainSpec<G, E> where
E: GetExtension + Serialize + Clone + Send + Sync + 'static,
G: RuntimeGenesis + 'static,
E: GetExtension + Serialize + Clone + Send + Sync + 'static,
G: RuntimeGenesis + 'static,
pub fn boot_nodes(&self) -> &[MultiaddrWithPeerId]
pub fn name(&self) -> &str
pub fn id(&self) -> &str
pub fn chain_type(&self) -> ChainType
pub fn telemetry_endpoints(&self) -> &Option<TelemetryEndpoints>
pub fn protocol_id(&self) -> Option<&str>
pub fn properties(&self) -> Map<String, Value>
pub fn add_boot_node(&mut self, addr: MultiaddrWithPeerId)
pub fn extensions(&self) -> &dyn GetExtension
pub fn as_json(&self, raw: bool) -> Result<String, String>
pub fn as_storage_builder(&self) -> &dyn BuildStorage
pub fn cloned_box(&self) -> Box<dyn ChainSpec + 'static, Global>
pub fn set_storage(&mut self, storage: Storage)
pub fn set_light_sync_state(
&mut self,
light_sync_state: SerializableLightSyncState
)
&mut self,
light_sync_state: SerializableLightSyncState
)