Type Alias frontier_template_node::chain_spec::ChainSpec
source · pub type ChainSpec = GenericChainSpec<RuntimeGenesisConfig>;
Expand description
Specialized ChainSpec
. This is a specialization of the general Substrate ChainSpec type.
Aliased Type§
struct ChainSpec {
client_spec: ClientSpec<Option<()>>,
genesis: GenesisSource<RuntimeGenesisConfig>,
_host_functions: PhantomData<()>,
}
Fields§
§client_spec: ClientSpec<Option<()>>
§genesis: GenesisSource<RuntimeGenesisConfig>
§_host_functions: PhantomData<()>
Implementations
§impl<G, E, EHF> ChainSpec<G, E, EHF>
impl<G, E, EHF> ChainSpec<G, E, EHF>
pub fn boot_nodes(&self) -> &[MultiaddrWithPeerId]
pub fn boot_nodes(&self) -> &[MultiaddrWithPeerId]
A list of bootnode addresses.
pub fn telemetry_endpoints(&self) -> &Option<TelemetryEndpoints>
pub fn telemetry_endpoints(&self) -> &Option<TelemetryEndpoints>
Telemetry endpoints (if any)
pub fn protocol_id(&self) -> Option<&str>
pub fn protocol_id(&self) -> Option<&str>
Network protocol id.
pub fn properties(&self) -> Map<String, Value>
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 add_boot_node(&mut self, addr: MultiaddrWithPeerId)
pub fn add_boot_node(&mut self, addr: MultiaddrWithPeerId)
Add a bootnode to the list.
pub fn extensions(&self) -> &E
pub fn extensions(&self) -> &E
Returns a reference to the defined chain spec extensions.
pub fn extensions_mut(&mut self) -> &mut E
pub fn extensions_mut(&mut self) -> &mut E
Returns a mutable reference to the defined chain spec extensions.
pub fn from_genesis<F>(
name: &str,
id: &str,
chain_type: ChainType,
constructor: F,
boot_nodes: Vec<MultiaddrWithPeerId>,
telemetry_endpoints: Option<TelemetryEndpoints>,
protocol_id: Option<&str>,
fork_id: Option<&str>,
properties: Option<Map<String, Value>>,
extensions: E,
code: &[u8]
) -> ChainSpec<G, E, EHF>
👎Deprecated: from_genesis
is planned to be removed in May 2024. Use builder()
instead.
pub fn from_genesis<F>( name: &str, id: &str, chain_type: ChainType, constructor: F, boot_nodes: Vec<MultiaddrWithPeerId>, telemetry_endpoints: Option<TelemetryEndpoints>, protocol_id: Option<&str>, fork_id: Option<&str>, properties: Option<Map<String, Value>>, extensions: E, code: &[u8] ) -> ChainSpec<G, E, EHF>
from_genesis
is planned to be removed in May 2024. Use builder()
instead.Create hardcoded spec.
§impl<G, E, EHF> ChainSpec<G, E, EHF>where
G: DeserializeOwned,
E: DeserializeOwned,
impl<G, E, EHF> ChainSpec<G, E, EHF>where
G: DeserializeOwned,
E: DeserializeOwned,
pub fn from_json_bytes(
json: impl Into<Cow<'static, [u8]>>
) -> Result<ChainSpec<G, E, EHF>, String>
pub fn from_json_bytes( json: impl Into<Cow<'static, [u8]>> ) -> Result<ChainSpec<G, E, EHF>, String>
Parse json content into a ChainSpec
pub fn from_json_file(path: PathBuf) -> Result<ChainSpec<G, E, EHF>, String>
pub fn from_json_file(path: PathBuf) -> Result<ChainSpec<G, E, EHF>, String>
Parse json file into a ChainSpec
Trait Implementations
§impl<G, E, EHF> BuildStorage for ChainSpec<G, E, EHF>where
G: RuntimeGenesis,
EHF: HostFunctions,
impl<G, E, EHF> BuildStorage for ChainSpec<G, E, EHF>where
G: RuntimeGenesis,
EHF: HostFunctions,
§fn assimilate_storage(&self, storage: &mut Storage) -> Result<(), String>
fn assimilate_storage(&self, storage: &mut Storage) -> Result<(), String>
Assimilate the storage for this module into pre-existing overlays.
§fn build_storage(&self) -> Result<Storage, String>
fn build_storage(&self) -> Result<Storage, String>
Build the storage out of this builder.
§impl<G, E, EHF> ChainSpec for ChainSpec<G, E, EHF>
impl<G, E, EHF> ChainSpec for ChainSpec<G, E, EHF>
§fn boot_nodes(&self) -> &[MultiaddrWithPeerId]
fn boot_nodes(&self) -> &[MultiaddrWithPeerId]
A list of bootnode addresses.
§fn chain_type(&self) -> ChainType
fn chain_type(&self) -> ChainType
Type of the chain.
§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) -> Map<String, Value>
fn properties(&self) -> Map<String, Value>
Additional loosly-typed properties of the chain. Read more
§fn add_boot_node(&mut self, addr: MultiaddrWithPeerId)
fn add_boot_node(&mut self, addr: MultiaddrWithPeerId)
Add a bootnode to the list.
§fn extensions(&self) -> &dyn GetExtension
fn extensions(&self) -> &dyn GetExtension
Returns a reference to the defined chain spec extensions.
§fn extensions_mut(&mut self) -> &mut dyn GetExtension
fn extensions_mut(&mut self) -> &mut dyn GetExtension
Returns a mutable reference to the defined chain spec extensions.
§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>
fn cloned_box(&self) -> Box<dyn ChainSpec>
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. Read more