Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit 1aee197

Browse files
authored
Make signer default as long as --unlock isn't used. (#1524)
1 parent ff7fcd0 commit 1aee197

File tree

3 files changed

+12
-22
lines changed

3 files changed

+12
-22
lines changed

parity/cli.rs

+10-13
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,21 @@ Protocol Options:
5252
Account Options:
5353
--unlock ACCOUNTS Unlock ACCOUNTS for the duration of the execution.
5454
ACCOUNTS is a comma-delimited list of addresses.
55+
Implies --no-signer.
5556
--password FILE Provide a file containing a password for unlocking
5657
an account.
5758
--keys-iterations NUM Specify the number of iterations to use when
5859
deriving key from the password (bigger is more
5960
secure) [default: 10240].
6061
--no-import-keys Do not import keys from legacy clients.
62+
--force-signer Enable Trusted Signer WebSocket endpoint used by
63+
Signer UIs, even when --unlock is in use.
64+
--no-signer Disable Trusted Signer WebSocket endpoint used by
65+
Signer UIs.
66+
--signer-port PORT Specify the port of Trusted Signer server
67+
[default: 8180].
68+
--signer-path PATH Specify directory where Signer UIs tokens should
69+
be stored. [default: $HOME/.parity/signer]
6170
6271
Networking Options:
6372
--no-network Disable p2p networking.
@@ -114,17 +123,6 @@ API and Console Options:
114123
--dapps-path PATH Specify directory where dapps should be installed.
115124
[default: $HOME/.parity/dapps]
116125
117-
--signer Enable Trusted Signer WebSocket endpoint used by
118-
Signer UIs. Default if run with ui command.
119-
--no-signer Disable Trusted Signer WebSocket endpoint used by
120-
Signer UIs. Default if no command is specified.
121-
--signer-port PORT Specify the port of Trusted Signer server
122-
[default: 8180].
123-
--signer-path PATH Specify directory where Signer UIs tokens should
124-
be stored. [default: $HOME/.parity/signer]
125-
--no-token By default a new system UI security token will be
126-
output on start up. This will prevent it.
127-
128126
Sealing/Mining Options:
129127
--author ADDRESS Specify the block author (aka "coinbase") address
130128
for sending block rewards from sealed blocks.
@@ -309,11 +307,10 @@ pub struct Args {
309307
pub flag_dapps_user: Option<String>,
310308
pub flag_dapps_pass: Option<String>,
311309
pub flag_dapps_path: String,
312-
pub flag_signer: bool,
310+
pub flag_force_signer: bool,
313311
pub flag_no_signer: bool,
314312
pub flag_signer_port: u16,
315313
pub flag_signer_path: String,
316-
pub flag_no_token: bool,
317314
pub flag_force_sealing: bool,
318315
pub flag_reseal_on_txs: String,
319316
pub flag_reseal_min_period: u64,

parity/configuration.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,8 @@ impl Configuration {
539539
}
540540

541541
pub fn signer_enabled(&self) -> bool {
542-
(self.args.cmd_ui && !self.args.flag_no_signer) ||
543-
(!self.args.cmd_ui && self.args.flag_signer)
542+
(self.args.flag_unlock.is_none() && !self.args.flag_no_signer) ||
543+
self.args.flag_force_signer
544544
}
545545
}
546546

parity/main.rs

-7
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,6 @@ fn execute_client(conf: Configuration, spec: Spec, client_config: ClientConfig)
193193
let net_settings = conf.net_settings(&spec);
194194
let sync_config = conf.sync_config(&spec);
195195

196-
// Create and display a new token for UIs.
197-
if conf.signer_enabled() && !conf.args.flag_no_token {
198-
new_token(conf.directories().signer).unwrap_or_else(|e| {
199-
die!("Error generating token: {:?}", e)
200-
});
201-
}
202-
203196
// Display warning about using unlock with signer
204197
if conf.signer_enabled() && conf.args.flag_unlock.is_some() {
205198
warn!("Using Trusted Signer and --unlock is not recommended!");

0 commit comments

Comments
 (0)