mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 18:01:03 +00:00
node-key cli option (#149)
This commit is contained in:
committed by
Gav Wood
parent
7d54678331
commit
6280f84716
@@ -24,6 +24,11 @@ args:
|
|||||||
value_name: STRING
|
value_name: STRING
|
||||||
help: Specify additional key seed
|
help: Specify additional key seed
|
||||||
takes_value: true
|
takes_value: true
|
||||||
|
- node-key:
|
||||||
|
long: node-key
|
||||||
|
value_name: KEY
|
||||||
|
help: Specify node secret key (64-character hex string).
|
||||||
|
takes_value: true
|
||||||
- collator:
|
- collator:
|
||||||
long: collator
|
long: collator
|
||||||
help: Enable collator mode
|
help: Enable collator mode
|
||||||
|
|||||||
@@ -153,6 +153,11 @@ pub fn run<I, T>(args: I) -> error::Result<()> where
|
|||||||
config.network.listen_address = Some(SocketAddr::new("0.0.0.0".parse().unwrap(), port));
|
config.network.listen_address = Some(SocketAddr::new("0.0.0.0".parse().unwrap(), port));
|
||||||
config.network.public_address = None;
|
config.network.public_address = None;
|
||||||
config.network.client_version = format!("parity-polkadot/{}", crate_version!());
|
config.network.client_version = format!("parity-polkadot/{}", crate_version!());
|
||||||
|
config.network.use_secret = match matches.value_of("node-key").map(|s| s.parse()) {
|
||||||
|
Some(Ok(secret)) => Some(secret),
|
||||||
|
Some(Err(err)) => return Err(format!("Error parsing node key: {}", err).into()),
|
||||||
|
None => None,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
config.keys = matches.values_of("key").unwrap_or_default().map(str::to_owned).collect();
|
config.keys = matches.values_of("key").unwrap_or_default().map(str::to_owned).collect();
|
||||||
|
|||||||
Reference in New Issue
Block a user