2016-04-21 15:41:25 +02:00
|
|
|
// Copyright 2015, 2016 Ethcore (UK) Ltd.
|
|
|
|
// This file is part of Parity.
|
|
|
|
|
|
|
|
// Parity is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
|
|
// Parity is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
use util::version;
|
|
|
|
|
|
|
|
pub const USAGE: &'static str = r#"
|
|
|
|
Parity. Ethereum Client.
|
|
|
|
By Wood/Paronyan/Kotewicz/Drwięga/Volf.
|
|
|
|
Copyright 2015, 2016 Ethcore (UK) Limited
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
parity daemon <pid-file> [options]
|
2016-06-08 15:17:37 +02:00
|
|
|
parity account (new | list ) [options]
|
|
|
|
parity account import <path>... [options]
|
2016-05-24 20:29:19 +02:00
|
|
|
parity import [ <file> ] [options]
|
2016-05-23 09:51:36 +02:00
|
|
|
parity export [ <file> ] [options]
|
2016-06-07 17:21:19 +02:00
|
|
|
parity signer new-token [options]
|
2016-04-21 15:41:25 +02:00
|
|
|
parity [options]
|
2016-06-14 16:12:46 +02:00
|
|
|
parity ui [options]
|
2016-04-21 15:41:25 +02:00
|
|
|
|
|
|
|
Protocol Options:
|
|
|
|
--chain CHAIN Specify the blockchain type. CHAIN may be either a
|
|
|
|
JSON chain specification file or olympic, frontier,
|
|
|
|
homestead, mainnet, morden, or testnet
|
|
|
|
[default: homestead].
|
|
|
|
-d --db-path PATH Specify the database & configuration directory path
|
|
|
|
[default: $HOME/.parity].
|
|
|
|
--keys-path PATH Specify the path for JSON key files to be found
|
|
|
|
[default: $HOME/.parity/keys].
|
|
|
|
--identity NAME Specify your node's name.
|
|
|
|
|
|
|
|
Account Options:
|
|
|
|
--unlock ACCOUNTS Unlock ACCOUNTS for the duration of the execution.
|
|
|
|
ACCOUNTS is a comma-delimited list of addresses.
|
|
|
|
--password FILE Provide a file containing a password for unlocking
|
|
|
|
an account.
|
2016-05-23 09:51:36 +02:00
|
|
|
--keys-iterations NUM Specify the number of iterations to use when
|
|
|
|
deriving key from the password (bigger is more
|
|
|
|
secure) [default: 10240].
|
2016-05-21 18:46:18 +02:00
|
|
|
--no-import-keys Do not import keys from legacy clients.
|
2016-04-21 15:41:25 +02:00
|
|
|
|
|
|
|
Networking Options:
|
2016-06-17 12:58:28 +02:00
|
|
|
--no-network Disable p2p networking.
|
2016-04-21 15:41:25 +02:00
|
|
|
--port PORT Override the port on which the node should listen
|
|
|
|
[default: 30303].
|
|
|
|
--peers NUM Try to maintain that many peers [default: 25].
|
|
|
|
--nat METHOD Specify method to use for determining public
|
|
|
|
address. Must be one of: any, none, upnp,
|
|
|
|
extip:<IP> [default: any].
|
|
|
|
--network-id INDEX Override the network identifier from the chain we
|
|
|
|
are on.
|
|
|
|
--bootnodes NODES Override the bootnodes from our chain. NODES should
|
|
|
|
be comma-delimited enodes.
|
|
|
|
--no-discovery Disable new peer discovery.
|
|
|
|
--node-key KEY Specify node secret key, either as 64-character hex
|
|
|
|
string or input to SHA3 operation.
|
2016-06-19 15:59:12 +02:00
|
|
|
--reserved-peers FILE Provide a file containing enodes, one per line.
|
|
|
|
These nodes will always have a reserved slot on top
|
|
|
|
of the normal maximum peers.
|
2016-04-21 15:41:25 +02:00
|
|
|
|
|
|
|
API and Console Options:
|
2016-05-04 19:26:47 +02:00
|
|
|
--jsonrpc-off Disable the JSON-RPC API server.
|
2016-04-21 15:41:25 +02:00
|
|
|
--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
|
|
|
|
server, IP should be an interface's IP address, or
|
|
|
|
all (all interfaces) or local [default: local].
|
|
|
|
--jsonrpc-cors URL Specify CORS header for JSON-RPC API responses.
|
|
|
|
--jsonrpc-apis APIS Specify the APIs available through the JSONRPC
|
|
|
|
interface. APIS is a comma-delimited list of API
|
2016-05-04 19:26:47 +02:00
|
|
|
name. Possible name are web3, eth, net, personal,
|
2016-06-07 22:52:48 +02:00
|
|
|
ethcore, ethcore_set, traces.
|
|
|
|
[default: web3,eth,net,ethcore,personal,traces].
|
2016-05-04 19:26:47 +02:00
|
|
|
|
|
|
|
--ipc-off 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
|
2016-06-07 22:52:48 +02:00
|
|
|
IPC [default: web3,eth,net,ethcore,personal,traces].
|
2016-05-04 19:26:47 +02:00
|
|
|
|
2016-05-26 18:21:15 +02:00
|
|
|
--dapps-off Disable the Dapps server (e.g. status page).
|
|
|
|
--dapps-port PORT Specify the port portion of the Dapps server
|
2016-04-21 15:41:25 +02:00
|
|
|
[default: 8080].
|
2016-05-26 18:21:15 +02:00
|
|
|
--dapps-interface IP Specify the hostname portion of the Dapps
|
2016-04-21 15:41:25 +02:00
|
|
|
server, IP should be an interface's IP address, or
|
|
|
|
all (all interfaces) or local [default: local].
|
2016-05-26 18:21:15 +02:00
|
|
|
--dapps-user USERNAME Specify username for Dapps server. It will be
|
2016-04-21 15:41:25 +02:00
|
|
|
used in HTTP Basic Authentication Scheme.
|
2016-05-26 18:21:15 +02:00
|
|
|
If --dapps-pass is not specified you will be
|
2016-04-21 15:41:25 +02:00
|
|
|
asked for password on startup.
|
2016-05-26 18:21:15 +02:00
|
|
|
--dapps-pass PASSWORD Specify password for Dapps server. Use only in
|
|
|
|
conjunction with --dapps-user.
|
2016-06-03 11:51:11 +02:00
|
|
|
--dapps-path PATH Specify directory where dapps should be installed.
|
|
|
|
[default: $HOME/.parity/dapps]
|
2016-04-21 15:41:25 +02:00
|
|
|
|
2016-05-28 19:30:31 +02:00
|
|
|
--signer Enable Trusted Signer WebSocket endpoint used by
|
2016-06-07 17:21:19 +02:00
|
|
|
Signer UIs.
|
2016-05-28 19:30:31 +02:00
|
|
|
--signer-port PORT Specify the port of Trusted Signer server
|
|
|
|
[default: 8180].
|
2016-06-07 17:21:19 +02:00
|
|
|
--signer-path PATH Specify directory where Signer UIs tokens should
|
|
|
|
be stored. [default: $HOME/.parity/signer]
|
2016-05-28 19:30:31 +02:00
|
|
|
|
2016-04-21 15:41:25 +02:00
|
|
|
Sealing/Mining Options:
|
|
|
|
--force-sealing Force the node to author new blocks as if it were
|
|
|
|
always sealing/mining.
|
|
|
|
--usd-per-tx USD Amount of USD to be paid for a basic transaction
|
|
|
|
[default: 0.005]. The minimum gas price is set
|
|
|
|
accordingly.
|
|
|
|
--usd-per-eth SOURCE USD value of a single ETH. SOURCE may be either an
|
2016-05-14 15:53:46 +02:00
|
|
|
amount in USD, a web service or 'auto' to use each
|
|
|
|
web service in turn and fallback on the last known
|
|
|
|
good value [default: auto].
|
2016-04-21 15:41:25 +02:00
|
|
|
--gas-floor-target GAS Amount of gas per block to target when sealing a new
|
2016-06-18 14:59:52 +02:00
|
|
|
block [default: 3141592].
|
2016-04-21 15:41:25 +02:00
|
|
|
--author ADDRESS Specify the block author (aka "coinbase") address
|
|
|
|
for sending block rewards from sealed blocks
|
|
|
|
[default: 0037a6b811ffeb6e072da21179d11b1406371c63].
|
|
|
|
--extra-data STRING Specify a custom extra-data for authored blocks, no
|
|
|
|
more than 32 characters.
|
|
|
|
--tx-limit LIMIT Limit of transactions kept in the queue (waiting to
|
|
|
|
be included in next block) [default: 1024].
|
|
|
|
|
|
|
|
Footprint Options:
|
2016-05-02 12:17:30 +02:00
|
|
|
--tracing BOOL Indicates if full transaction tracing should be
|
2016-05-21 14:49:21 +02:00
|
|
|
enabled. Works only if client had been fully synced
|
|
|
|
with tracing enabled. BOOL may be one of auto, on,
|
|
|
|
off. auto uses last used value of this option (off
|
|
|
|
if it does not exist) [default: auto].
|
2016-04-21 15:41:25 +02:00
|
|
|
--pruning METHOD Configure pruning of the state/storage trie. METHOD
|
2016-05-19 11:40:43 +02:00
|
|
|
may be one of auto, archive, fast, basic, light:
|
2016-04-21 15:41:25 +02:00
|
|
|
archive - keep all state trie data. No pruning.
|
|
|
|
fast - maintain journal overlay. Fast but 50MB used.
|
2016-05-19 11:40:43 +02:00
|
|
|
basic - reference count in disk DB. Slow, light, and
|
|
|
|
experimental!
|
|
|
|
light - early merges with partial tracking. Fast,
|
|
|
|
light, and experimental!
|
2016-04-21 15:41:25 +02:00
|
|
|
auto - use the method most recently synced or
|
|
|
|
default to archive 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
|
|
|
|
bytes [default: 262144].
|
|
|
|
--queue-max-size BYTES Specify the maximum size of memory to use for block
|
|
|
|
queue [default: 52428800].
|
|
|
|
--cache MEGABYTES Set total amount of discretionary memory to use for
|
|
|
|
the entire system, overrides other cache and queue
|
|
|
|
options.
|
|
|
|
|
2016-05-24 20:29:19 +02:00
|
|
|
Import/Export Options:
|
2016-05-23 09:51:36 +02:00
|
|
|
--from BLOCK Export from block BLOCK, which may be an index or
|
2016-05-24 20:29:19 +02:00
|
|
|
hash [default: 1].
|
|
|
|
--to BLOCK Export to (including) block BLOCK, which may be an
|
2016-05-23 09:51:36 +02:00
|
|
|
index, hash or 'latest' [default: latest].
|
2016-05-24 20:29:19 +02:00
|
|
|
--format FORMAT For import/export in given format. FORMAT must be
|
|
|
|
one of 'hex' and 'binary'.
|
2016-05-23 09:51:36 +02:00
|
|
|
|
2016-05-19 00:44:49 +02:00
|
|
|
Virtual Machine Options:
|
|
|
|
--jitvm Enable the JIT VM.
|
|
|
|
|
2016-05-04 19:26:47 +02:00
|
|
|
Legacy Options:
|
2016-06-19 14:51:51 +02:00
|
|
|
--geth Run in Geth-compatibility mode. Sets the IPC path
|
|
|
|
to be the same as Geth's. Overrides the --ipc-path
|
|
|
|
and --ipcpath options. Alters RPCs to reflect Geth
|
|
|
|
bugs.
|
2016-05-21 18:46:18 +02:00
|
|
|
--testnet Geth-compatible testnet mode. Equivalent to --chain
|
|
|
|
testnet --keys-path $HOME/parity/testnet-keys.
|
|
|
|
Overrides the --keys-path option.
|
2016-04-21 15:41:25 +02:00
|
|
|
--datadir PATH Equivalent to --db-path PATH.
|
|
|
|
--networkid INDEX Equivalent to --network-id INDEX.
|
|
|
|
--maxpeers COUNT Equivalent to --peers COUNT.
|
|
|
|
--nodekey KEY Equivalent to --node-key KEY.
|
|
|
|
--nodiscover Equivalent to --no-discovery.
|
2016-05-04 19:26:47 +02:00
|
|
|
-j --jsonrpc Does nothing; JSON-RPC is on by default now.
|
2016-05-26 18:21:15 +02:00
|
|
|
-w --webapp Does nothing; dapps server is on by default now.
|
2016-05-04 19:26:47 +02:00
|
|
|
--rpc Does nothing; JSON-RPC is on by default now.
|
2016-04-21 15:41:25 +02:00
|
|
|
--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.
|
2016-05-04 19:26:47 +02:00
|
|
|
--ipcdisable Equivalent to --ipc-off.
|
|
|
|
--ipcapi APIS Equivalent to --ipc-apis APIS.
|
|
|
|
--ipcpath PATH Equivalent to --ipc-path PATH.
|
2016-04-21 15:41:25 +02:00
|
|
|
--gasprice WEI Minimum amount of Wei per GAS to be paid for a
|
|
|
|
transaction to be accepted for mining. Overrides
|
|
|
|
--basic-tx-usd.
|
|
|
|
--etherbase ADDRESS Equivalent to --author ADDRESS.
|
|
|
|
--extradata STRING Equivalent to --extra-data STRING.
|
|
|
|
|
|
|
|
Miscellaneous Options:
|
|
|
|
-l --logging LOGGING Specify the logging level. Must conform to the same
|
|
|
|
format as RUST_LOG.
|
2016-05-25 09:57:31 +02:00
|
|
|
--no-color Don't use terminal color codes in output.
|
2016-04-21 15:41:25 +02:00
|
|
|
-v --version Show information about version.
|
|
|
|
-h --help Show this screen.
|
|
|
|
"#;
|
|
|
|
|
|
|
|
#[derive(Debug, RustcDecodable)]
|
|
|
|
pub struct Args {
|
|
|
|
pub cmd_daemon: bool,
|
|
|
|
pub cmd_account: bool,
|
|
|
|
pub cmd_new: bool,
|
|
|
|
pub cmd_list: bool,
|
2016-05-23 09:51:36 +02:00
|
|
|
pub cmd_export: bool,
|
2016-05-24 20:29:19 +02:00
|
|
|
pub cmd_import: bool,
|
2016-06-07 17:21:19 +02:00
|
|
|
pub cmd_signer: bool,
|
|
|
|
pub cmd_new_token: bool,
|
2016-06-14 16:12:46 +02:00
|
|
|
pub cmd_ui: bool,
|
2016-04-21 15:41:25 +02:00
|
|
|
pub arg_pid_file: String,
|
2016-05-23 09:51:36 +02:00
|
|
|
pub arg_file: Option<String>,
|
2016-06-08 15:17:37 +02:00
|
|
|
pub arg_path: Vec<String>,
|
2016-04-21 15:41:25 +02:00
|
|
|
pub flag_chain: String,
|
|
|
|
pub flag_db_path: String,
|
|
|
|
pub flag_identity: String,
|
|
|
|
pub flag_unlock: Option<String>,
|
|
|
|
pub flag_password: Vec<String>,
|
|
|
|
pub flag_cache: Option<usize>,
|
|
|
|
pub flag_keys_path: String,
|
2016-05-14 13:30:25 +02:00
|
|
|
pub flag_keys_iterations: u32,
|
2016-05-21 18:46:18 +02:00
|
|
|
pub flag_no_import_keys: bool,
|
2016-04-21 15:41:25 +02:00
|
|
|
pub flag_bootnodes: Option<String>,
|
|
|
|
pub flag_network_id: Option<String>,
|
|
|
|
pub flag_pruning: String,
|
2016-05-02 12:17:30 +02:00
|
|
|
pub flag_tracing: String,
|
2016-04-21 15:41:25 +02:00
|
|
|
pub flag_port: u16,
|
|
|
|
pub flag_peers: usize,
|
|
|
|
pub flag_no_discovery: bool,
|
|
|
|
pub flag_nat: String,
|
|
|
|
pub flag_node_key: Option<String>,
|
2016-06-19 15:59:12 +02:00
|
|
|
pub flag_reserved_peers: Option<String>,
|
2016-04-21 15:41:25 +02:00
|
|
|
pub flag_cache_pref_size: usize,
|
|
|
|
pub flag_cache_max_size: usize,
|
|
|
|
pub flag_queue_max_size: usize,
|
2016-05-04 19:26:47 +02:00
|
|
|
pub flag_jsonrpc_off: bool,
|
2016-04-21 15:41:25 +02:00
|
|
|
pub flag_jsonrpc_interface: String,
|
|
|
|
pub flag_jsonrpc_port: u16,
|
|
|
|
pub flag_jsonrpc_cors: Option<String>,
|
|
|
|
pub flag_jsonrpc_apis: String,
|
2016-05-04 19:26:47 +02:00
|
|
|
pub flag_ipc_off: bool,
|
|
|
|
pub flag_ipc_path: String,
|
|
|
|
pub flag_ipc_apis: String,
|
2016-05-26 18:21:15 +02:00
|
|
|
pub flag_dapps_off: bool,
|
|
|
|
pub flag_dapps_port: u16,
|
|
|
|
pub flag_dapps_interface: String,
|
|
|
|
pub flag_dapps_user: Option<String>,
|
|
|
|
pub flag_dapps_pass: Option<String>,
|
2016-06-03 11:51:11 +02:00
|
|
|
pub flag_dapps_path: String,
|
2016-05-28 19:30:31 +02:00
|
|
|
pub flag_signer: bool,
|
|
|
|
pub flag_signer_port: u16,
|
2016-06-07 17:21:19 +02:00
|
|
|
pub flag_signer_path: String,
|
2016-04-21 15:41:25 +02:00
|
|
|
pub flag_force_sealing: bool,
|
|
|
|
pub flag_author: String,
|
|
|
|
pub flag_usd_per_tx: String,
|
|
|
|
pub flag_usd_per_eth: String,
|
|
|
|
pub flag_gas_floor_target: String,
|
|
|
|
pub flag_extra_data: Option<String>,
|
|
|
|
pub flag_tx_limit: usize,
|
|
|
|
pub flag_logging: Option<String>,
|
|
|
|
pub flag_version: bool,
|
2016-05-23 09:51:36 +02:00
|
|
|
pub flag_from: String,
|
|
|
|
pub flag_to: String,
|
2016-05-24 20:29:19 +02:00
|
|
|
pub flag_format: Option<String>,
|
2016-05-19 00:44:49 +02:00
|
|
|
pub flag_jitvm: bool,
|
2016-05-25 09:57:31 +02:00
|
|
|
pub flag_no_color: bool,
|
2016-06-17 12:58:28 +02:00
|
|
|
pub flag_no_network: bool,
|
2016-05-04 19:26:47 +02:00
|
|
|
// legacy...
|
2016-05-08 14:34:01 +02:00
|
|
|
pub flag_geth: bool,
|
2016-04-21 15:41:25 +02:00
|
|
|
pub flag_nodekey: Option<String>,
|
|
|
|
pub flag_nodiscover: bool,
|
|
|
|
pub flag_maxpeers: Option<usize>,
|
|
|
|
pub flag_datadir: Option<String>,
|
|
|
|
pub flag_extradata: Option<String>,
|
|
|
|
pub flag_etherbase: Option<String>,
|
|
|
|
pub flag_gasprice: Option<String>,
|
2016-05-04 19:26:47 +02:00
|
|
|
pub flag_jsonrpc: bool,
|
|
|
|
pub flag_webapp: bool,
|
2016-04-21 15:41:25 +02:00
|
|
|
pub flag_rpc: bool,
|
|
|
|
pub flag_rpcaddr: Option<String>,
|
|
|
|
pub flag_rpcport: Option<u16>,
|
|
|
|
pub flag_rpccorsdomain: Option<String>,
|
|
|
|
pub flag_rpcapi: Option<String>,
|
|
|
|
pub flag_testnet: bool,
|
|
|
|
pub flag_networkid: Option<String>,
|
2016-05-04 19:26:47 +02:00
|
|
|
pub flag_ipcdisable: bool,
|
|
|
|
pub flag_ipcpath: Option<String>,
|
|
|
|
pub flag_ipcapi: Option<String>,
|
2016-04-21 15:41:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn print_version() {
|
|
|
|
println!("\
|
|
|
|
Parity
|
|
|
|
version {}
|
|
|
|
Copyright 2015, 2016 Ethcore (UK) Limited
|
|
|
|
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
|
|
|
|
This is free software: you are free to change and redistribute it.
|
|
|
|
There is NO WARRANTY, to the extent permitted by law.
|
|
|
|
|
|
|
|
By Wood/Paronyan/Kotewicz/Drwięga/Volf.\
|
|
|
|
", version());
|
|
|
|
}
|
|
|
|
|