mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 08:51:09 +00:00
Default boot_nodes to local node in build-spec (#1181)
* Default to local bootnode with build-spec * Rexport libp2p stuff via network crate * Remove unused imports and fix where formatting * Remove spurious blank lines * Remove unnecessary else clause
This commit is contained in:
@@ -23,6 +23,7 @@ use primitives::storage::{StorageKey, StorageData};
|
||||
use runtime_primitives::{BuildStorage, StorageMap, ChildrenStorageMap};
|
||||
use serde_json as json;
|
||||
use components::RuntimeGenesis;
|
||||
use network::Multiaddr;
|
||||
|
||||
enum GenesisSource<G> {
|
||||
File(PathBuf),
|
||||
@@ -139,6 +140,10 @@ impl<G: RuntimeGenesis> ChainSpec<G> {
|
||||
self.spec.properties.as_ref().unwrap_or(&json::map::Map::new()).clone()
|
||||
}
|
||||
|
||||
pub fn add_boot_node(&mut self, addr: Multiaddr) {
|
||||
self.spec.boot_nodes.push(addr.to_string())
|
||||
}
|
||||
|
||||
/// Parse json content into a `ChainSpec`
|
||||
pub fn from_embedded(json: &'static [u8]) -> Result<Self, String> {
|
||||
let spec = json::from_slice(json).map_err(|e| format!("Error parsing spec file: {}", e))?;
|
||||
|
||||
Reference in New Issue
Block a user