Tweaked cli options (#1407)

This commit is contained in:
Arkadiy Paronyan 2016-06-23 18:57:42 +02:00 committed by Gav Wood
parent 27b18df3dd
commit 416781a8d4
3 changed files with 23 additions and 17 deletions

View File

@ -82,7 +82,7 @@ Networking Options:
--reserved-only Connect only to reserved nodes.
API and Console Options:
--jsonrpc-off Disable the JSON-RPC API server.
--no-jsonrpc Disable the JSON-RPC API server.
--jsonrpc-port PORT Specify the port portion of the JSONRPC API server
[default: 8545].
--jsonrpc-interface IP Specify the hostname portion of the JSONRPC API
@ -95,13 +95,13 @@ API and Console Options:
ethcore, ethcore_set, traces.
[default: web3,eth,net,ethcore,personal,traces].
--ipc-off Disable JSON-RPC over IPC service.
--no-ipc Disable JSON-RPC over IPC service.
--ipc-path PATH Specify custom path for JSON-RPC over IPC service
[default: $HOME/.parity/jsonrpc.ipc].
--ipc-apis APIS Specify custom API set available via JSON-RPC over
IPC [default: web3,eth,net,ethcore,personal,traces,rpc].
--dapps-off Disable the Dapps server (e.g. status page).
--no-dapps Disable the Dapps server (e.g. status page).
--dapps-port PORT Specify the port portion of the Dapps server
[default: 8080].
--dapps-interface IP Specify the hostname portion of the Dapps
@ -116,7 +116,7 @@ API and Console Options:
--dapps-path PATH Specify directory where dapps should be installed.
[default: $HOME/.parity/dapps]
--signer-off Disable Trusted Signer WebSocket endpoint used by
--signer Enable Trusted Signer WebSocket endpoint used by
Signer UIs.
--signer-port PORT Specify the port of Trusted Signer server
[default: 8180].
@ -160,7 +160,7 @@ Footprint Options:
light - early merges with partial tracking. Fast,
light, and experimental!
auto - use the method most recently synced or
default to archive if none synced [default: auto].
default to fast if none synced [default: auto].
--cache-pref-size BYTES Specify the prefered size of the blockchain cache in
bytes [default: 16384].
--cache-max-size BYTES Specify the maximum size of the blockchain cache in
@ -197,13 +197,16 @@ Legacy Options:
--nodekey KEY Equivalent to --node-key KEY.
--nodiscover Equivalent to --no-discovery.
-j --jsonrpc Does nothing; JSON-RPC is on by default now.
--jsonrpc-off Equivalent to --no-jsonrpc.
-w --webapp Does nothing; dapps server is on by default now.
--dapps-off Equivalent to --no-dapps.
--rpc Does nothing; JSON-RPC is on by default now.
--rpcaddr IP Equivalent to --jsonrpc-interface IP.
--rpcport PORT Equivalent to --jsonrpc-port PORT.
--rpcapi APIS Equivalent to --jsonrpc-apis APIS.
--rpccorsdomain URL Equivalent to --jsonrpc-cors URL.
--ipcdisable Equivalent to --ipc-off.
--ipcdisable Equivalent to --no-ipc.
--ipc-off Equivalent to --no-ipc.
--ipcapi APIS Equivalent to --ipc-apis APIS.
--ipcpath PATH Equivalent to --ipc-path PATH.
--gasprice WEI Minimum amount of Wei per GAS to be paid for a
@ -260,21 +263,21 @@ pub struct Args {
pub flag_cache_pref_size: usize,
pub flag_cache_max_size: usize,
pub flag_queue_max_size: usize,
pub flag_jsonrpc_off: bool,
pub flag_no_jsonrpc: bool,
pub flag_jsonrpc_interface: String,
pub flag_jsonrpc_port: u16,
pub flag_jsonrpc_cors: Option<String>,
pub flag_jsonrpc_apis: String,
pub flag_ipc_off: bool,
pub flag_no_ipc: bool,
pub flag_ipc_path: String,
pub flag_ipc_apis: String,
pub flag_dapps_off: bool,
pub flag_no_dapps: bool,
pub flag_dapps_port: u16,
pub flag_dapps_interface: String,
pub flag_dapps_user: Option<String>,
pub flag_dapps_pass: Option<String>,
pub flag_dapps_path: String,
pub flag_signer_off: bool,
pub flag_signer: bool,
pub flag_signer_port: u16,
pub flag_signer_path: String,
pub flag_no_token: bool,
@ -312,6 +315,9 @@ pub struct Args {
pub flag_testnet: bool,
pub flag_networkid: Option<String>,
pub flag_ipcdisable: bool,
pub flag_ipc_off: bool,
pub flag_jsonrpc_off: bool,
pub flag_dapps_off: bool,
pub flag_ipcpath: Option<String>,
pub flag_ipcapi: Option<String>,
pub flag_db_cache_size: Option<usize>,

View File

@ -265,7 +265,7 @@ impl Configuration {
"light" => journaldb::Algorithm::EarlyMerge,
"fast" => journaldb::Algorithm::OverlayRecent,
"basic" => journaldb::Algorithm::RefCounted,
"auto" => self.find_best_db(spec).unwrap_or(journaldb::Algorithm::Archive),
"auto" => self.find_best_db(spec).unwrap_or(journaldb::Algorithm::OverlayRecent),
_ => { die!("Invalid pruning method given."); }
};
@ -359,7 +359,7 @@ impl Configuration {
pub fn ipc_settings(&self) -> IpcConfiguration {
IpcConfiguration {
enabled: !(self.args.flag_ipcdisable || self.args.flag_ipc_off),
enabled: !(self.args.flag_ipcdisable || self.args.flag_ipc_off || self.args.flag_no_ipc),
socket_addr: self.ipc_path(),
apis: self.args.flag_ipcapi.clone().unwrap_or(self.args.flag_ipc_apis.clone()),
}
@ -372,7 +372,7 @@ impl Configuration {
chain: self.chain(),
max_peers: self.max_peers(),
network_port: self.net_port(),
rpc_enabled: !self.args.flag_jsonrpc_off,
rpc_enabled: !self.args.flag_jsonrpc_off && !self.args.flag_no_jsonrpc,
rpc_interface: self.args.flag_rpcaddr.clone().unwrap_or(self.args.flag_jsonrpc_interface.clone()),
rpc_port: self.args.flag_rpcport.unwrap_or(self.args.flag_jsonrpc_port),
}
@ -432,7 +432,7 @@ impl Configuration {
}
pub fn signer_port(&self) -> Option<u16> {
if self.args.flag_signer_off {
if !self.args.flag_signer {
None
} else {
Some(self.args.flag_signer_port)

View File

@ -192,14 +192,14 @@ fn execute_client(conf: Configuration, spec: Spec, client_config: ClientConfig)
let sync_config = conf.sync_config(&spec);
// Create and display a new token for UIs.
if !conf.args.flag_signer_off && !conf.args.flag_no_token {
if conf.args.flag_signer && !conf.args.flag_no_token {
new_token(conf.directories().signer).unwrap_or_else(|e| {
die!("Error generating token: {:?}", e)
});
}
// Display warning about using unlock with signer
if !conf.args.flag_signer_off && conf.args.flag_unlock.is_some() {
if conf.args.flag_signer && conf.args.flag_unlock.is_some() {
warn!("Using Trusted Signer and --unlock is not recommended!");
warn!("NOTE that Signer will not ask you to confirm transactions from unlocked account.");
}
@ -264,7 +264,7 @@ fn execute_client(conf: Configuration, spec: Spec, client_config: ClientConfig)
if conf.args.flag_webapp { println!("WARNING: Flag -w/--webapp is deprecated. Dapps server is now on by default. Ignoring."); }
let dapps_server = dapps::new(dapps::Configuration {
enabled: !conf.args.flag_dapps_off,
enabled: !conf.args.flag_dapps_off && !conf.args.flag_no_dapps,
interface: conf.args.flag_dapps_interface.clone(),
port: conf.args.flag_dapps_port,
user: conf.args.flag_dapps_user.clone(),