mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
Use generated name if no name was provided (#377)
This commit is contained in:
committed by
Arkadiy Paronyan
parent
5a09802e57
commit
6b6820e173
@@ -40,3 +40,4 @@ polkadot-primitives = { path = "../primitives" }
|
||||
polkadot-runtime = { path = "../runtime" }
|
||||
polkadot-service = { path = "../service" }
|
||||
polkadot-transaction-pool = { path = "../transaction-pool" }
|
||||
names = "0.11.0"
|
||||
|
||||
@@ -32,6 +32,7 @@ extern crate triehash;
|
||||
extern crate parking_lot;
|
||||
extern crate serde;
|
||||
extern crate serde_json;
|
||||
extern crate names;
|
||||
|
||||
extern crate substrate_client as client;
|
||||
extern crate substrate_network as network;
|
||||
@@ -82,6 +83,7 @@ use polkadot_primitives::BlockId;
|
||||
use codec::{Decode, Encode};
|
||||
use client::BlockOrigin;
|
||||
use runtime_primitives::generic::SignedBlock;
|
||||
use names::{Generator, Name};
|
||||
|
||||
use futures::Future;
|
||||
use tokio::runtime::Runtime;
|
||||
@@ -199,10 +201,11 @@ pub fn run<I, T, W>(args: I, worker: W) -> error::Result<()> where
|
||||
let (spec, is_global) = load_spec(&matches)?;
|
||||
let mut config = service::Configuration::default_with_spec(spec);
|
||||
|
||||
if let Some(name) = matches.value_of("name") {
|
||||
config.name = name.into();
|
||||
info!("Node name: {}", config.name);
|
||||
}
|
||||
config.name = match matches.value_of("name") {
|
||||
None => Generator::with_naming(Name::Numbered).next().unwrap(),
|
||||
Some(name) => name.into(),
|
||||
};
|
||||
info!("Node name: {}", config.name);
|
||||
|
||||
let base_path = base_path(&matches);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user