2019-01-07 11:33:07 +01:00
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.
2016-09-10 11:37:14 +02:00
2019-01-07 11:33:07 +01:00
// Parity Ethereum is free software: you can redistribute it and/or modify
2016-09-10 11:37:14 +02:00
// 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.
2019-01-07 11:33:07 +01:00
// Parity Ethereum is distributed in the hope that it will be useful,
2016-09-10 11:37:14 +02:00
// 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
2019-01-07 11:33:07 +01:00
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
2016-09-10 11:37:14 +02:00
#[ macro_use ]
mod usage ;
2017-07-12 11:03:21 +02:00
mod presets ;
2016-09-10 11:37:14 +02:00
2019-01-28 11:26:11 +01:00
use std ::collections ::HashSet ;
use super ::helpers ;
2016-09-10 11:37:14 +02:00
usage! {
{
2017-09-05 13:30:22 +02:00
// CLI subcommands
// Subcommands must start with cmd_ and have '_' in place of '-'
// Sub-subcommands must start with the name of the subcommand
// Arguments must start with arg_
2017-11-08 12:33:56 +01:00
// Flags must start with flag_
2017-09-05 13:30:22 +02:00
CMD cmd_daemon
{
" Use Parity as a daemon " ,
ARG arg_daemon_pid_file : ( Option < String > ) = None ,
" <PID-FILE> " ,
" Path to the pid file " ,
}
CMD cmd_account
{
" Manage accounts " ,
CMD cmd_account_new {
2018-07-10 12:17:11 +02:00
" Create a new account (and its associated key) for the given --chain (default: mainnet) " ,
2017-09-05 13:30:22 +02:00
}
CMD cmd_account_list {
2018-07-10 12:17:11 +02:00
" List existing accounts of the given --chain (default: mainnet) " ,
2017-09-05 13:30:22 +02:00
}
CMD cmd_account_import
{
2018-07-10 12:17:11 +02:00
" Import accounts from JSON UTC keystore files to the specified --chain (default mainnet) " ,
2017-09-05 13:30:22 +02:00
ARG arg_account_import_path : ( Option < Vec < String > > ) = None ,
" <PATH>... " ,
" Path to the accounts " ,
}
}
CMD cmd_wallet
{
" Manage wallet " ,
CMD cmd_wallet_import
{
2018-07-10 12:17:11 +02:00
" Import wallet into the given --chain (default: mainnet) " ,
2017-09-05 13:30:22 +02:00
ARG arg_wallet_import_path : ( Option < String > ) = None ,
" <PATH> " ,
" Path to the wallet " ,
}
}
CMD cmd_import
{
2018-07-10 12:17:11 +02:00
" Import blockchain data from a file to the given --chain database (default: mainnet) " ,
2017-09-05 13:30:22 +02:00
ARG arg_import_format : ( Option < String > ) = None ,
" --format=[FORMAT] " ,
" Import in a given format. FORMAT must be either 'hex' or 'binary'. (default: auto) " ,
ARG arg_import_file : ( Option < String > ) = None ,
" [FILE] " ,
" Path to the file to import from " ,
}
CMD cmd_export
{
" Export blockchain " ,
CMD cmd_export_blocks
{
2018-07-10 12:17:11 +02:00
" Export the blockchain blocks from the given --chain database (default: mainnet) into a file. This command requires the chain to be synced with --fat-db on. " ,
2017-09-05 13:30:22 +02:00
ARG arg_export_blocks_format : ( Option < String > ) = None ,
" --format=[FORMAT] " ,
" Export in a given format. FORMAT must be either 'hex' or 'binary'. (default: binary) " ,
ARG arg_export_blocks_from : ( String ) = " 1 " ,
" --from=[BLOCK] " ,
" Export from block BLOCK, which may be an index or hash. " ,
ARG arg_export_blocks_to : ( String ) = " latest " ,
" --to=[BLOCK] " ,
" Export to (including) block BLOCK, which may be an index, hash or latest. " ,
ARG arg_export_blocks_file : ( Option < String > ) = None ,
" [FILE] " ,
" Path to the exported file " ,
}
CMD cmd_export_state
{
2018-07-10 12:17:11 +02:00
" Export the blockchain state from the given --chain (default: mainnet) into a file. This command requires the chain to be synced with --fat-db on. " ,
2017-09-05 13:30:22 +02:00
FLAG flag_export_state_no_storage : ( bool ) = false ,
" --no-storage " ,
" Don't export account storage. " ,
FLAG flag_export_state_no_code : ( bool ) = false ,
" --no-code " ,
" Don't export account code. " ,
ARG arg_export_state_min_balance : ( Option < String > ) = None ,
" --min-balance=[WEI] " ,
" Don't export accounts with balance less than specified. " ,
ARG arg_export_state_max_balance : ( Option < String > ) = None ,
" --max-balance=[WEI] " ,
" Don't export accounts with balance greater than specified. " ,
ARG arg_export_state_at : ( String ) = " latest " ,
" --at=[BLOCK] " ,
" Take a snapshot at the given block, which may be an index, hash, or latest. Note that taking snapshots at non-recent blocks will only work with --pruning archive " ,
ARG arg_export_state_format : ( Option < String > ) = None ,
" --format=[FORMAT] " ,
" Export in a given format. FORMAT must be either 'hex' or 'binary'. (default: binary) " ,
ARG arg_export_state_file : ( Option < String > ) = None ,
" [FILE] " ,
" Path to the exported file " ,
}
}
CMD cmd_signer
{
" Manage signer " ,
CMD cmd_signer_new_token {
2018-07-10 12:17:11 +02:00
" Generate a new signer-authentication token for the given --chain (default: mainnet) " ,
2017-09-05 13:30:22 +02:00
}
CMD cmd_signer_list {
2018-07-10 12:17:11 +02:00
" List the signer-authentication tokens from given --chain (default: mainnet) " ,
2017-09-05 13:30:22 +02:00
}
CMD cmd_signer_sign
{
" Sign " ,
ARG arg_signer_sign_id : ( Option < usize > ) = None ,
" [ID] " ,
" ID " ,
}
CMD cmd_signer_reject
{
" Reject " ,
ARG arg_signer_reject_id : ( Option < usize > ) = None ,
" <ID> " ,
" ID " ,
}
}
CMD cmd_snapshot
{
2018-07-10 12:17:11 +02:00
" Make a snapshot of the database of the given --chain (default: mainnet) " ,
2017-09-05 13:30:22 +02:00
ARG arg_snapshot_at : ( String ) = " latest " ,
" --at=[BLOCK] " ,
" Take a snapshot at the given block, which may be an index, hash, or latest. Note that taking snapshots at non-recent blocks will only work with --pruning archive " ,
ARG arg_snapshot_file : ( Option < String > ) = None ,
" <FILE> " ,
" Path to the file to export to " ,
}
CMD cmd_restore
{
2018-07-10 12:17:11 +02:00
" Restore the database of the given --chain (default: mainnet) from a snapshot file " ,
2017-09-05 13:30:22 +02:00
ARG arg_restore_file : ( Option < String > ) = None ,
" [FILE] " ,
" Path to the file to restore from " ,
}
CMD cmd_tools
{
" Tools " ,
CMD cmd_tools_hash
{
2018-07-10 12:17:11 +02:00
" Hash a file using the Keccak-256 algorithm " ,
2017-09-05 13:30:22 +02:00
ARG arg_tools_hash_file : ( Option < String > ) = None ,
" <FILE> " ,
" File " ,
}
}
CMD cmd_db
{
" Manage the database representing the state of the blockchain on this system " ,
CMD cmd_db_kill {
2018-07-10 12:17:11 +02:00
" Clean the database of the given --chain (default: mainnet) " ,
2017-09-05 13:30:22 +02:00
}
2019-01-16 16:37:26 +01:00
CMD cmd_db_reset {
" Removes NUM latests blocks from the db " ,
ARG arg_db_reset_num : ( u32 ) = 10 u32 ,
" <NUM> " ,
" Number of blocks to revert " ,
}
2017-09-05 13:30:22 +02:00
}
2018-03-27 13:56:59 +02:00
CMD cmd_export_hardcoded_sync
{
2018-07-10 12:17:11 +02:00
" Print the hashed light clients headers of the given --chain (default: mainnet) in a JSON format. To be used as hardcoded headers in a genesis file. " ,
2018-03-27 13:56:59 +02:00
}
2018-07-11 12:19:54 +02:00
// CMD removed in 2.0
CMD cmd_dapp
{
" Manage dapps " ,
ARG arg_dapp_path : ( Option < String > ) = None ,
" <PATH> " ,
" Path to the dapps " ,
}
2016-09-10 11:37:14 +02:00
}
2017-01-18 18:45:30 +01:00
{
2017-11-08 12:33:56 +01:00
// Global flags and arguments
2017-09-05 13:30:22 +02:00
[ " Operating Options " ]
2018-02-16 16:37:12 +01:00
FLAG flag_no_download : ( bool ) = false , or | c : & Config | c . parity . as_ref ( ) ? . no_download . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --no-download " ,
" Normally new releases will be downloaded ready for updating. This disables it. Not recommended. " ,
2018-02-16 16:37:12 +01:00
FLAG flag_no_consensus : ( bool ) = false , or | c : & Config | c . parity . as_ref ( ) ? . no_consensus . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --no-consensus " ,
" Force the binary to run even if there are known issues regarding consensus. Not recommended. " ,
2018-02-16 16:37:12 +01:00
FLAG flag_light : ( bool ) = false , or | c : & Config | c . parity . as_ref ( ) ? . light ,
2017-09-05 13:30:22 +02:00
" --light " ,
" Experimental: run in light client mode. Light clients synchronize a bare minimum of data and fetch necessary data on-demand from the network. Much lower in storage, potentially higher in bandwidth. Has no effect with subcommands. " ,
2018-03-27 13:56:59 +02:00
FLAG flag_no_hardcoded_sync : ( bool ) = false , or | c : & Config | c . parity . as_ref ( ) ? . no_hardcoded_sync ,
" --no-hardcoded-sync " ,
" By default, if there is no existing database the light client will automatically jump to a block hardcoded in the chain's specifications. This disables this feature. " ,
2017-09-05 13:30:22 +02:00
FLAG flag_force_direct : ( bool ) = false , or | _ | None ,
" --force-direct " ,
" Run the originally installed version of Parity, ignoring any updates that have since been installed. " ,
2018-02-16 16:37:12 +01:00
ARG arg_mode : ( String ) = " last " , or | c : & Config | c . parity . as_ref ( ) ? . mode . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --mode=[MODE] " ,
2018-07-03 11:34:46 +02:00
" Set the operating mode. MODE can be one of: last - Uses the last-used mode, active if none; active - Parity continuously syncs the chain; passive - Parity syncs initially, then sleeps and wakes regularly to resync; dark - Parity syncs only when the JSON-RPC is active; offline - Parity doesn't sync. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_mode_timeout : ( u64 ) = 300 u64 , or | c : & Config | c . parity . as_ref ( ) ? . mode_timeout . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --mode-timeout=[SECS] " ,
" Specify the number of seconds before inactivity timeout occurs when mode is dark or passive " ,
2018-02-16 16:37:12 +01:00
ARG arg_mode_alarm : ( u64 ) = 3600 u64 , or | c : & Config | c . parity . as_ref ( ) ? . mode_alarm . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --mode-alarm=[SECS] " ,
" Specify the number of seconds before auto sleep reawake timeout occurs when mode is passive " ,
2018-02-16 16:37:12 +01:00
ARG arg_auto_update : ( String ) = " critical " , or | c : & Config | c . parity . as_ref ( ) ? . auto_update . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --auto-update=[SET] " ,
2018-01-31 09:50:52 +01:00
" Set a releases set to automatically update and install. SET can be one of: all - All updates in the our release track; critical - Only consensus/security updates; none - No updates will be auto-installed. " ,
2017-09-05 13:30:22 +02:00
2018-04-03 16:49:23 +02:00
ARG arg_auto_update_delay : ( u16 ) = 100 u16 , or | c : & Config | c . parity . as_ref ( ) ? . auto_update_delay . clone ( ) ,
" --auto-update-delay=[NUM] " ,
" Specify the maximum number of blocks used for randomly delaying updates. " ,
ARG arg_auto_update_check_frequency : ( u16 ) = 20 u16 , or | c : & Config | c . parity . as_ref ( ) ? . auto_update_check_frequency . clone ( ) ,
" --auto-update-check-frequency=[NUM] " ,
" Specify the number of blocks between each auto-update check. " ,
2018-02-16 16:37:12 +01:00
ARG arg_release_track : ( String ) = " current " , or | c : & Config | c . parity . as_ref ( ) ? . release_track . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --release-track=[TRACK] " ,
2018-01-31 09:50:52 +01:00
" Set which release track we should use for updates. TRACK can be one of: stable - Stable releases; beta - Beta releases; nightly - Nightly releases (unstable); testing - Testing releases (do not use); current - Whatever track this executable was released on. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_chain : ( String ) = " foundation " , or | c : & Config | c . parity . as_ref ( ) ? . chain . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --chain=[CHAIN] " ,
2019-03-27 15:07:38 +01:00
" Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, classic, poacore, tobalaba, expanse, musicoin, ellaism, mix, callisto, morden, ropsten, kovan, rinkeby, goerli, kotti, poasokol, testnet, or dev. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_keys_path : ( String ) = " $BASE/keys " , or | c : & Config | c . parity . as_ref ( ) ? . keys_path . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --keys-path=[PATH] " ,
" Specify the path for JSON key files to be found " ,
2018-02-16 16:37:12 +01:00
ARG arg_identity : ( String ) = " " , or | c : & Config | c . parity . as_ref ( ) ? . identity . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --identity=[NAME] " ,
" Specify your node's name. " ,
2018-02-16 16:37:12 +01:00
ARG arg_base_path : ( Option < String > ) = None , or | c : & Config | c . parity . as_ref ( ) ? . base_path . clone ( ) ,
2017-09-05 13:30:22 +02:00
" -d, --base-path=[PATH] " ,
" Specify the base data storage path. " ,
2018-02-16 16:37:12 +01:00
ARG arg_db_path : ( Option < String > ) = None , or | c : & Config | c . parity . as_ref ( ) ? . db_path . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --db-path=[PATH] " ,
" Specify the database directory path " ,
2018-06-25 10:19:29 +02:00
[ " Convenience Options " ]
2018-02-16 16:37:12 +01:00
FLAG flag_unsafe_expose : ( bool ) = false , or | c : & Config | c . misc . as_ref ( ) ? . unsafe_expose ,
2017-09-05 13:30:22 +02:00
" --unsafe-expose " ,
2019-01-12 13:12:03 +01:00
" All servers will listen on external interfaces and will be remotely accessible. It's equivalent with setting the following: --[ws,jsonrpc,ipfs-api,secretstore,stratum,dapps,secretstore-http]-interface=all --*-hosts=all This option is UNSAFE and should be used with great care! " ,
2017-09-05 13:30:22 +02:00
ARG arg_config : ( String ) = " $BASE/config.toml " , or | _ | None ,
" -c, --config=[CONFIG] " ,
" Specify a configuration. CONFIG may be either a configuration file or a preset: dev, insecure, dev-insecure, mining, or non-standard-ports. " ,
2018-02-16 16:37:12 +01:00
ARG arg_ports_shift : ( u16 ) = 0 u16 , or | c : & Config | c . misc . as_ref ( ) ? . ports_shift ,
2017-09-05 13:30:22 +02:00
" --ports-shift=[SHIFT] " ,
2018-07-03 11:34:46 +02:00
" Add SHIFT to all port numbers Parity is listening on. Includes network port and all servers (HTTP JSON-RPC, WebSockets JSON-RPC, IPFS, SecretStore). " ,
2017-09-05 13:30:22 +02:00
2018-06-25 10:19:29 +02:00
[ " Account Options " ]
2018-02-16 16:37:12 +01:00
FLAG flag_fast_unlock : ( bool ) = false , or | c : & Config | c . account . as_ref ( ) ? . fast_unlock . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --fast-unlock " ,
2018-06-25 10:19:29 +02:00
" Use drastically faster unlocking mode. This setting causes raw secrets to be stored unprotected in memory, so use with care. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_keys_iterations : ( u32 ) = 10240 u32 , or | c : & Config | c . account . as_ref ( ) ? . keys_iterations . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --keys-iterations=[NUM] " ,
" Specify the number of iterations to use when deriving key from the password (bigger is more secure) " ,
2018-02-16 16:37:12 +01:00
ARG arg_accounts_refresh : ( u64 ) = 5 u64 , or | c : & Config | c . account . as_ref ( ) ? . refresh_time . clone ( ) ,
2017-12-22 04:33:49 +01:00
" --accounts-refresh=[TIME] " ,
" Specify the cache time of accounts read from disk. If you manage thousands of accounts set this to 0 to disable refresh. " ,
2018-02-16 16:37:12 +01:00
ARG arg_unlock : ( Option < String > ) = None , or | c : & Config | c . account . as_ref ( ) ? . unlock . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --unlock=[ACCOUNTS] " ,
2018-09-27 12:24:34 +02:00
" Unlock ACCOUNTS for the duration of the execution. ACCOUNTS is a comma-delimited list of addresses. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_password : ( Vec < String > ) = Vec ::new ( ) , or | c : & Config | c . account . as_ref ( ) ? . password . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --password=[FILE]... " ,
" Provide a file containing a password for unlocking an account. Leading and trailing whitespace is trimmed. " ,
2018-01-09 12:43:36 +01:00
2018-06-25 10:19:29 +02:00
[ " Private Transactions Options " ]
2018-04-09 16:14:33 +02:00
FLAG flag_private_enabled : ( bool ) = false , or | c : & Config | c . private_tx . as_ref ( ) ? . enabled ,
" --private-tx-enabled " ,
" Enable private transactions. " ,
ARG arg_private_signer : ( Option < String > ) = None , or | c : & Config | c . private_tx . as_ref ( ) ? . signer . clone ( ) ,
" --private-signer=[ACCOUNT] " ,
" Specify the account for signing public transaction created upon verified private transaction. " ,
ARG arg_private_validators : ( Option < String > ) = None , or | c : & Config | c . private_tx . as_ref ( ) ? . validators . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
" --private-validators=[ACCOUNTS] " ,
" Specify the accounts for validating private transactions. ACCOUNTS is a comma-delimited list of addresses. " ,
ARG arg_private_account : ( Option < String > ) = None , or | c : & Config | c . private_tx . as_ref ( ) ? . account . clone ( ) ,
" --private-account=[ACCOUNT] " ,
" Specify the account for signing requests to secret store. " ,
ARG arg_private_sstore_url : ( Option < String > ) = None , or | c : & Config | c . private_tx . as_ref ( ) ? . sstore_url . clone ( ) ,
" --private-sstore-url=[URL] " ,
" Specify secret store URL used for encrypting private transactions. " ,
ARG arg_private_sstore_threshold : ( Option < u32 > ) = None , or | c : & Config | c . private_tx . as_ref ( ) ? . sstore_threshold . clone ( ) ,
" --private-sstore-threshold=[NUM] " ,
" Specify secret store threshold used for encrypting private transactions. " ,
ARG arg_private_passwords : ( Option < String > ) = None , or | c : & Config | c . private_tx . as_ref ( ) ? . passwords . clone ( ) ,
" --private-passwords=[FILE]... " ,
" Provide a file containing passwords for unlocking accounts (signer, private account, validators). " ,
2018-06-25 10:19:29 +02:00
[ " UI Options " ]
2018-02-16 16:37:12 +01:00
ARG arg_ui_path : ( String ) = " $BASE/signer " , or | c : & Config | c . ui . as_ref ( ) ? . path . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --ui-path=[PATH] " ,
" Specify directory where Trusted UIs tokens should be stored. " ,
2018-06-25 10:19:29 +02:00
[ " Networking Options " ]
2018-02-16 16:37:12 +01:00
FLAG flag_no_warp : ( bool ) = false , or | c : & Config | c . network . as_ref ( ) ? . warp . clone ( ) . map ( | w | ! w ) ,
2017-09-05 13:30:22 +02:00
" --no-warp " ,
" Disable syncing from the snapshot over the network. " ,
2018-02-16 16:37:12 +01:00
FLAG flag_no_discovery : ( bool ) = false , or | c : & Config | c . network . as_ref ( ) ? . discovery . map ( | d | ! d ) . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --no-discovery " ,
" Disable new peer discovery. " ,
2018-02-16 16:37:12 +01:00
FLAG flag_reserved_only : ( bool ) = false , or | c : & Config | c . network . as_ref ( ) ? . reserved_only . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --reserved-only " ,
" Connect only to reserved nodes. " ,
FLAG flag_no_ancient_blocks : ( bool ) = false , or | _ | None ,
" --no-ancient-blocks " ,
2018-05-22 04:19:00 +02:00
" Disable downloading old blocks after snapshot restoration or warp sync. Not recommended. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
FLAG flag_no_serve_light : ( bool ) = false , or | c : & Config | c . network . as_ref ( ) ? . no_serve_light . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --no-serve-light " ,
" Disable serving of light peers. " ,
2018-03-29 11:20:27 +02:00
ARG arg_warp_barrier : ( Option < u64 > ) = None , or | c : & Config | c . network . as_ref ( ) ? . warp_barrier . clone ( ) ,
" --warp-barrier=[NUM] " ,
" When warp enabled never attempt regular sync before warping to block NUM. " ,
2018-02-16 16:37:12 +01:00
ARG arg_port : ( u16 ) = 30303 u16 , or | c : & Config | c . network . as_ref ( ) ? . port . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --port=[PORT] " ,
" Override the port on which the node should listen. " ,
2018-09-12 11:47:01 +02:00
ARG arg_interface : ( String ) = " all " , or | c : & Config | c . network . as_ref ( ) ? . interface . clone ( ) ,
2018-05-31 13:36:47 +02:00
" --interface=[IP] " ,
" Network interfaces. Valid values are 'all', 'local' or the ip of the interface you want parity to listen to. " ,
2018-04-03 16:51:57 +02:00
ARG arg_min_peers : ( Option < u16 > ) = None , or | c : & Config | c . network . as_ref ( ) ? . min_peers . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --min-peers=[NUM] " ,
" Try to maintain at least NUM peers. " ,
2018-04-03 16:51:57 +02:00
ARG arg_max_peers : ( Option < u16 > ) = None , or | c : & Config | c . network . as_ref ( ) ? . max_peers . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --max-peers=[NUM] " ,
" Allow up to NUM peers. " ,
2018-02-16 16:37:12 +01:00
ARG arg_snapshot_peers : ( u16 ) = 0 u16 , or | c : & Config | c . network . as_ref ( ) ? . snapshot_peers . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --snapshot-peers=[NUM] " ,
" Allow additional NUM peers for a snapshot sync. " ,
2018-02-16 16:37:12 +01:00
ARG arg_nat : ( String ) = " any " , or | c : & Config | c . network . as_ref ( ) ? . nat . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --nat=[METHOD] " ,
" Specify method to use for determining public address. Must be one of: any, none, upnp, extip:<IP>. " ,
2018-02-16 16:37:12 +01:00
ARG arg_allow_ips : ( String ) = " all " , or | c : & Config | c . network . as_ref ( ) ? . allow_ips . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --allow-ips=[FILTER] " ,
" Filter outbound connections. Must be one of: private - connect to private network IP addresses only; public - connect to public network IP addresses only; all - connect to any IP address. " ,
2018-02-16 16:37:12 +01:00
ARG arg_max_pending_peers : ( u16 ) = 64 u16 , or | c : & Config | c . network . as_ref ( ) ? . max_pending_peers . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --max-pending-peers=[NUM] " ,
" Allow up to NUM pending connections. " ,
2018-02-16 16:37:12 +01:00
ARG arg_network_id : ( Option < u64 > ) = None , or | c : & Config | c . network . as_ref ( ) ? . id . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --network-id=[INDEX] " ,
" Override the network identifier from the chain we are on. " ,
2018-02-16 16:37:12 +01:00
ARG arg_bootnodes : ( Option < String > ) = None , or | c : & Config | c . network . as_ref ( ) ? . bootnodes . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --bootnodes=[NODES] " ,
" Override the bootnodes from our chain. NODES should be comma-delimited enodes. " ,
2018-02-16 16:37:12 +01:00
ARG arg_node_key : ( Option < String > ) = None , or | c : & Config | c . network . as_ref ( ) ? . node_key . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --node-key=[KEY] " ,
" Specify node secret key, either as 64-character hex string or input to SHA3 operation. " ,
2018-02-16 16:37:12 +01:00
ARG arg_reserved_peers : ( Option < String > ) = None , or | c : & Config | c . network . as_ref ( ) ? . reserved_peers . clone ( ) ,
2017-09-05 13:30:22 +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. " ,
2018-07-09 21:36:04 +02:00
CHECK | args : & Args | {
if let ( Some ( max_peers ) , Some ( min_peers ) ) = ( args . arg_max_peers , args . arg_min_peers ) {
if min_peers > max_peers {
return Err ( ArgsError ::PeerConfiguration ) ;
}
}
Ok ( ( ) )
} ,
2018-07-03 11:34:46 +02:00
[ " API and Console Options – HTTP JSON-RPC " ]
2018-11-26 19:58:27 +01:00
FLAG flag_jsonrpc_allow_missing_blocks : ( bool ) = false , or | c : & Config | c . rpc . as_ref ( ) ? . allow_missing_blocks . clone ( ) ,
" --jsonrpc-allow-missing-blocks " ,
" RPC calls will return 'null' instead of an error if ancient block sync is still in progress and the block information requested could not be found " ,
2018-02-16 16:37:12 +01:00
FLAG flag_no_jsonrpc : ( bool ) = false , or | c : & Config | c . rpc . as_ref ( ) ? . disable . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --no-jsonrpc " ,
2018-07-03 11:34:46 +02:00
" Disable the HTTP JSON-RPC API server. " ,
2017-09-05 13:30:22 +02:00
2018-11-05 15:39:51 +01:00
FLAG flag_jsonrpc_no_keep_alive : ( bool ) = false , or | c : & Config | c . rpc . as_ref ( ) ? . keep_alive ,
" --jsonrpc-no-keep-alive " ,
" Disable HTTP/1.1 keep alive header. Disabling keep alive will prevent re-using the same TCP connection to fire multiple requests, recommended when using one request per connection. " ,
2018-11-16 14:00:34 +01:00
FLAG flag_jsonrpc_experimental : ( bool ) = false , or | c : & Config | c . rpc . as_ref ( ) ? . experimental_rpcs . clone ( ) ,
" --jsonrpc-experimental " ,
" Enable experimental RPCs. Enable to have access to methods from unfinalised EIPs in all namespaces " ,
2018-02-16 16:37:12 +01:00
ARG arg_jsonrpc_port : ( u16 ) = 8545 u16 , or | c : & Config | c . rpc . as_ref ( ) ? . port . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --jsonrpc-port=[PORT] " ,
2018-07-03 11:34:46 +02:00
" Specify the port portion of the HTTP JSON-RPC API server. " ,
2017-09-05 13:30:22 +02:00
2018-09-12 11:47:01 +02:00
ARG arg_jsonrpc_interface : ( String ) = " local " , or | c : & Config | c . rpc . as_ref ( ) ? . interface . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --jsonrpc-interface=[IP] " ,
2018-07-03 11:34:46 +02:00
" Specify the hostname portion of the HTTP JSON-RPC API server, IP should be an interface's IP address, or all (all interfaces) or local. " ,
2017-09-05 13:30:22 +02:00
2019-07-12 14:15:30 +02:00
ARG arg_jsonrpc_apis : ( String ) = " web3,eth,pubsub,net,parity,private,parity_pubsub,traces,rpc,parity_transactions_pool " , or | c : & Config | c . rpc . as_ref ( ) ? . apis . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --jsonrpc-apis=[APIS] " ,
2019-07-12 14:15:30 +02:00
" Specify the APIs available through the HTTP JSON-RPC interface using a comma-delimited list of API names. Possible names are: all, safe, debug, web3, net, eth, pubsub, personal, signer, parity, parity_pubsub, parity_accounts, parity_set, traces, rpc, secretstore. You can also disable a specific API by putting '-' in the front, example: all,-personal. 'safe' enables the following APIs: web3, net, eth, pubsub, parity, parity_pubsub, traces, rpc " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_jsonrpc_hosts : ( String ) = " none " , or | c : & Config | c . rpc . as_ref ( ) ? . hosts . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --jsonrpc-hosts=[HOSTS] " ,
" List of allowed Host header values. This option will validate the Host header sent by the browser, it is additional security against some attack vectors. Special options: \" all \" , \" none \" ,. " ,
2018-02-16 16:37:12 +01:00
ARG arg_jsonrpc_threads : ( usize ) = 4 usize , or | c : & Config | c . rpc . as_ref ( ) ? . processing_threads ,
2017-09-05 13:30:22 +02:00
" --jsonrpc-threads=[THREADS] " ,
2018-09-17 18:56:33 +02:00
" Turn on additional processing threads for JSON-RPC servers (all transports). Setting this to a non-zero value allows parallel execution of cpu-heavy queries. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_jsonrpc_cors : ( String ) = " none " , or | c : & Config | c . rpc . as_ref ( ) ? . cors . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --jsonrpc-cors=[URL] " ,
2018-07-03 11:34:46 +02:00
" Specify CORS header for HTTP JSON-RPC API responses. Special options: \" all \" , \" none \" . " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_jsonrpc_server_threads : ( Option < usize > ) = None , or | c : & Config | c . rpc . as_ref ( ) ? . server_threads ,
2017-09-05 13:30:22 +02:00
" --jsonrpc-server-threads=[NUM] " ,
2017-10-05 12:35:01 +02:00
" Enables multiple threads handling incoming connections for HTTP JSON-RPC server. " ,
2017-09-05 13:30:22 +02:00
2018-07-02 10:23:57 +02:00
ARG arg_jsonrpc_max_payload : ( Option < usize > ) = None , or | c : & Config | c . rpc . as_ref ( ) ? . max_payload ,
" --jsonrpc-max-payload=[MB] " ,
2018-07-03 11:34:46 +02:00
" Specify maximum size for HTTP JSON-RPC requests in megabytes. " ,
2018-07-02 10:23:57 +02:00
2018-11-16 12:39:29 +01:00
ARG arg_poll_lifetime : ( u32 ) = 60 u32 , or | c : & Config | c . rpc . as_ref ( ) ? . poll_lifetime . clone ( ) ,
" --poll-lifetime=[S] " ,
" Set the RPC filter lifetime to S seconds. The filter has to be polled at least every S seconds , otherwise it is removed. " ,
2018-06-25 10:19:29 +02:00
[ " API and Console Options – WebSockets " ]
2018-02-16 16:37:12 +01:00
FLAG flag_no_ws : ( bool ) = false , or | c : & Config | c . websockets . as_ref ( ) ? . disable . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --no-ws " ,
2018-07-03 11:34:46 +02:00
" Disable the WebSockets JSON-RPC server. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_ws_port : ( u16 ) = 8546 u16 , or | c : & Config | c . websockets . as_ref ( ) ? . port . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --ws-port=[PORT] " ,
2018-07-03 11:34:46 +02:00
" Specify the port portion of the WebSockets JSON-RPC server. " ,
2017-09-05 13:30:22 +02:00
2018-09-12 11:47:01 +02:00
ARG arg_ws_interface : ( String ) = " local " , or | c : & Config | c . websockets . as_ref ( ) ? . interface . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --ws-interface=[IP] " ,
2018-07-03 11:34:46 +02:00
" Specify the hostname portion of the WebSockets JSON-RPC server, IP should be an interface's IP address, or all (all interfaces) or local. " ,
2017-09-05 13:30:22 +02:00
2019-07-12 14:15:30 +02:00
ARG arg_ws_apis : ( String ) = " web3,eth,pubsub,net,parity,parity_pubsub,private,traces,rpc,parity_transactions_pool " , or | c : & Config | c . websockets . as_ref ( ) ? . apis . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --ws-apis=[APIS] " ,
2019-07-12 14:15:30 +02:00
" Specify the JSON-RPC APIs available through the WebSockets interface using a comma-delimited list of API names. Possible names are: all, safe, web3, net, eth, pubsub, personal, signer, parity, parity_pubsub, parity_accounts, parity_set, traces, rpc, secretstore. You can also disable a specific API by putting '-' in the front, example: all,-personal. 'safe' enables the following APIs: web3, net, eth, pubsub, parity, parity_pubsub, traces, rpc " ,
2017-09-05 13:30:22 +02:00
2018-03-02 10:26:49 +01:00
ARG arg_ws_origins : ( String ) = " parity://*,chrome-extension://*,moz-extension://* " , or | c : & Config | c . websockets . as_ref ( ) ? . origins . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --ws-origins=[URL] " ,
" Specify Origin header values allowed to connect. Special options: \" all \" , \" none \" . " ,
2018-02-16 16:37:12 +01:00
ARG arg_ws_hosts : ( String ) = " none " , or | c : & Config | c . websockets . as_ref ( ) ? . hosts . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --ws-hosts=[HOSTS] " ,
2018-01-31 09:50:52 +01:00
" List of allowed Host header values. This option will validate the Host header sent by the browser, it is additional security against some attack vectors. Special options: \" all \" , \" none \" . " ,
2017-09-05 13:30:22 +02:00
2018-04-02 12:33:09 +02:00
ARG arg_ws_max_connections : ( usize ) = 100 usize , or | c : & Config | c . websockets . as_ref ( ) ? . max_connections ,
" --ws-max-connections=[CONN] " ,
2018-07-10 12:17:11 +02:00
" Maximum number of allowed concurrent WebSockets JSON-RPC connections. " ,
2018-04-02 12:33:09 +02:00
2018-06-25 10:19:29 +02:00
[ " API and Console Options – IPC " ]
2018-02-16 16:37:12 +01:00
FLAG flag_no_ipc : ( bool ) = false , or | c : & Config | c . ipc . as_ref ( ) ? . disable . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --no-ipc " ,
" Disable JSON-RPC over IPC service. " ,
2018-02-16 16:37:12 +01:00
ARG arg_ipc_path : ( String ) = if cfg! ( windows ) { r "\\.\pipe\jsonrpc.ipc" } else { " $BASE/jsonrpc.ipc " } , or | c : & Config | c . ipc . as_ref ( ) ? . path . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --ipc-path=[PATH] " ,
" Specify custom path for JSON-RPC over IPC service. " ,
2019-07-12 14:15:30 +02:00
ARG arg_ipc_apis : ( String ) = " web3,eth,pubsub,net,parity,parity_pubsub,parity_accounts,private,traces,rpc,parity_transactions_pool " , or | c : & Config | c . ipc . as_ref ( ) ? . apis . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --ipc-apis=[APIS] " ,
2019-07-12 14:15:30 +02:00
" Specify custom API set available via JSON-RPC over IPC using a comma-delimited list of API names. Possible names are: all, safe, web3, net, eth, pubsub, personal, signer, parity, parity_pubsub, parity_accounts, parity_set, traces, rpc, secretstore. You can also disable a specific API by putting '-' in the front, example: all,-personal. 'safe' enables the following APIs: web3, net, eth, pubsub, parity, parity_pubsub, traces, rpc " ,
2017-09-05 13:30:22 +02:00
2018-06-25 10:19:29 +02:00
[ " API and Console Options – IPFS " ]
2018-02-16 16:37:12 +01:00
FLAG flag_ipfs_api : ( bool ) = false , or | c : & Config | c . ipfs . as_ref ( ) ? . enable . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --ipfs-api " ,
" Enable IPFS-compatible HTTP API. " ,
2018-02-16 16:37:12 +01:00
ARG arg_ipfs_api_port : ( u16 ) = 5001 u16 , or | c : & Config | c . ipfs . as_ref ( ) ? . port . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --ipfs-api-port=[PORT] " ,
" Configure on which port the IPFS HTTP API should listen. " ,
2018-02-16 16:37:12 +01:00
ARG arg_ipfs_api_interface : ( String ) = " local " , or | c : & Config | c . ipfs . as_ref ( ) ? . interface . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --ipfs-api-interface=[IP] " ,
" Specify the hostname portion of the IPFS API server, IP should be an interface's IP address or local. " ,
2018-02-16 16:37:12 +01:00
ARG arg_ipfs_api_hosts : ( String ) = " none " , or | c : & Config | c . ipfs . as_ref ( ) ? . hosts . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --ipfs-api-hosts=[HOSTS] " ,
" List of allowed Host header values. This option will validate the Host header sent by the browser, it is additional security against some attack vectors. Special options: \" all \" , \" none \" . " ,
2018-02-16 16:37:12 +01:00
ARG arg_ipfs_api_cors : ( String ) = " none " , or | c : & Config | c . ipfs . as_ref ( ) ? . cors . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --ipfs-api-cors=[URL] " ,
2017-12-27 18:56:06 +01:00
" Specify CORS header for IPFS API responses. Special options: \" all \" , \" none \" . " ,
2017-09-05 13:30:22 +02:00
2018-09-12 11:47:01 +02:00
[ " Light Client Options " ]
2018-12-05 10:36:53 +01:00
ARG arg_on_demand_response_time_window : ( Option < u64 > ) = None , or | c : & Config | c . light . as_ref ( ) ? . on_demand_response_time_window ,
" --on-demand-time-window=[S] " ,
" Specify the maximum time to wait for a successful response " ,
2018-09-12 11:47:01 +02:00
2018-12-05 10:36:53 +01:00
ARG arg_on_demand_request_backoff_start : ( Option < u64 > ) = None , or | c : & Config | c . light . as_ref ( ) ? . on_demand_request_backoff_start ,
" --on-demand-start-backoff=[S] " ,
" Specify light client initial backoff time for a request " ,
ARG arg_on_demand_request_backoff_max : ( Option < u64 > ) = None , or | c : & Config | c . light . as_ref ( ) ? . on_demand_request_backoff_max ,
" --on-demand-end-backoff=[S] " ,
" Specify light client maximum backoff time for a request " ,
ARG arg_on_demand_request_backoff_rounds_max : ( Option < usize > ) = None , or | c : & Config | c . light . as_ref ( ) ? . on_demand_request_backoff_rounds_max ,
" --on-demand-max-backoff-rounds=[TIMES] " ,
" Specify light client maximum number of backoff iterations for a request " ,
ARG arg_on_demand_request_consecutive_failures : ( Option < usize > ) = None , or | c : & Config | c . light . as_ref ( ) ? . on_demand_request_consecutive_failures ,
" --on-demand-consecutive-failures=[TIMES] " ,
" Specify light client the number of failures for a request until it gets exponentially backed off " ,
2018-09-12 11:47:01 +02:00
2018-06-25 10:19:29 +02:00
[ " Secret Store Options " ]
2018-02-16 16:37:12 +01:00
FLAG flag_no_secretstore : ( bool ) = false , or | c : & Config | c . secretstore . as_ref ( ) ? . disable . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --no-secretstore " ,
" Disable Secret Store functionality. " ,
2018-02-16 16:37:12 +01:00
FLAG flag_no_secretstore_http : ( bool ) = false , or | c : & Config | c . secretstore . as_ref ( ) ? . disable_http . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --no-secretstore-http " ,
" Disable Secret Store HTTP API. " ,
2018-02-16 16:37:12 +01:00
FLAG flag_no_secretstore_auto_migrate : ( bool ) = false , or | c : & Config | c . secretstore . as_ref ( ) ? . disable_auto_migrate . clone ( ) ,
2018-01-10 11:33:45 +01:00
" --no-secretstore-auto-migrate " ,
" Do not run servers set change session automatically when servers set changes. This option has no effect when servers set is read from configuration file. " ,
2019-04-20 07:31:37 +02:00
ARG arg_secretstore_http_cors : ( String ) = " none " , or | c : & Config | c . secretstore . as_ref ( ) ? . cors . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
" --secretstore-http-cors=[URL] " ,
" Specify CORS header for Secret Store HTTP API responses. Special options: \" all \" , \" none \" . " ,
2018-06-14 09:01:52 +02:00
ARG arg_secretstore_acl_contract : ( Option < String > ) = Some ( " registry " . into ( ) ) , or | c : & Config | c . secretstore . as_ref ( ) ? . acl_contract . clone ( ) ,
" --secretstore-acl-contract=[SOURCE] " ,
" Secret Store permissioning contract address source: none, registry (contract address is read from 'secretstore_acl_checker' entry in registry) or address. " ,
ARG arg_secretstore_contract : ( Option < String > ) = None , or | c : & Config | c . secretstore . as_ref ( ) ? . service_contract . clone ( ) ,
2017-11-24 10:33:33 +01:00
" --secretstore-contract=[SOURCE] " ,
2018-06-14 09:01:52 +02:00
" Secret Store Service contract address source: none, registry (contract address is read from 'secretstore_service' entry in registry) or address. " ,
2018-04-03 16:54:34 +02:00
2018-06-14 09:01:52 +02:00
ARG arg_secretstore_srv_gen_contract : ( Option < String > ) = None , or | c : & Config | c . secretstore . as_ref ( ) ? . service_contract_srv_gen . clone ( ) ,
2018-04-03 16:54:34 +02:00
" --secretstore-srv-gen-contract=[SOURCE] " ,
2018-06-14 09:01:52 +02:00
" Secret Store Service server key generation contract address source: none, registry (contract address is read from 'secretstore_service_srv_gen' entry in registry) or address. " ,
2018-04-03 16:54:34 +02:00
2018-06-14 09:01:52 +02:00
ARG arg_secretstore_srv_retr_contract : ( Option < String > ) = None , or | c : & Config | c . secretstore . as_ref ( ) ? . service_contract_srv_retr . clone ( ) ,
2018-04-03 16:54:34 +02:00
" --secretstore-srv-retr-contract=[SOURCE] " ,
2018-06-14 09:01:52 +02:00
" Secret Store Service server key retrieval contract address source: none, registry (contract address is read from 'secretstore_service_srv_retr' entry in registry) or address. " ,
2018-04-03 16:54:34 +02:00
2018-06-14 09:01:52 +02:00
ARG arg_secretstore_doc_store_contract : ( Option < String > ) = None , or | c : & Config | c . secretstore . as_ref ( ) ? . service_contract_doc_store . clone ( ) ,
2018-04-03 16:54:34 +02:00
" --secretstore-doc-store-contract=[SOURCE] " ,
2018-06-14 09:01:52 +02:00
" Secret Store Service document key store contract address source: none, registry (contract address is read from 'secretstore_service_doc_store' entry in registry) or address. " ,
2018-04-03 16:54:34 +02:00
2018-06-14 09:01:52 +02:00
ARG arg_secretstore_doc_sretr_contract : ( Option < String > ) = None , or | c : & Config | c . secretstore . as_ref ( ) ? . service_contract_doc_sretr . clone ( ) ,
2018-04-03 16:54:34 +02:00
" --secretstore-doc-sretr-contract=[SOURCE] " ,
2018-06-14 09:01:52 +02:00
" Secret Store Service document key shadow retrieval contract address source: none, registry (contract address is read from 'secretstore_service_doc_sretr' entry in registry) or address. " ,
2017-11-24 10:33:33 +01:00
2018-02-16 16:37:12 +01:00
ARG arg_secretstore_nodes : ( String ) = " " , or | c : & Config | c . secretstore . as_ref ( ) ? . nodes . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --secretstore-nodes=[NODES] " ,
" Comma-separated list of other secret store cluster nodes in form NODE_PUBLIC_KEY_IN_HEX@NODE_IP_ADDR:NODE_PORT. " ,
2018-06-14 09:01:52 +02:00
ARG arg_secretstore_server_set_contract : ( Option < String > ) = Some ( " registry " . into ( ) ) , or | c : & Config | c . secretstore . as_ref ( ) ? . server_set_contract . clone ( ) ,
" --secretstore-server-set-contract=[SOURCE] " ,
" Secret Store server set contract address source: none, registry (contract address is read from 'secretstore_server_set' entry in registry) or address. " ,
2018-02-16 16:37:12 +01:00
ARG arg_secretstore_interface : ( String ) = " local " , or | c : & Config | c . secretstore . as_ref ( ) ? . interface . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --secretstore-interface=[IP] " ,
" Specify the hostname portion for listening to Secret Store Key Server internal requests, IP should be an interface's IP address, or local. " ,
2018-02-16 16:37:12 +01:00
ARG arg_secretstore_port : ( u16 ) = 8083 u16 , or | c : & Config | c . secretstore . as_ref ( ) ? . port . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --secretstore-port=[PORT] " ,
" Specify the port portion for listening to Secret Store Key Server internal requests. " ,
2018-02-16 16:37:12 +01:00
ARG arg_secretstore_http_interface : ( String ) = " local " , or | c : & Config | c . secretstore . as_ref ( ) ? . http_interface . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --secretstore-http-interface=[IP] " ,
" Specify the hostname portion for listening to Secret Store Key Server HTTP requests, IP should be an interface's IP address, or local. " ,
2018-02-16 16:37:12 +01:00
ARG arg_secretstore_http_port : ( u16 ) = 8082 u16 , or | c : & Config | c . secretstore . as_ref ( ) ? . http_port . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --secretstore-http-port=[PORT] " ,
" Specify the port portion for listening to Secret Store Key Server HTTP requests. " ,
2018-02-16 16:37:12 +01:00
ARG arg_secretstore_path : ( String ) = " $BASE/secretstore " , or | c : & Config | c . secretstore . as_ref ( ) ? . path . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --secretstore-path=[PATH] " ,
2018-01-31 09:50:52 +01:00
" Specify directory where Secret Store should save its data. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_secretstore_secret : ( Option < String > ) = None , or | c : & Config | c . secretstore . as_ref ( ) ? . self_secret . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --secretstore-secret=[SECRET] " ,
" Hex-encoded secret key of this node. " ,
2018-02-16 16:37:12 +01:00
ARG arg_secretstore_admin_public : ( Option < String > ) = None , or | c : & Config | c . secretstore . as_ref ( ) ? . admin_public . clone ( ) ,
2018-01-10 11:33:45 +01:00
" --secretstore-admin=[PUBLIC] " ,
2017-10-02 15:27:31 +02:00
" Hex-encoded public key of secret store administrator. " ,
2018-06-25 10:19:29 +02:00
[ " Sealing/Mining Options " ]
2018-02-16 16:37:12 +01:00
FLAG flag_force_sealing : ( bool ) = false , or | c : & Config | c . mining . as_ref ( ) ? . force_sealing . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --force-sealing " ,
" Force the node to author new blocks as if it were always sealing/mining. " ,
2018-02-16 16:37:12 +01:00
FLAG flag_reseal_on_uncle : ( bool ) = false , or | c : & Config | c . mining . as_ref ( ) ? . reseal_on_uncle . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --reseal-on-uncle " ,
" Force the node to author new blocks when a new uncle block is imported. " ,
2018-02-16 16:37:12 +01:00
FLAG flag_remove_solved : ( bool ) = false , or | c : & Config | c . mining . as_ref ( ) ? . remove_solved . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --remove-solved " ,
" Move solved blocks from the work package queue instead of cloning them. This gives a slightly faster import speed, but means that extra solutions submitted for the same work package will go unused. " ,
2018-06-18 15:32:18 +02:00
FLAG flag_tx_queue_no_unfamiliar_locals : ( bool ) = false , or | c : & Config | c . mining . as_ref ( ) ? . tx_queue_no_unfamiliar_locals . clone ( ) ,
" --tx-queue-no-unfamiliar-locals " ,
2018-07-10 12:17:11 +02:00
" Local transactions sent through JSON-RPC (HTTP, WebSockets, etc) will be treated as 'external' if the sending account is unknown. " ,
2018-06-18 15:32:18 +02:00
2018-07-24 15:04:48 +02:00
FLAG flag_tx_queue_no_early_reject : ( bool ) = false , or | c : & Config | c . mining . as_ref ( ) ? . tx_queue_no_early_reject . clone ( ) ,
" --tx-queue-no-early-reject " ,
" Disables transaction queue optimization to early reject transactions below minimal effective gas price. This allows local transactions to always enter the pool, despite it being full, but requires additional ecrecover on every transaction. " ,
2018-02-16 16:37:12 +01:00
FLAG flag_refuse_service_transactions : ( bool ) = false , or | c : & Config | c . mining . as_ref ( ) ? . refuse_service_transactions . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --refuse-service-transactions " ,
2017-11-03 15:20:20 +01:00
" Always refuse service transactions. " ,
2018-02-16 16:37:12 +01:00
FLAG flag_infinite_pending_block : ( bool ) = false , or | c : & Config | c . mining . as_ref ( ) ? . infinite_pending_block . clone ( ) ,
2017-11-03 15:20:20 +01:00
" --infinite-pending-block " ,
" Pending block will be created with maximal possible gas limit and will execute all transactions in the queue. Note that such block is invalid and should never be attempted to be mined. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
FLAG flag_no_persistent_txqueue : ( bool ) = false , or | c : & Config | c . parity . as_ref ( ) ? . no_persistent_txqueue ,
2017-09-05 13:30:22 +02:00
" --no-persistent-txqueue " ,
" Don't save pending local transactions to disk to be restored whenever the node restarts. " ,
2019-04-02 11:19:20 +02:00
// For backward compatibility; Stratum should be enabled if the config file
// contains a `[stratum]` section and it is not explicitly disabled (disable = true)
FLAG flag_stratum : ( bool ) = false , or | c : & Config | Some ( c . stratum . as_ref ( ) . map ( | s | s . disable ! = Some ( true ) ) . unwrap_or ( false ) ) ,
2017-09-05 13:30:22 +02:00
" --stratum " ,
" Run Stratum server for miner push notification. " ,
2018-02-16 16:37:12 +01:00
ARG arg_reseal_on_txs : ( String ) = " own " , or | c : & Config | c . mining . as_ref ( ) ? . reseal_on_txs . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --reseal-on-txs=[SET] " ,
" Specify which transactions should force the node to reseal a block. SET is one of: none - never reseal on new transactions; own - reseal only on a new local transaction; ext - reseal only on a new external transaction; all - reseal on all new transactions. " ,
2018-02-16 16:37:12 +01:00
ARG arg_reseal_min_period : ( u64 ) = 2000 u64 , or | c : & Config | c . mining . as_ref ( ) ? . reseal_min_period . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --reseal-min-period=[MS] " ,
" Specify the minimum time between reseals from incoming transactions. MS is time measured in milliseconds. " ,
2018-02-16 16:37:12 +01:00
ARG arg_reseal_max_period : ( u64 ) = 120000 u64 , or | c : & Config | c . mining . as_ref ( ) ? . reseal_max_period . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --reseal-max-period=[MS] " ,
" Specify the maximum time since last block to enable force-sealing. MS is time measured in milliseconds. " ,
2018-02-16 16:37:12 +01:00
ARG arg_work_queue_size : ( usize ) = 20 usize , or | c : & Config | c . mining . as_ref ( ) ? . work_queue_size . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --work-queue-size=[ITEMS] " ,
" Specify the number of historical work packages which are kept cached lest a solution is found for them later. High values take more memory but result in fewer unusable solutions. " ,
2018-02-16 16:37:12 +01:00
ARG arg_relay_set : ( String ) = " cheap " , or | c : & Config | c . mining . as_ref ( ) ? . relay_set . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --relay-set=[SET] " ,
" Set of transactions to relay. SET may be: cheap - Relay any transaction in the queue (this may include invalid transactions); strict - Relay only executed transactions (this guarantees we don't relay invalid transactions, but means we relay nothing if not mining); lenient - Same as strict when mining, and cheap when not. " ,
2018-02-16 16:37:12 +01:00
ARG arg_usd_per_tx : ( String ) = " 0.0001 " , or | c : & Config | c . mining . as_ref ( ) ? . usd_per_tx . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --usd-per-tx=[USD] " ,
" Amount of USD to be paid for a basic transaction. The minimum gas price is set accordingly. " ,
2018-02-16 16:37:12 +01:00
ARG arg_usd_per_eth : ( String ) = " auto " , or | c : & Config | c . mining . as_ref ( ) ? . usd_per_eth . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --usd-per-eth=[SOURCE] " ,
" USD value of a single ETH. SOURCE may be either an amount in USD, a web service or 'auto' to use each web service in turn and fallback on the last known good value. " ,
2018-02-16 16:37:12 +01:00
ARG arg_price_update_period : ( String ) = " hourly " , or | c : & Config | c . mining . as_ref ( ) ? . price_update_period . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --price-update-period=[T] " ,
" T will be allowed to pass between each gas price update. T may be daily, hourly, a number of seconds, or a time string of the form \" 2 days \" , \" 30 minutes \" etc.. " ,
2018-09-17 08:33:00 +02:00
ARG arg_gas_floor_target : ( String ) = " 8000000 " , or | c : & Config | c . mining . as_ref ( ) ? . gas_floor_target . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --gas-floor-target=[GAS] " ,
" Amount of gas per block to target when sealing a new block. " ,
2018-09-17 08:33:00 +02:00
ARG arg_gas_cap : ( String ) = " 10000000 " , or | c : & Config | c . mining . as_ref ( ) ? . gas_cap . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --gas-cap=[GAS] " ,
" A cap on how large we will raise the gas limit per block due to transaction volume. " ,
2018-04-13 17:34:27 +02:00
ARG arg_tx_queue_mem_limit : ( u32 ) = 4 u32 , or | c : & Config | c . mining . as_ref ( ) ? . tx_queue_mem_limit . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --tx-queue-mem-limit=[MB] " ,
" Maximum amount of memory that can be used by the transaction queue. Setting this parameter to 0 disables limiting. " ,
2018-04-13 17:34:27 +02:00
ARG arg_tx_queue_size : ( usize ) = 8_192 usize , or | c : & Config | c . mining . as_ref ( ) ? . tx_queue_size . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --tx-queue-size=[LIMIT] " ,
" Maximum amount of transactions in the queue (waiting to be included in next block). " ,
2018-04-13 17:34:27 +02:00
ARG arg_tx_queue_per_sender : ( Option < usize > ) = None , or | c : & Config | c . mining . as_ref ( ) ? . tx_queue_per_sender . clone ( ) ,
" --tx-queue-per-sender=[LIMIT] " ,
" Maximum number of transactions per sender in the queue. By default it's 1% of the entire queue, but not less than 16. " ,
2019-01-28 11:26:11 +01:00
ARG arg_tx_queue_locals : ( Option < String > ) = None , or | c : & Config | helpers ::join_set ( c . mining . as_ref ( ) ? . tx_queue_locals . as_ref ( ) ) ,
" --tx-queue-locals=[ACCOUNTS] " ,
" Specify local accounts for which transactions are prioritized in the queue. ACCOUNTS is a comma-delimited list of addresses. " ,
2018-02-16 16:37:12 +01:00
ARG arg_tx_queue_strategy : ( String ) = " gas_price " , or | c : & Config | c . mining . as_ref ( ) ? . tx_queue_strategy . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --tx-queue-strategy=[S] " ,
2018-04-13 17:34:27 +02:00
" Prioritization strategy used to order transactions in the queue. S may be: gas_price - Prioritize txs with high gas price " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_stratum_interface : ( String ) = " local " , or | c : & Config | c . stratum . as_ref ( ) ? . interface . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --stratum-interface=[IP] " ,
" Interface address for Stratum server. " ,
2018-02-16 16:37:12 +01:00
ARG arg_stratum_port : ( u16 ) = 8008 u16 , or | c : & Config | c . stratum . as_ref ( ) ? . port . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --stratum-port=[PORT] " ,
" Port for Stratum server to listen on. " ,
2018-02-16 16:37:12 +01:00
ARG arg_min_gas_price : ( Option < u64 > ) = None , or | c : & Config | c . mining . as_ref ( ) ? . min_gas_price . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --min-gas-price=[STRING] " ,
2017-10-25 11:38:47 +02:00
" Minimum amount of Wei per GAS to be paid for a transaction to be accepted for mining. Overrides --usd-per-tx. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_gas_price_percentile : ( usize ) = 50 usize , or | c : & Config | c . mining . as_ref ( ) ? . gas_price_percentile ,
2018-01-09 12:43:36 +01:00
" --gas-price-percentile=[PCT] " ,
" Set PCT percentile gas price value from last 100 blocks as default gas price when sending transactions. " ,
2018-02-16 16:37:12 +01:00
ARG arg_author : ( Option < String > ) = None , or | c : & Config | c . mining . as_ref ( ) ? . author . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --author=[ADDRESS] " ,
" Specify the block author (aka \" coinbase \" ) address for sending block rewards from sealed blocks. NOTE: MINING WILL NOT WORK WITHOUT THIS OPTION. " , // Sealing/Mining Option
2018-02-16 16:37:12 +01:00
ARG arg_engine_signer : ( Option < String > ) = None , or | c : & Config | c . mining . as_ref ( ) ? . engine_signer . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --engine-signer=[ADDRESS] " ,
" Specify the address which should be used to sign consensus messages and issue blocks. Relevant only to non-PoW chains. " ,
2018-02-16 16:37:12 +01:00
ARG arg_tx_gas_limit : ( Option < String > ) = None , or | c : & Config | c . mining . as_ref ( ) ? . tx_gas_limit . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --tx-gas-limit=[GAS] " ,
" Apply a limit of GAS as the maximum amount of gas a single transaction may have for it to be mined. " ,
2018-02-16 16:37:12 +01:00
ARG arg_tx_time_limit : ( Option < u64 > ) = None , or | c : & Config | c . mining . as_ref ( ) ? . tx_time_limit . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --tx-time-limit=[MS] " ,
2018-04-13 17:34:27 +02:00
" Maximal time for processing single transaction. If enabled senders of transactions offending the limit will get other transactions penalized. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_extra_data : ( Option < String > ) = None , or | c : & Config | c . mining . as_ref ( ) ? . extra_data . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --extra-data=[STRING] " ,
" Specify a custom extra-data for authored blocks, no more than 32 characters. " ,
2018-02-16 16:37:12 +01:00
ARG arg_notify_work : ( Option < String > ) = None , or | c : & Config | c . mining . as_ref ( ) ? . notify_work . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2017-09-05 13:30:22 +02:00
" --notify-work=[URLS] " ,
" URLs to which work package notifications are pushed. URLS should be a comma-delimited list of HTTP URLs. " ,
2018-02-16 16:37:12 +01:00
ARG arg_stratum_secret : ( Option < String > ) = None , or | c : & Config | c . stratum . as_ref ( ) ? . secret . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --stratum-secret=[STRING] " ,
" Secret for authorizing Stratum server for peers. " ,
2018-10-26 13:21:36 +02:00
ARG arg_max_round_blocks_to_import : ( usize ) = 12 usize , or | c : & Config | c . mining . as_ref ( ) ? . max_round_blocks_to_import . clone ( ) ,
" --max-round-blocks-to-import=[S] " ,
" Maximal number of blocks to import for each import round. " ,
2017-09-05 13:30:22 +02:00
[ " Internal Options " ]
FLAG flag_can_restart : ( bool ) = false , or | _ | None ,
" --can-restart " ,
" Executable will auto-restart if exiting with 69 " ,
2018-06-25 10:19:29 +02:00
[ " Miscellaneous Options " ]
2018-02-16 16:37:12 +01:00
FLAG flag_no_color : ( bool ) = false , or | c : & Config | c . misc . as_ref ( ) ? . color . map ( | c | ! c ) . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --no-color " ,
" Don't use terminal color codes in output. " ,
FLAG flag_version : ( bool ) = false , or | _ | None ,
" -v, --version " ,
" Show information about version. " ,
FLAG flag_no_config : ( bool ) = false , or | _ | None ,
" --no-config " ,
" Don't load a configuration file. " ,
2018-02-16 16:37:12 +01:00
ARG arg_logging : ( Option < String > ) = None , or | c : & Config | c . misc . as_ref ( ) ? . logging . clone ( ) ,
2017-09-05 13:30:22 +02:00
" -l, --logging=[LOGGING] " ,
2018-07-18 09:09:31 +02:00
" Specify the general logging level (error, warn, info, debug or trace). It can also be set for a specific module, example: '-l sync=debug,rpc=trace' " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_log_file : ( Option < String > ) = None , or | c : & Config | c . misc . as_ref ( ) ? . log_file . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --log-file=[FILENAME] " ,
" Specify a filename into which logging should be appended. " ,
2018-06-25 10:19:29 +02:00
[ " Footprint Options " ]
2018-02-16 16:37:12 +01:00
FLAG flag_scale_verifiers : ( bool ) = false , or | c : & Config | c . footprint . as_ref ( ) ? . scale_verifiers . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --scale-verifiers " ,
" Automatically scale amount of verifier threads based on workload. Not guaranteed to be faster. " ,
2018-02-16 16:37:12 +01:00
ARG arg_tracing : ( String ) = " auto " , or | c : & Config | c . footprint . as_ref ( ) ? . tracing . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --tracing=[BOOL] " ,
" Indicates if full transaction tracing should be 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). " , // footprint option
2018-02-16 16:37:12 +01:00
ARG arg_pruning : ( String ) = " auto " , or | c : & Config | c . footprint . as_ref ( ) ? . pruning . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --pruning=[METHOD] " ,
" Configure pruning of the state/storage trie. METHOD may be one of auto, archive, fast: archive - keep all state trie data. No pruning. fast - maintain journal overlay. Fast but 50MB used. auto - use the method most recently synced or default to fast if none synced. " ,
2018-02-16 16:37:12 +01:00
ARG arg_pruning_history : ( u64 ) = 64 u64 , or | c : & Config | c . footprint . as_ref ( ) ? . pruning_history . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --pruning-history=[NUM] " ,
2018-03-16 09:11:54 +01:00
" Set a minimum number of recent states to keep in memory when pruning is active. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_pruning_memory : ( usize ) = 32 usize , or | c : & Config | c . footprint . as_ref ( ) ? . pruning_memory . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --pruning-memory=[MB] " ,
" The ideal amount of memory in megabytes to use to store recent states. As many states as possible will be kept within this limit, and at least --pruning-history states will always be kept. " ,
2018-02-16 16:37:12 +01:00
ARG arg_cache_size_db : ( u32 ) = 128 u32 , or | c : & Config | c . footprint . as_ref ( ) ? . cache_size_db . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --cache-size-db=[MB] " ,
" Override database cache size. " ,
2018-02-16 16:37:12 +01:00
ARG arg_cache_size_blocks : ( u32 ) = 8 u32 , or | c : & Config | c . footprint . as_ref ( ) ? . cache_size_blocks . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --cache-size-blocks=[MB] " ,
2018-06-25 10:19:29 +02:00
" Specify the preferred size of the blockchain cache in megabytes. " ,
2017-09-05 13:30:22 +02:00
2018-02-16 16:37:12 +01:00
ARG arg_cache_size_queue : ( u32 ) = 40 u32 , or | c : & Config | c . footprint . as_ref ( ) ? . cache_size_queue . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --cache-size-queue=[MB] " ,
" Specify the maximum size of memory to use for block queue. " ,
2018-02-16 16:37:12 +01:00
ARG arg_cache_size_state : ( u32 ) = 25 u32 , or | c : & Config | c . footprint . as_ref ( ) ? . cache_size_state . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --cache-size-state=[MB] " ,
" Specify the maximum size of memory to use for the state cache. " ,
2018-02-16 16:37:12 +01:00
ARG arg_db_compaction : ( String ) = " auto " , or | c : & Config | c . footprint . as_ref ( ) ? . db_compaction . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --db-compaction=[TYPE] " ,
" Database compaction type. TYPE may be one of: ssd - suitable for SSDs and fast HDDs; hdd - suitable for slow HDDs; auto - determine automatically. " ,
2018-02-16 16:37:12 +01:00
ARG arg_fat_db : ( String ) = " auto " , or | c : & Config | c . footprint . as_ref ( ) ? . fat_db . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --fat-db=[BOOL] " ,
" Build appropriate information to allow enumeration of all accounts and storage keys. Doubles the size of the state database. BOOL may be one of on, off or auto. " ,
2018-02-16 16:37:12 +01:00
ARG arg_cache_size : ( Option < u32 > ) = None , or | c : & Config | c . footprint . as_ref ( ) ? . cache_size . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --cache-size=[MB] " ,
" Set total amount of discretionary memory to use for the entire system, overrides other cache and queue options. " ,
2018-02-16 16:37:12 +01:00
ARG arg_num_verifiers : ( Option < usize > ) = None , or | c : & Config | c . footprint . as_ref ( ) ? . num_verifiers . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --num-verifiers=[INT] " ,
" Amount of verifier threads to use or to begin with, if verifier auto-scaling is enabled. " ,
2018-06-25 10:19:29 +02:00
[ " Import/export Options " ]
2017-09-05 13:30:22 +02:00
FLAG flag_no_seal_check : ( bool ) = false , or | _ | None ,
" --no-seal-check " ,
" Skip block seal check. " ,
2018-06-25 10:19:29 +02:00
[ " Snapshot Options " ]
2018-02-16 16:37:12 +01:00
FLAG flag_no_periodic_snapshot : ( bool ) = false , or | c : & Config | c . snapshots . as_ref ( ) ? . disable_periodic . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --no-periodic-snapshot " ,
2019-02-26 13:35:40 +01:00
" Disable automated snapshots which usually occur once every 5000 blocks. " ,
2017-09-05 13:30:22 +02:00
2018-09-13 12:58:49 +02:00
ARG arg_snapshot_threads : ( Option < usize > ) = None , or | c : & Config | c . snapshots . as_ref ( ) ? . processing_threads ,
" --snapshot-threads=[NUM] " ,
" Enables multiple threads for snapshots creation. " ,
2018-06-25 10:19:29 +02:00
[ " Whisper Options " ]
2018-02-16 16:37:12 +01:00
FLAG flag_whisper : ( bool ) = false , or | c : & Config | c . whisper . as_ref ( ) ? . enabled ,
2017-09-05 13:30:22 +02:00
" --whisper " ,
2019-07-12 14:15:30 +02:00
" Does nothing. Whisper has been moved to https://github.com/paritytech/whisper " ,
2017-09-05 13:30:22 +02:00
2019-07-12 14:15:30 +02:00
ARG arg_whisper_pool_size : ( Option < usize > ) = None , or | c : & Config | c . whisper . as_ref ( ) ? . pool_size . clone ( ) ,
2017-09-05 13:30:22 +02:00
" --whisper-pool-size=[MB] " ,
2019-07-12 14:15:30 +02:00
" Does nothing. Whisper has been moved to https://github.com/paritytech/whisper " ,
2017-09-05 13:30:22 +02:00
2018-06-25 10:19:29 +02:00
[ " Legacy Options " ]
2018-09-12 11:47:01 +02:00
// Options that are hidden from config, but are still unique for its functionality.
2017-09-05 13:30:22 +02:00
FLAG flag_geth : ( bool ) = false , or | _ | None ,
" --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. Includes the personal_ RPC by default. " ,
FLAG flag_import_geth_keys : ( bool ) = false , or | _ | None ,
" --import-geth-keys " ,
" Attempt to import keys from Geth client. " ,
2018-07-09 21:36:04 +02:00
// Options that either do nothing, or are replaced by other options.
// FLAG Removed in 1.6 or before.
2017-09-05 13:30:22 +02:00
2018-07-09 21:36:04 +02:00
FLAG flag_warp : ( bool ) = false , or | _ | None ,
" --warp " ,
" Does nothing; warp sync is enabled by default. Use --no-warp to disable. " ,
2017-09-05 13:30:22 +02:00
FLAG flag_jsonrpc : ( bool ) = false , or | _ | None ,
" -j, --jsonrpc " ,
2018-07-03 11:34:46 +02:00
" Does nothing; HTTP JSON-RPC is on by default now. " ,
2017-09-05 13:30:22 +02:00
2018-07-09 21:36:04 +02:00
FLAG flag_rpc : ( bool ) = false , or | _ | None ,
" --rpc " ,
" Does nothing; HTTP JSON-RPC is on by default now. " ,
2017-09-05 13:30:22 +02:00
FLAG flag_jsonrpc_off : ( bool ) = false , or | _ | None ,
" --jsonrpc-off " ,
" Equivalent to --no-jsonrpc. " ,
FLAG flag_webapp : ( bool ) = false , or | _ | None ,
" -w, --webapp " ,
2018-07-09 21:36:04 +02:00
" Does nothing; dapps server has been removed. " ,
2017-09-05 13:30:22 +02:00
FLAG flag_dapps_off : ( bool ) = false , or | _ | None ,
" --dapps-off " ,
" Equivalent to --no-dapps. " ,
2018-07-09 21:36:04 +02:00
FLAG flag_ipcdisable : ( bool ) = false , or | _ | None ,
" --ipcdisable " ,
" Equivalent to --no-ipc. " ,
FLAG flag_ipc_off : ( bool ) = false , or | _ | None ,
" --ipc-off " ,
" Equivalent to --no-ipc. " ,
FLAG flag_testnet : ( bool ) = false , or | _ | None ,
" --testnet " ,
" Testnet mode. Equivalent to --chain testnet. Overrides the --keys-path option. " ,
FLAG flag_nodiscover : ( bool ) = false , or | _ | None ,
" --nodiscover " ,
" Equivalent to --no-discovery. " ,
// FLAG Removed in 1.7.
FLAG flag_dapps_apis_all : ( bool ) = false , or | _ | None ,
" --dapps-apis-all " ,
" Dapps server is merged with HTTP JSON-RPC server. Use --jsonrpc-apis. " ,
// FLAG Removed in 1.11.
2017-09-05 13:30:22 +02:00
2018-06-01 16:49:55 +02:00
FLAG flag_public_node : ( bool ) = false , or | _ | None ,
" --public-node " ,
" Does nothing; Public node is removed from Parity. " ,
2018-06-06 10:05:52 +02:00
FLAG flag_force_ui : ( bool ) = false , or | _ | None ,
" --force-ui " ,
" Does nothing; UI is now a separate project. " ,
FLAG flag_no_ui : ( bool ) = false , or | _ | None ,
" --no-ui " ,
" Does nothing; UI is now a separate project. " ,
FLAG flag_ui_no_validation : ( bool ) = false , or | _ | None ,
" --ui-no-validation " ,
" Does nothing; UI is now a separate project. " ,
2018-07-10 17:33:25 +02:00
// FLAG Removed in 2.0.
FLAG flag_fast_and_loose : ( bool ) = false , or | _ | None ,
" --fast-and-loose " ,
" Does nothing; DB WAL is always activated. " ,
2018-07-11 12:19:54 +02:00
FLAG flag_no_dapps : ( bool ) = false , or | c : & Config | c . dapps . as_ref ( ) ? . _legacy_disable . clone ( ) ,
" --no-dapps " ,
" Disable the Dapps server (e.g. status page). " ,
2018-07-09 21:36:04 +02:00
// ARG Removed in 1.6 or before.
2017-09-05 13:30:22 +02:00
2018-07-09 21:36:04 +02:00
ARG arg_etherbase : ( Option < String > ) = None , or | _ | None ,
" --etherbase=[ADDRESS] " ,
" Equivalent to --author ADDRESS. " ,
2017-09-05 13:30:22 +02:00
2018-07-09 21:36:04 +02:00
ARG arg_extradata : ( Option < String > ) = None , or | _ | None ,
" --extradata=[STRING] " ,
" Equivalent to --extra-data STRING. " ,
2017-09-05 13:30:22 +02:00
ARG arg_datadir : ( Option < String > ) = None , or | _ | None ,
" --datadir=[PATH] " ,
" Equivalent to --base-path PATH. " ,
ARG arg_networkid : ( Option < u64 > ) = None , or | _ | None ,
" --networkid=[INDEX] " ,
" Equivalent to --network-id INDEX. " ,
ARG arg_peers : ( Option < u16 > ) = None , or | _ | None ,
" --peers=[NUM] " ,
" Equivalent to --min-peers NUM. " ,
ARG arg_nodekey : ( Option < String > ) = None , or | _ | None ,
" --nodekey=[KEY] " ,
" Equivalent to --node-key KEY. " ,
ARG arg_rpcaddr : ( Option < String > ) = None , or | _ | None ,
" --rpcaddr=[IP] " ,
" Equivalent to --jsonrpc-interface IP. " ,
ARG arg_rpcport : ( Option < u16 > ) = None , or | _ | None ,
" --rpcport=[PORT] " ,
" Equivalent to --jsonrpc-port PORT. " ,
ARG arg_rpcapi : ( Option < String > ) = None , or | _ | None ,
" --rpcapi=[APIS] " ,
" Equivalent to --jsonrpc-apis APIS. " ,
ARG arg_rpccorsdomain : ( Option < String > ) = None , or | _ | None ,
" --rpccorsdomain=[URL] " ,
" Equivalent to --jsonrpc-cors URL. " ,
ARG arg_ipcapi : ( Option < String > ) = None , or | _ | None ,
" --ipcapi=[APIS] " ,
" Equivalent to --ipc-apis APIS. " ,
ARG arg_ipcpath : ( Option < String > ) = None , or | _ | None ,
" --ipcpath=[PATH] " ,
" Equivalent to --ipc-path PATH. " ,
ARG arg_gasprice : ( Option < String > ) = None , or | _ | None ,
" --gasprice=[WEI] " ,
" Equivalent to --min-gas-price WEI. " ,
ARG arg_cache : ( Option < u32 > ) = None , or | _ | None ,
" --cache=[MB] " ,
" Equivalent to --cache-size MB. " ,
2018-07-09 21:36:04 +02:00
// ARG Removed in 1.7.
2018-07-11 12:19:54 +02:00
ARG arg_dapps_port : ( Option < u16 > ) = None , or | c : & Config | c . dapps . as_ref ( ) ? . _legacy_port . clone ( ) ,
2018-07-09 21:36:04 +02:00
" --dapps-port=[PORT] " ,
" Does nothing; dapps server has been removed. " ,
2018-07-11 12:19:54 +02:00
ARG arg_dapps_interface : ( Option < String > ) = None , or | c : & Config | c . dapps . as_ref ( ) ? . _legacy_interface . clone ( ) ,
2018-07-09 21:36:04 +02:00
" --dapps-interface=[IP] " ,
" Does nothing; dapps server has been removed. " ,
2018-07-11 12:19:54 +02:00
ARG arg_dapps_hosts : ( Option < String > ) = None , or | c : & Config | c . dapps . as_ref ( ) ? . _legacy_hosts . as_ref ( ) . map ( | vec | vec . join ( " , " ) ) ,
2018-07-09 21:36:04 +02:00
" --dapps-hosts=[HOSTS] " ,
" Does nothing; dapps server has been removed. " ,
2018-07-11 12:19:54 +02:00
ARG arg_dapps_cors : ( Option < String > ) = None , or | c : & Config | c . dapps . as_ref ( ) ? . _legacy_cors . clone ( ) ,
2018-07-09 21:36:04 +02:00
" --dapps-cors=[URL] " ,
" Does nothing; dapps server has been removed. " ,
2018-07-11 12:19:54 +02:00
ARG arg_dapps_user : ( Option < String > ) = None , or | c : & Config | c . dapps . as_ref ( ) ? . _legacy_user . clone ( ) ,
2018-07-09 21:36:04 +02:00
" --dapps-user=[USERNAME] " ,
" Dapps server authentication has been removed. " ,
2018-07-11 12:19:54 +02:00
ARG arg_dapps_pass : ( Option < String > ) = None , or | c : & Config | c . dapps . as_ref ( ) ? . _legacy_pass . clone ( ) ,
2018-07-09 21:36:04 +02:00
" --dapps-pass=[PASSWORD] " ,
" Dapps server authentication has been removed. " ,
// ARG removed in 1.11.
ARG arg_ui_interface : ( Option < String > ) = None , or | _ | None ,
" --ui-interface=[IP] " ,
" Does nothing; UI is now a separate project. " ,
ARG arg_ui_hosts : ( Option < String > ) = None , or | _ | None ,
" --ui-hosts=[HOSTS] " ,
" Does nothing; UI is now a separate project. " ,
ARG arg_ui_port : ( Option < u16 > ) = None , or | _ | None ,
" --ui-port=[PORT] " ,
" Does nothing; UI is now a separate project. " ,
ARG arg_tx_queue_ban_count : ( Option < u16 > ) = None , or | c : & Config | c . mining . as_ref ( ) ? . tx_queue_ban_count . clone ( ) ,
2018-04-13 17:34:27 +02:00
" --tx-queue-ban-count=[C] " ,
" Not supported. " ,
2018-07-09 21:36:04 +02:00
ARG arg_tx_queue_ban_time : ( Option < u16 > ) = None , or | c : & Config | c . mining . as_ref ( ) ? . tx_queue_ban_time . clone ( ) ,
2018-04-13 17:34:27 +02:00
" --tx-queue-ban-time=[SEC] " ,
" Not supported. " ,
2018-07-11 12:19:54 +02:00
// ARG removed in 2.0.
ARG arg_dapps_path : ( Option < String > ) = None , or | c : & Config | c . dapps . as_ref ( ) ? . _legacy_path . clone ( ) ,
" --dapps-path=[PATH] " ,
" Specify directory where dapps should be installed. " ,
2018-07-18 16:27:29 +02:00
ARG arg_ntp_servers : ( Option < String > ) = None , or | _ | None ,
" --ntp-servers=[HOSTS] " ,
" Does nothing; checking if clock is sync with NTP servers is now done on the UI. " ,
2017-01-18 18:45:30 +01:00
}
2016-09-10 11:37:14 +02:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2017-07-06 14:10:41 +02:00
#[ serde(deny_unknown_fields) ]
2016-09-10 11:37:14 +02:00
struct Config {
2016-09-11 11:52:12 +02:00
parity : Option < Operating > ,
account : Option < Account > ,
2016-11-07 17:40:53 +01:00
ui : Option < Ui > ,
2016-09-11 11:52:12 +02:00
network : Option < Network > ,
rpc : Option < Rpc > ,
2017-04-13 16:32:07 +02:00
websockets : Option < Ws > ,
2016-09-11 11:52:12 +02:00
ipc : Option < Ipc > ,
dapps : Option < Dapps > ,
2017-02-20 16:13:21 +01:00
secretstore : Option < SecretStore > ,
2018-04-09 16:14:33 +02:00
private_tx : Option < PrivateTransactions > ,
2017-02-15 20:29:29 +01:00
ipfs : Option < Ipfs > ,
2016-09-11 11:52:12 +02:00
mining : Option < Mining > ,
footprint : Option < Footprint > ,
snapshots : Option < Snapshots > ,
misc : Option < Misc > ,
2017-01-25 11:03:36 +01:00
stratum : Option < Stratum > ,
2017-07-14 20:40:28 +02:00
whisper : Option < Whisper > ,
2018-09-12 11:47:01 +02:00
light : Option < Light > ,
2016-09-10 11:37:14 +02:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2016-09-10 11:37:14 +02:00
struct Operating {
mode : Option < String > ,
mode_timeout : Option < u64 > ,
mode_alarm : Option < u64 > ,
2016-11-23 20:35:21 +01:00
auto_update : Option < String > ,
2018-04-03 16:49:23 +02:00
auto_update_delay : Option < u16 > ,
auto_update_check_frequency : Option < u16 > ,
2016-12-15 19:23:25 +01:00
release_track : Option < String > ,
2016-11-23 20:35:21 +01:00
no_download : Option < bool > ,
no_consensus : Option < bool > ,
2016-09-10 11:37:14 +02:00
chain : Option < String > ,
2016-12-15 21:56:45 +01:00
base_path : Option < String > ,
2016-09-10 11:37:14 +02:00
db_path : Option < String > ,
keys_path : Option < String > ,
identity : Option < String > ,
2017-03-22 16:45:50 +01:00
light : Option < bool > ,
2017-05-04 12:13:50 +02:00
no_persistent_txqueue : Option < bool > ,
2018-03-27 13:56:59 +02:00
no_hardcoded_sync : Option < bool > ,
2018-06-01 16:49:55 +02:00
2018-10-29 16:49:04 +01:00
#[ serde(rename = " public_node " ) ]
2018-06-01 16:49:55 +02:00
_legacy_public_node : Option < bool > ,
2016-09-10 11:37:14 +02:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2016-09-10 11:37:14 +02:00
struct Account {
unlock : Option < Vec < String > > ,
password : Option < Vec < String > > ,
keys_iterations : Option < u32 > ,
2017-12-22 04:33:49 +01:00
refresh_time : Option < u64 > ,
2017-06-06 18:06:40 +02:00
fast_unlock : Option < bool > ,
2016-09-10 11:37:14 +02:00
}
2018-04-09 16:14:33 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
#[ serde(deny_unknown_fields) ]
struct PrivateTransactions {
enabled : Option < bool > ,
signer : Option < String > ,
validators : Option < Vec < String > > ,
account : Option < String > ,
passwords : Option < String > ,
sstore_url : Option < String > ,
sstore_threshold : Option < u32 > ,
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2016-11-07 17:40:53 +01:00
struct Ui {
2016-09-10 11:37:14 +02:00
path : Option < String > ,
2018-06-06 10:05:52 +02:00
2018-10-29 16:49:04 +01:00
#[ serde(rename = " force " ) ]
2018-06-06 10:05:52 +02:00
_legacy_force : Option < bool > ,
2018-10-29 16:49:04 +01:00
#[ serde(rename = " disable " ) ]
2018-06-06 10:05:52 +02:00
_legacy_disable : Option < bool > ,
2018-10-29 16:49:04 +01:00
#[ serde(rename = " port " ) ]
2018-06-06 10:05:52 +02:00
_legacy_port : Option < u16 > ,
2018-10-29 16:49:04 +01:00
#[ serde(rename = " interface " ) ]
2018-06-06 10:05:52 +02:00
_legacy_interface : Option < String > ,
2018-10-29 16:49:04 +01:00
#[ serde(rename = " hosts " ) ]
2018-06-06 10:05:52 +02:00
_legacy_hosts : Option < Vec < String > > ,
2016-09-10 11:37:14 +02:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2016-09-10 11:37:14 +02:00
struct Network {
2016-10-18 18:16:00 +02:00
warp : Option < bool > ,
2018-03-29 11:20:27 +02:00
warp_barrier : Option < u64 > ,
2016-09-10 11:37:14 +02:00
port : Option < u16 > ,
2018-05-31 13:36:47 +02:00
interface : Option < String > ,
2016-09-10 11:37:14 +02:00
min_peers : Option < u16 > ,
max_peers : Option < u16 > ,
2016-10-24 18:25:27 +02:00
snapshot_peers : Option < u16 > ,
max_pending_peers : Option < u16 > ,
2016-09-10 11:37:14 +02:00
nat : Option < String > ,
2016-10-24 18:25:27 +02:00
allow_ips : Option < String > ,
2016-12-05 15:54:31 +01:00
id : Option < u64 > ,
2016-09-10 11:37:14 +02:00
bootnodes : Option < Vec < String > > ,
discovery : Option < bool > ,
node_key : Option < String > ,
reserved_peers : Option < String > ,
reserved_only : Option < bool > ,
2017-03-22 16:45:50 +01:00
no_serve_light : Option < bool > ,
2016-09-10 11:37:14 +02:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2016-09-10 11:37:14 +02:00
struct Rpc {
disable : Option < bool > ,
port : Option < u16 > ,
interface : Option < String > ,
2017-12-27 18:56:06 +01:00
cors : Option < Vec < String > > ,
2016-09-10 11:37:14 +02:00
apis : Option < Vec < String > > ,
hosts : Option < Vec < String > > ,
2017-07-11 12:22:19 +02:00
server_threads : Option < usize > ,
processing_threads : Option < usize > ,
2018-07-02 10:23:57 +02:00
max_payload : Option < usize > ,
2018-11-05 15:39:51 +01:00
keep_alive : Option < bool > ,
2018-11-16 14:00:34 +01:00
experimental_rpcs : Option < bool > ,
2018-11-16 12:39:29 +01:00
poll_lifetime : Option < u32 > ,
2018-11-26 19:58:27 +01:00
allow_missing_blocks : Option < bool > ,
2016-09-10 11:37:14 +02:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2017-04-13 16:32:07 +02:00
struct Ws {
disable : Option < bool > ,
port : Option < u16 > ,
interface : Option < String > ,
apis : Option < Vec < String > > ,
origins : Option < Vec < String > > ,
hosts : Option < Vec < String > > ,
2018-04-02 12:33:09 +02:00
max_connections : Option < usize > ,
2017-04-13 16:32:07 +02:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2016-09-10 11:37:14 +02:00
struct Ipc {
disable : Option < bool > ,
path : Option < String > ,
apis : Option < Vec < String > > ,
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2016-09-10 11:37:14 +02:00
struct Dapps {
2018-10-29 16:49:04 +01:00
#[ serde(rename = " disable " ) ]
2018-07-11 12:19:54 +02:00
_legacy_disable : Option < bool > ,
2018-10-29 16:49:04 +01:00
#[ serde(rename = " port " ) ]
2018-07-11 12:19:54 +02:00
_legacy_port : Option < u16 > ,
2018-10-29 16:49:04 +01:00
#[ serde(rename = " interface " ) ]
2018-07-11 12:19:54 +02:00
_legacy_interface : Option < String > ,
2018-10-29 16:49:04 +01:00
#[ serde(rename = " hosts " ) ]
2018-07-11 12:19:54 +02:00
_legacy_hosts : Option < Vec < String > > ,
2018-10-29 16:49:04 +01:00
#[ serde(rename = " cors " ) ]
2018-07-11 12:19:54 +02:00
_legacy_cors : Option < String > ,
2018-10-29 16:49:04 +01:00
#[ serde(rename = " path " ) ]
2018-07-11 12:19:54 +02:00
_legacy_path : Option < String > ,
2018-10-29 16:49:04 +01:00
#[ serde(rename = " user " ) ]
2018-07-11 12:19:54 +02:00
_legacy_user : Option < String > ,
2018-10-29 16:49:04 +01:00
#[ serde(rename = " pass " ) ]
2018-07-11 12:19:54 +02:00
_legacy_pass : Option < String > ,
2016-09-10 11:37:14 +02:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2017-02-20 16:13:21 +01:00
struct SecretStore {
disable : Option < bool > ,
2017-07-27 12:29:09 +02:00
disable_http : Option < bool > ,
2018-01-10 11:33:45 +01:00
disable_auto_migrate : Option < bool > ,
2018-06-14 09:01:52 +02:00
acl_contract : Option < String > ,
2017-11-24 10:33:33 +01:00
service_contract : Option < String > ,
2018-04-03 16:54:34 +02:00
service_contract_srv_gen : Option < String > ,
service_contract_srv_retr : Option < String > ,
service_contract_doc_store : Option < String > ,
service_contract_doc_sretr : Option < String > ,
2017-04-08 11:26:16 +02:00
self_secret : Option < String > ,
2017-10-02 15:27:31 +02:00
admin_public : Option < String > ,
2017-04-08 11:26:16 +02:00
nodes : Option < Vec < String > > ,
2018-06-14 09:01:52 +02:00
server_set_contract : Option < String > ,
2017-02-20 16:13:21 +01:00
interface : Option < String > ,
2017-04-08 11:26:16 +02:00
port : Option < u16 > ,
http_interface : Option < String > ,
http_port : Option < u16 > ,
2017-02-20 16:13:21 +01:00
path : Option < String > ,
2019-04-20 07:31:37 +02:00
cors : Option < Vec < String > >
2017-02-20 16:13:21 +01:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2017-02-15 20:29:29 +01:00
struct Ipfs {
2017-02-16 14:41:33 +01:00
enable : Option < bool > ,
2017-02-15 20:29:29 +01:00
port : Option < u16 > ,
2017-02-24 10:32:42 +01:00
interface : Option < String > ,
2017-12-27 18:56:06 +01:00
cors : Option < Vec < String > > ,
2017-02-24 10:32:42 +01:00
hosts : Option < Vec < String > > ,
2017-02-15 20:29:29 +01:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2016-09-10 11:37:14 +02:00
struct Mining {
author : Option < String > ,
2016-12-05 22:31:38 +01:00
engine_signer : Option < String > ,
2016-09-10 11:37:14 +02:00
force_sealing : Option < bool > ,
2017-07-10 13:36:42 +02:00
reseal_on_uncle : Option < bool > ,
2016-09-10 11:37:14 +02:00
reseal_on_txs : Option < String > ,
reseal_min_period : Option < u64 > ,
2017-03-15 14:04:42 +01:00
reseal_max_period : Option < u64 > ,
2016-09-10 11:37:14 +02:00
work_queue_size : Option < usize > ,
tx_gas_limit : Option < String > ,
2016-10-27 19:28:34 +02:00
tx_time_limit : Option < u64 > ,
2016-09-10 11:37:14 +02:00
relay_set : Option < String > ,
2017-07-14 04:40:47 +02:00
min_gas_price : Option < u64 > ,
2018-01-09 12:43:36 +01:00
gas_price_percentile : Option < usize > ,
2016-09-10 11:37:14 +02:00
usd_per_tx : Option < String > ,
usd_per_eth : Option < String > ,
price_update_period : Option < String > ,
gas_floor_target : Option < String > ,
gas_cap : Option < String > ,
extra_data : Option < String > ,
tx_queue_size : Option < usize > ,
2018-04-13 17:34:27 +02:00
tx_queue_per_sender : Option < usize > ,
2017-07-13 15:12:25 +02:00
tx_queue_mem_limit : Option < u32 > ,
2019-01-28 11:26:11 +01:00
tx_queue_locals : Option < HashSet < String > > ,
2016-10-15 14:46:33 +02:00
tx_queue_strategy : Option < String > ,
2016-10-27 19:28:34 +02:00
tx_queue_ban_count : Option < u16 > ,
tx_queue_ban_time : Option < u16 > ,
2018-06-18 15:32:18 +02:00
tx_queue_no_unfamiliar_locals : Option < bool > ,
2018-07-24 15:04:48 +02:00
tx_queue_no_early_reject : Option < bool > ,
2016-09-10 11:37:14 +02:00
remove_solved : Option < bool > ,
notify_work : Option < Vec < String > > ,
2017-01-22 16:15:22 +01:00
refuse_service_transactions : Option < bool > ,
2017-11-03 15:20:20 +01:00
infinite_pending_block : Option < bool > ,
2018-10-26 13:21:36 +02:00
max_round_blocks_to_import : Option < usize > ,
2016-09-10 11:37:14 +02:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2017-01-25 11:03:36 +01:00
struct Stratum {
2019-04-02 11:19:20 +02:00
disable : Option < bool > ,
2017-01-25 11:03:36 +01:00
interface : Option < String > ,
port : Option < u16 > ,
secret : Option < String > ,
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2016-09-10 11:37:14 +02:00
struct Footprint {
tracing : Option < String > ,
pruning : Option < String > ,
2016-10-14 14:44:56 +02:00
pruning_history : Option < u64 > ,
2017-01-20 13:25:53 +01:00
pruning_memory : Option < usize > ,
2016-09-10 11:37:14 +02:00
fast_and_loose : Option < bool > ,
cache_size : Option < u32 > ,
cache_size_db : Option < u32 > ,
cache_size_blocks : Option < u32 > ,
cache_size_queue : Option < u32 > ,
2016-10-07 00:28:42 +02:00
cache_size_state : Option < u32 > ,
2016-09-10 11:37:14 +02:00
db_compaction : Option < String > ,
2016-10-03 11:13:10 +02:00
fat_db : Option < String > ,
2016-12-02 18:36:00 +01:00
scale_verifiers : Option < bool > ,
num_verifiers : Option < usize > ,
2016-09-10 11:37:14 +02:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2016-09-10 11:37:14 +02:00
struct Snapshots {
disable_periodic : Option < bool > ,
2018-09-13 12:58:49 +02:00
processing_threads : Option < usize > ,
2016-09-10 11:37:14 +02:00
}
2017-07-06 11:36:15 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2016-09-10 11:37:14 +02:00
struct Misc {
logging : Option < String > ,
log_file : Option < String > ,
2016-09-11 11:52:12 +02:00
color : Option < bool > ,
2017-05-23 12:24:32 +02:00
ports_shift : Option < u16 > ,
unsafe_expose : Option < bool > ,
2016-09-10 11:37:14 +02:00
}
2017-07-14 20:40:28 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
2018-01-03 10:51:39 +01:00
#[ serde(deny_unknown_fields) ]
2017-07-14 20:40:28 +02:00
struct Whisper {
enabled : Option < bool > ,
pool_size : Option < usize > ,
}
2018-09-12 11:47:01 +02:00
#[ derive(Default, Debug, PartialEq, Deserialize) ]
#[ serde(deny_unknown_fields) ]
struct Light {
2018-12-05 10:36:53 +01:00
on_demand_response_time_window : Option < u64 > ,
on_demand_request_backoff_start : Option < u64 > ,
on_demand_request_backoff_max : Option < u64 > ,
on_demand_request_backoff_rounds_max : Option < usize > ,
on_demand_request_consecutive_failures : Option < usize > ,
2018-09-12 11:47:01 +02:00
}
2016-09-10 11:37:14 +02:00
#[ cfg(test) ]
mod tests {
use super ::{
2016-09-11 11:52:12 +02:00
Args , ArgsError ,
2017-04-13 16:32:07 +02:00
Config , Operating , Account , Ui , Network , Ws , Rpc , Ipc , Dapps , Ipfs , Mining , Footprint ,
2018-09-12 11:47:01 +02:00
Snapshots , Misc , Whisper , SecretStore , Light ,
2016-09-10 11:37:14 +02:00
} ;
use toml ;
2017-10-11 17:38:56 +02:00
use clap ::{ ErrorKind as ClapErrorKind } ;
2016-09-10 11:37:14 +02:00
2017-11-08 12:33:56 +01:00
#[ test ]
fn should_accept_any_argument_order ( ) {
let args = Args ::parse ( & [ " parity " , " --no-warp " , " account " , " list " ] ) . unwrap ( ) ;
assert_eq! ( args . flag_no_warp , true ) ;
let args = Args ::parse ( & [ " parity " , " account " , " list " , " --no-warp " ] ) . unwrap ( ) ;
assert_eq! ( args . flag_no_warp , true ) ;
let args = Args ::parse ( & [ " parity " , " --chain=dev " , " account " , " list " ] ) . unwrap ( ) ;
assert_eq! ( args . arg_chain , " dev " ) ;
let args = Args ::parse ( & [ " parity " , " account " , " list " , " --chain=dev " ] ) . unwrap ( ) ;
assert_eq! ( args . arg_chain , " dev " ) ;
}
#[ test ]
fn should_not_crash_on_warp ( ) {
let args = Args ::parse ( & [ " parity " , " --warp " ] ) ;
assert! ( args . is_ok ( ) ) ;
let args = Args ::parse ( & [ " parity " , " account " , " list " , " --warp " ] ) ;
assert! ( args . is_ok ( ) ) ;
}
2017-10-13 12:20:57 +02:00
#[ test ]
fn should_reject_invalid_values ( ) {
let args = Args ::parse ( & [ " parity " , " --cache=20 " ] ) ;
assert! ( args . is_ok ( ) ) ;
let args = Args ::parse ( & [ " parity " , " --cache=asd " ] ) ;
assert! ( args . is_err ( ) ) ;
}
2017-09-05 13:30:22 +02:00
#[ test ]
fn should_parse_args_and_flags ( ) {
let args = Args ::parse ( & [ " parity " , " --no-warp " ] ) . unwrap ( ) ;
assert_eq! ( args . flag_no_warp , true ) ;
let args = Args ::parse ( & [ " parity " , " --pruning " , " archive " ] ) . unwrap ( ) ;
assert_eq! ( args . arg_pruning , " archive " ) ;
let args = Args ::parse ( & [ " parity " , " export " , " state " , " --no-storage " ] ) . unwrap ( ) ;
assert_eq! ( args . flag_export_state_no_storage , true ) ;
let args = Args ::parse ( & [ " parity " , " export " , " state " , " --min-balance " , " 123 " ] ) . unwrap ( ) ;
assert_eq! ( args . arg_export_state_min_balance , Some ( " 123 " . to_string ( ) ) ) ;
}
2017-10-11 17:38:56 +02:00
#[ test ]
fn should_exit_gracefully_on_unknown_argument ( ) {
let result = Args ::parse ( & [ " parity " , " --please-exit-gracefully " ] ) ;
assert! (
match result {
Err ( ArgsError ::Clap ( ref clap_error ) ) if clap_error . kind = = ClapErrorKind ::UnknownArgument = > true ,
_ = > false
}
) ;
}
2017-09-05 13:30:22 +02:00
#[ test ]
fn should_use_subcommand_arg_default ( ) {
let args = Args ::parse ( & [ " parity " , " export " , " state " , " --at " , " 123 " ] ) . unwrap ( ) ;
assert_eq! ( args . arg_export_state_at , " 123 " ) ;
assert_eq! ( args . arg_snapshot_at , " latest " ) ;
let args = Args ::parse ( & [ " parity " , " snapshot " , " --at " , " 123 " , " file.dump " ] ) . unwrap ( ) ;
assert_eq! ( args . arg_snapshot_at , " 123 " ) ;
assert_eq! ( args . arg_export_state_at , " latest " ) ;
let args = Args ::parse ( & [ " parity " , " export " , " state " ] ) . unwrap ( ) ;
assert_eq! ( args . arg_snapshot_at , " latest " ) ;
assert_eq! ( args . arg_export_state_at , " latest " ) ;
let args = Args ::parse ( & [ " parity " , " snapshot " , " file.dump " ] ) . unwrap ( ) ;
assert_eq! ( args . arg_snapshot_at , " latest " ) ;
assert_eq! ( args . arg_export_state_at , " latest " ) ;
}
#[ test ]
fn should_parse_multiple_values ( ) {
let args = Args ::parse ( & [ " parity " , " account " , " import " , " ~/1 " , " ~/2 " ] ) . unwrap ( ) ;
assert_eq! ( args . arg_account_import_path , Some ( vec! [ " ~/1 " . to_owned ( ) , " ~/2 " . to_owned ( ) ] ) ) ;
let args = Args ::parse ( & [ " parity " , " account " , " import " , " ~/1,ext " ] ) . unwrap ( ) ;
assert_eq! ( args . arg_account_import_path , Some ( vec! [ " ~/1,ext " . to_owned ( ) ] ) ) ;
let args = Args ::parse ( & [ " parity " , " --secretstore-nodes " , " abc@127.0.0.1:3333,cde@10.10.10.10:4444 " ] ) . unwrap ( ) ;
assert_eq! ( args . arg_secretstore_nodes , " abc@127.0.0.1:3333,cde@10.10.10.10:4444 " ) ;
2018-06-06 10:05:52 +02:00
let args = Args ::parse ( & [ " parity " , " --password " , " ~/.safe/1 " , " --password " , " ~/.safe/2 " , " --ui-port " , " 8123 " ] ) . unwrap ( ) ;
2018-01-31 09:50:52 +01:00
assert_eq! ( args . arg_password , vec! [ " ~/.safe/1 " . to_owned ( ) , " ~/.safe/2 " . to_owned ( ) ] ) ;
2018-07-09 21:36:04 +02:00
assert_eq! ( args . arg_ui_port , Some ( 8123 ) ) ;
2017-09-05 13:30:22 +02:00
2018-06-06 10:05:52 +02:00
let args = Args ::parse ( & [ " parity " , " --password " , " ~/.safe/1,~/.safe/2 " , " --ui-port " , " 8123 " ] ) . unwrap ( ) ;
2017-09-05 13:30:22 +02:00
assert_eq! ( args . arg_password , vec! [ " ~/.safe/1 " . to_owned ( ) , " ~/.safe/2 " . to_owned ( ) ] ) ;
2018-07-09 21:36:04 +02:00
assert_eq! ( args . arg_ui_port , Some ( 8123 ) ) ;
2017-09-05 13:30:22 +02:00
}
#[ test ]
fn should_parse_global_args_with_subcommand ( ) {
let args = Args ::parse ( & [ " parity " , " --chain " , " dev " , " account " , " list " ] ) . unwrap ( ) ;
assert_eq! ( args . arg_chain , " dev " . to_owned ( ) ) ;
}
2016-09-10 11:37:14 +02:00
#[ test ]
fn should_parse_args_and_include_config ( ) {
// given
let mut config = Config ::default ( ) ;
let mut operating = Operating ::default ( ) ;
operating . chain = Some ( " morden " . into ( ) ) ;
2016-09-11 11:52:12 +02:00
config . parity = Some ( operating ) ;
2016-09-10 11:37:14 +02:00
// when
let args = Args ::parse_with_config ( & [ " parity " ] , config ) . unwrap ( ) ;
// then
2017-09-05 13:30:22 +02:00
assert_eq! ( args . arg_chain , " morden " . to_owned ( ) ) ;
2016-09-10 11:37:14 +02:00
}
#[ test ]
fn should_not_use_config_if_cli_is_provided ( ) {
// given
let mut config = Config ::default ( ) ;
let mut operating = Operating ::default ( ) ;
operating . chain = Some ( " morden " . into ( ) ) ;
2016-09-11 11:52:12 +02:00
config . parity = Some ( operating ) ;
2016-09-10 11:37:14 +02:00
// when
let args = Args ::parse_with_config ( & [ " parity " , " --chain " , " xyz " ] , config ) . unwrap ( ) ;
// then
2017-09-05 13:30:22 +02:00
assert_eq! ( args . arg_chain , " xyz " . to_owned ( ) ) ;
2016-09-10 11:37:14 +02:00
}
2016-10-27 16:56:18 +02:00
#[ test ]
fn should_use_config_if_cli_is_missing ( ) {
let mut config = Config ::default ( ) ;
let mut footprint = Footprint ::default ( ) ;
footprint . pruning_history = Some ( 128 ) ;
config . footprint = Some ( footprint ) ;
// when
let args = Args ::parse_with_config ( & [ " parity " ] , config ) . unwrap ( ) ;
// then
2017-09-05 13:30:22 +02:00
assert_eq! ( args . arg_pruning_history , 128 ) ;
2016-10-27 16:56:18 +02:00
}
2019-04-02 11:19:20 +02:00
#[ test ]
fn should_disable_stratum ( ) {
// given
let config = toml ::from_str ( include_str! ( " ./tests/config.stratum_disabled.toml " ) ) . unwrap ( ) ;
// when
let args = Args ::parse_with_config ( & [ " parity " ] , config ) . unwrap ( ) ;
// then
assert_eq! ( args . flag_stratum , false ) ;
assert_eq! ( args . arg_stratum_interface , " local " . to_owned ( ) ) ;
assert_eq! ( args . arg_stratum_port , 8008 u16 ) ;
assert_eq! ( args . arg_stratum_secret , None ) ;
}
#[ test ]
fn should_disable_stratum_when_missing_section ( ) {
// given
let config = toml ::from_str ( include_str! ( " ./tests/config.stratum_missing_section.toml " ) ) . unwrap ( ) ;
// when
let args = Args ::parse_with_config ( & [ " parity " ] , config ) . unwrap ( ) ;
// then
assert_eq! ( args . flag_stratum , false ) ;
assert_eq! ( args . arg_stratum_interface , " local " . to_owned ( ) ) ;
assert_eq! ( args . arg_stratum_port , 8008 u16 ) ;
assert_eq! ( args . arg_stratum_secret , None ) ;
}
#[ test ]
fn should_enable_stratum ( ) {
// given
let config = toml ::from_str ( include_str! ( " ./tests/config.stratum_enabled.toml " ) ) . unwrap ( ) ;
// when
let args = Args ::parse_with_config ( & [ " parity " ] , config ) . unwrap ( ) ;
// then (with custom configurations)
assert_eq! ( args . flag_stratum , true ) ;
assert_eq! ( args . arg_stratum_interface , " some_interface " . to_owned ( ) ) ;
assert_eq! ( args . arg_stratum_port , 8007 u16 ) ;
assert_eq! ( args . arg_stratum_secret , Some ( " Yellow " . to_owned ( ) ) ) ;
}
#[ test ]
fn should_enable_stratum_by_param ( ) {
// given
let config = toml ::from_str ( include_str! ( " ./tests/config.full.toml " ) ) . unwrap ( ) ;
// when
let args = Args ::parse_with_config ( & [ " parity " , " --stratum " ] , config ) . unwrap ( ) ;
// then
assert_eq! ( args . flag_stratum , true ) ;
assert_eq! ( args . arg_stratum_interface , " local " . to_owned ( ) ) ;
assert_eq! ( args . arg_stratum_port , 8008 u16 ) ;
assert_eq! ( args . arg_stratum_secret , None ) ;
}
#[ test ]
// For backward compatibility; Stratum should be enabled if the config file
// contains a `[stratum]` section and it is not explicitly disabled (disable = true)
fn should_enable_stratum_when_missing_field ( ) {
// given
let config = toml ::from_str ( include_str! ( " ./tests/config.stratum_missing_field.toml " ) ) . unwrap ( ) ;
// when
let args = Args ::parse_with_config ( & [ " parity " ] , config ) . unwrap ( ) ;
// then
assert_eq! ( args . flag_stratum , true ) ;
assert_eq! ( args . arg_stratum_interface , " local " . to_owned ( ) ) ;
assert_eq! ( args . arg_stratum_port , 8008 u16 ) ;
assert_eq! ( args . arg_stratum_secret , None ) ;
}
2016-09-10 11:37:14 +02:00
#[ test ]
fn should_parse_full_config ( ) {
// given
2017-09-05 13:30:22 +02:00
let config = toml ::from_str ( include_str! ( " ./tests/config.full.toml " ) ) . unwrap ( ) ;
2016-09-10 11:37:14 +02:00
// when
let args = Args ::parse_with_config ( & [ " parity " , " --chain " , " xyz " ] , config ) . unwrap ( ) ;
// then
assert_eq! ( args , Args {
// Commands
2017-09-05 13:30:22 +02:00
cmd_dapp : false ,
2016-09-10 11:37:14 +02:00
cmd_daemon : false ,
cmd_account : false ,
2017-09-05 13:30:22 +02:00
cmd_account_new : false ,
cmd_account_list : false ,
cmd_account_import : false ,
cmd_wallet : false ,
cmd_wallet_import : false ,
2016-09-10 11:37:14 +02:00
cmd_import : false ,
2017-09-05 13:30:22 +02:00
cmd_export : false ,
cmd_export_blocks : false ,
cmd_export_state : false ,
2016-09-10 11:37:14 +02:00
cmd_signer : false ,
2017-09-05 13:30:22 +02:00
cmd_signer_list : false ,
cmd_signer_sign : false ,
cmd_signer_reject : false ,
cmd_signer_new_token : false ,
2016-09-10 11:37:14 +02:00
cmd_snapshot : false ,
cmd_restore : false ,
2016-09-23 15:28:09 +02:00
cmd_tools : false ,
2017-09-05 13:30:22 +02:00
cmd_tools_hash : false ,
2016-12-12 17:19:41 +01:00
cmd_db : false ,
2017-09-05 13:30:22 +02:00
cmd_db_kill : false ,
2019-01-16 16:37:26 +01:00
cmd_db_reset : false ,
2018-03-27 13:56:59 +02:00
cmd_export_hardcoded_sync : false ,
2016-09-10 11:37:14 +02:00
// Arguments
2017-09-05 13:30:22 +02:00
arg_daemon_pid_file : None ,
arg_import_file : None ,
arg_import_format : None ,
arg_export_blocks_file : None ,
arg_export_blocks_format : None ,
arg_export_state_file : None ,
arg_export_state_format : None ,
arg_snapshot_file : None ,
arg_restore_file : None ,
arg_tools_hash_file : None ,
arg_signer_sign_id : None ,
arg_signer_reject_id : None ,
arg_dapp_path : None ,
arg_account_import_path : None ,
arg_wallet_import_path : None ,
2019-01-16 16:37:26 +01:00
arg_db_reset_num : 10 ,
2016-09-10 11:37:14 +02:00
// -- Operating Options
2017-09-05 13:30:22 +02:00
arg_mode : " last " . into ( ) ,
arg_mode_timeout : 300 u64 ,
arg_mode_alarm : 3600 u64 ,
arg_auto_update : " none " . into ( ) ,
2018-04-03 16:49:23 +02:00
arg_auto_update_delay : 200 u16 ,
arg_auto_update_check_frequency : 50 u16 ,
2017-09-05 13:30:22 +02:00
arg_release_track : " current " . into ( ) ,
2017-03-29 17:07:58 +02:00
flag_public_node : false ,
2016-11-23 20:35:21 +01:00
flag_no_download : false ,
flag_no_consensus : false ,
2017-09-05 13:30:22 +02:00
arg_chain : " xyz " . into ( ) ,
arg_base_path : Some ( " $HOME/.parity " . into ( ) ) ,
arg_db_path : Some ( " $HOME/.parity/chains " . into ( ) ) ,
arg_keys_path : " $HOME/.parity/keys " . into ( ) ,
arg_identity : " " . into ( ) ,
2017-03-22 16:45:50 +01:00
flag_light : false ,
2018-03-27 13:56:59 +02:00
flag_no_hardcoded_sync : false ,
2017-05-04 12:13:50 +02:00
flag_no_persistent_txqueue : false ,
2017-09-05 13:30:22 +02:00
flag_force_direct : false ,
2016-09-10 11:37:14 +02:00
2017-05-23 12:24:32 +02:00
// -- Convenience Options
2017-09-05 13:30:22 +02:00
arg_config : " $BASE/config.toml " . into ( ) ,
arg_ports_shift : 0 ,
2017-05-23 12:24:32 +02:00
flag_unsafe_expose : false ,
2016-09-10 11:37:14 +02:00
// -- Account Options
2017-09-05 13:30:22 +02:00
arg_unlock : Some ( " 0xdeadbeefcafe0000000000000000000000000000 " . into ( ) ) ,
arg_password : vec ! [ " ~/.safe/password.file " . into ( ) ] ,
arg_keys_iterations : 10240 u32 ,
2017-12-22 04:33:49 +01:00
arg_accounts_refresh : 5 u64 ,
2017-06-08 09:20:50 +02:00
flag_fast_unlock : false ,
2016-09-10 11:37:14 +02:00
2018-04-09 16:14:33 +02:00
// -- Private Transactions Options
flag_private_enabled : true ,
arg_private_signer : Some ( " 0xdeadbeefcafe0000000000000000000000000000 " . into ( ) ) ,
arg_private_validators : Some ( " 0xdeadbeefcafe0000000000000000000000000000 " . into ( ) ) ,
arg_private_passwords : Some ( " ~/.safe/password.file " . into ( ) ) ,
arg_private_account : Some ( " 0xdeadbeefcafe0000000000000000000000000000 " . into ( ) ) ,
arg_private_sstore_url : Some ( " http://localhost:8082 " . into ( ) ) ,
arg_private_sstore_threshold : Some ( 0 ) ,
2016-11-07 17:40:53 +01:00
flag_force_ui : false ,
flag_no_ui : false ,
2018-07-09 21:36:04 +02:00
arg_ui_port : None ,
arg_ui_interface : None ,
arg_ui_hosts : None ,
2017-09-05 13:30:22 +02:00
arg_ui_path : " $HOME/.parity/signer " . into ( ) ,
2016-11-07 17:40:53 +01:00
flag_ui_no_validation : false ,
2016-09-10 11:37:14 +02:00
// -- Networking Options
2017-03-02 20:04:17 +01:00
flag_no_warp : false ,
2017-09-05 13:30:22 +02:00
arg_port : 30303 u16 ,
2018-05-31 13:36:47 +02:00
arg_interface : " all " . into ( ) ,
2018-04-03 16:51:57 +02:00
arg_min_peers : Some ( 25 u16 ) ,
arg_max_peers : Some ( 50 u16 ) ,
2017-09-05 13:30:22 +02:00
arg_max_pending_peers : 64 u16 ,
arg_snapshot_peers : 0 u16 ,
arg_allow_ips : " all " . into ( ) ,
arg_nat : " any " . into ( ) ,
arg_network_id : Some ( 1 ) ,
arg_bootnodes : Some ( " " . into ( ) ) ,
2016-09-10 11:37:14 +02:00
flag_no_discovery : false ,
2017-09-05 13:30:22 +02:00
arg_node_key : None ,
arg_reserved_peers : Some ( " ./path_to_file " . into ( ) ) ,
2016-09-10 11:37:14 +02:00
flag_reserved_only : false ,
2016-11-22 18:03:35 +01:00
flag_no_ancient_blocks : false ,
2017-03-22 16:45:50 +01:00
flag_no_serve_light : false ,
2016-09-10 11:37:14 +02:00
// -- API and Console Options
// RPC
flag_no_jsonrpc : false ,
2018-11-05 15:39:51 +01:00
flag_jsonrpc_no_keep_alive : false ,
2018-11-16 14:00:34 +01:00
flag_jsonrpc_experimental : false ,
2017-09-05 13:30:22 +02:00
arg_jsonrpc_port : 8545 u16 ,
arg_jsonrpc_interface : " local " . into ( ) ,
2017-12-27 18:56:06 +01:00
arg_jsonrpc_cors : " null " . into ( ) ,
2017-09-05 13:30:22 +02:00
arg_jsonrpc_apis : " web3,eth,net,parity,traces,rpc,secretstore " . into ( ) ,
arg_jsonrpc_hosts : " none " . into ( ) ,
arg_jsonrpc_server_threads : None ,
2017-11-01 11:23:18 +01:00
arg_jsonrpc_threads : 4 ,
2018-07-02 10:23:57 +02:00
arg_jsonrpc_max_payload : None ,
2018-11-16 12:39:29 +01:00
arg_poll_lifetime : 60 u32 ,
2018-11-26 19:58:27 +01:00
flag_jsonrpc_allow_missing_blocks : false ,
2016-09-10 11:37:14 +02:00
2017-04-13 16:32:07 +02:00
// WS
flag_no_ws : false ,
2017-09-05 13:30:22 +02:00
arg_ws_port : 8546 u16 ,
arg_ws_interface : " local " . into ( ) ,
arg_ws_apis : " web3,eth,net,parity,traces,rpc,secretstore " . into ( ) ,
arg_ws_origins : " none " . into ( ) ,
arg_ws_hosts : " none " . into ( ) ,
2018-04-02 12:33:09 +02:00
arg_ws_max_connections : 100 ,
2017-04-13 16:32:07 +02:00
2016-09-10 11:37:14 +02:00
// IPC
flag_no_ipc : false ,
2017-09-05 13:30:22 +02:00
arg_ipc_path : " $HOME/.parity/jsonrpc.ipc " . into ( ) ,
arg_ipc_apis : " web3,eth,net,parity,parity_accounts,personal,traces,rpc,secretstore " . into ( ) ,
2016-09-10 11:37:14 +02:00
// DAPPS
2018-07-11 12:19:54 +02:00
arg_dapps_path : Some ( " $HOME/.parity/dapps " . into ( ) ) ,
2017-04-03 10:27:37 +02:00
flag_no_dapps : false ,
2016-09-10 11:37:14 +02:00
2018-01-10 11:33:45 +01:00
// SECRETSTORE
2017-02-20 16:13:21 +01:00
flag_no_secretstore : false ,
2017-07-27 12:29:09 +02:00
flag_no_secretstore_http : false ,
2018-01-10 11:33:45 +01:00
flag_no_secretstore_auto_migrate : false ,
2018-06-14 09:01:52 +02:00
arg_secretstore_acl_contract : Some ( " registry " . into ( ) ) ,
arg_secretstore_contract : Some ( " none " . into ( ) ) ,
arg_secretstore_srv_gen_contract : Some ( " none " . into ( ) ) ,
arg_secretstore_srv_retr_contract : Some ( " none " . into ( ) ) ,
arg_secretstore_doc_store_contract : Some ( " none " . into ( ) ) ,
arg_secretstore_doc_sretr_contract : Some ( " none " . into ( ) ) ,
2017-09-05 13:30:22 +02:00
arg_secretstore_secret : None ,
2017-10-02 15:27:31 +02:00
arg_secretstore_admin_public : None ,
2017-09-05 13:30:22 +02:00
arg_secretstore_nodes : " " . into ( ) ,
2018-06-14 09:01:52 +02:00
arg_secretstore_server_set_contract : Some ( " registry " . into ( ) ) ,
2017-09-05 13:30:22 +02:00
arg_secretstore_interface : " local " . into ( ) ,
arg_secretstore_port : 8083 u16 ,
arg_secretstore_http_interface : " local " . into ( ) ,
arg_secretstore_http_port : 8082 u16 ,
arg_secretstore_path : " $HOME/.parity/secretstore " . into ( ) ,
2019-04-20 07:31:37 +02:00
arg_secretstore_http_cors : " null " . into ( ) ,
2017-02-20 16:13:21 +01:00
2017-02-15 20:29:29 +01:00
// IPFS
2017-02-16 14:41:33 +01:00
flag_ipfs_api : false ,
2017-09-05 13:30:22 +02:00
arg_ipfs_api_port : 5001 u16 ,
arg_ipfs_api_interface : " local " . into ( ) ,
2017-12-27 18:56:06 +01:00
arg_ipfs_api_cors : " null " . into ( ) ,
2017-09-05 13:30:22 +02:00
arg_ipfs_api_hosts : " none " . into ( ) ,
2017-02-15 20:29:29 +01:00
2016-09-10 11:37:14 +02:00
// -- Sealing/Mining Options
2017-09-05 13:30:22 +02:00
arg_author : Some ( " 0xdeadbeefcafe0000000000000000000000000001 " . into ( ) ) ,
arg_engine_signer : Some ( " 0xdeadbeefcafe0000000000000000000000000001 " . into ( ) ) ,
2016-09-11 11:52:12 +02:00
flag_force_sealing : true ,
2017-09-05 13:30:22 +02:00
arg_reseal_on_txs : " all " . into ( ) ,
arg_reseal_min_period : 4000 u64 ,
arg_reseal_max_period : 60000 u64 ,
2017-07-10 13:36:42 +02:00
flag_reseal_on_uncle : false ,
2017-09-05 13:30:22 +02:00
arg_work_queue_size : 20 usize ,
2018-09-17 08:33:00 +02:00
arg_tx_gas_limit : Some ( " 10000000 " . into ( ) ) ,
2017-09-05 13:30:22 +02:00
arg_tx_time_limit : Some ( 100 u64 ) ,
arg_relay_set : " cheap " . into ( ) ,
arg_min_gas_price : Some ( 0 u64 ) ,
Reduce usd_per_tx (#7058)
* Update config.full.toml
* Update mod.rs
* Patch 1 (#1)
* Iterate over both buffered and unbuffered database entries
* Fix iterator issues
* no default uncles
* prepare cargo configuration for upload of crates
* update bigint version number
* update ethcore-bigint version
* rename hash crate to keccak-hash
* update memorydb
* update rlp
* update patricia-trie cargo.toml
* use error-chain in ethcore-network
* interleaved-ordered 0.1.1
* static linking for snappy
* removed redundant imports
* Add the desktop file for the snap
Now that we have added plugs to allow accessing the display, the snap needs
a desktop file. And bonus point, it will appear on the menu when it's
installed, and once you make a stable relase, it will appear in the gnome
software center app! So, one-click install for parity :)
Closes: #7056
* update icon for desktop
* Properly display Signer errors (Snackbar display popup) (#7053)
* Update to fixed @parity/ui (Errors component)
* Update ParityBar radius to align with Snackbar/Errors
* Update to latest @parity/ui
* Update dependencies @parity/signer-plugin-*
* Really pull in @parity/signer-plugin-* deps
* CHANGELOG for 1.7.8, 1.7.9, 1.8.2, and 1.8.3 (#7055)
* Update changelog for 1.7.8 stable
* Update changelog for 1.7.9 stable
* Improve wording in Changelog
* Update changelog for 1.8.2 beta
* Update changelog for 1.8.3 beta
* [ci skip] js-precompiled 20171115-103846
* ECIP-1039: Monetary policy rounding specification
Fix potential rounding errors between geth and parity in the long-term future.
* Change reward calculation to only use divide once
* SecretStore: servers set change session api (#6925)
* SecretStore: first key versions flush
* SecretStore: key versions in encryption session
* SecretStore: flush key versions negotiation session
* SecretStore: connected key version negotiation session to cluster
* SecretStore: cluster sessions container refactoring
* SecretStore: flush
* SecretStore: flush key versions
* SecretStore: flush
* SecretStore: delegation proto
* SecretStore: decryption_session_is_delegated_when_node_does_not_have_key_share
* SecretStore: fixed version in decryption session
* SecretStore: signing_session_is_delegated_when_node_does_not_have_key_share
* SecretStore: started restoring admin sessions
* SecretStore: restoring admin sessions
* SecretStore: removed obsolete ShareRemove && ShareMove sessions
* SecretStore: ShareAdd math tests only require old_t+1 nodes
* SecretStore: ShareAdd revamp using new math backend
* SecretStore: do not include isolated nodes into consensus_group
* SecretStore: ServersSetChange + ShareAdd revamp
* removed debug printlns
* SecretStore: key version negotiation tests
* SecretStore: removed debug/merge artifacts
* SecretStore: fixed master node selection
* SecretStore: cleanup + tests + fixes
* SecretStore: uncommented tests
* SecretStore: cleaning up
* SecretStore: cleaning up + tests
* SecretStore: cleaning up
* SecretStore: cleaning up && tests
* SecretStore: fixing TODOs
* SecretStore: fixing TODOs + cleanup
* SecretStore: fixing TODOs
* SecretStore: nodes_add_to_the_node_with_obsolete_version
* SecretStore: nodes_add_fails_when_not_enough_share_owners_are_connected
* SecretStore: tests
* SecretStore: signing && delegation tests
* SecretStore: signing && decryption tests when some nodes are isolated
* SecretStore: sessions_are_removed_when_initialization_fails
* SecretStore: ceaning up
* SecretStore: removed obsolete comments
* SecretStore: signing_session_completes_if_node_does_not_have_a_share
* SecretStore: initial ServersSetChange API
* SecretStore: added secretstore_signServersSet RPC
* SecretStore: ChangeServersSet parse tests
* SecretStore: fixes after manual ServersSetChange tests
* lost file
* fixed network ports overlap in tests
* lost files
* fix tests on patricia-trie
* updated eth-secp256k1
* Fix no-default-features.
* Parse payload from panic
Impl payload
empty str is none
Update tests
Clean
Update wasm-tests
* Allow localUrl in manifest
* Improve Github Issue Template: IT CROWD approved version.
* Remove seperator that causes issue descriptions to become headlines sometimes
* Add to all icon_url places
* Add appId as needed to local dapps
* localUrl only from manifest
* Update panic_payload.rs
* Use query-string for search parsing
* spaces to tabs.
* Add localUrl to serialization
* Make storage_read/write return nothing
* Update gas values
* Update wasm-tests
* Cleanup debug info
* Remove debug log
* Optimize & group dapp requests (#7083)
* Group similar methods in same grouping
* Add a shell_getMethodGroups API
* Small code clean changes
* Fix bug dapp.name not showing
* Additional error handling
* Store sources in own map
* Remove observable variables where not needed
* Refactor code and fix bug dapp not showing on approve
* [ci skip] js-precompiled 20171121-150329
* Remove unused and duplicated files in js-old (#7082)
* Cleanup v1 build process, application-only
* Remove built-in dapps from build (duplicated)
* User @parity/api instead of local version
* Update references to @parity/abi
* Remove unused js-old api/abi folders
* Remove duplicated v1 jsonrpc
* Cleanup unused routes
* Update manifest with wallet image
* Update wallet logo
* Re-add missing test.sh
* Update rpc mocks
* Update tests for Providers
* Use flex for iframe & status
* Additional cleanups (Home screen for embed)
* Keep statusbar fixed (and non-overallping with dapps)
* [ci skip] js-precompiled 20171121-164807
* Cleanup top bar, add Home icon for navigation (#7118)
* Localise images to config.js file
* Remove sample status plugin (commented)
* Update image references from config
* Remove Unknown capability & Capable (only display actions)
* Update to @parity/ui 2.2.14
* Add Home icon on statusbar (go back)
* 2.2.14 -> 2.2.x
* Builtin dapp icons where dappreg not available
* [ci skip] js-precompiled 20171122-140247
* fixed RotatingLogger after migrating to new arrayvec
* Update packages, pull in compiled-only repos (#7125)
* Update packages, pull in compiled-only repos
* Update js-precompiled to point to js-dist-paritytech
* Trigger both js & js-old builds to force update
* Update to bring scripts 100% in-sync
* Fixed build && test (#7128)
* fixed build && test
* fixed rpc tests
* Update js-precompiled ref, trigger JS build
* Add test for ECIP1017 at block 250000000
* Wrong era used in ECIP1017 test
It is era 49, and should correspond to ECIP1017/ECIP1039's era 50.
* [ci skip] js-precompiled 20171124-124119
* Push to correct shell branch (#7135)
* Push to correct shell branch
* Trigger both js & js-old builds
* [ci skip] js-precompiled 20171124-134823
* pwasm-run-test utility
* WASM Remove blockhash error (#7121)
* Remove blockhash error
* Update tests.
* Pull in new dapp-{methods,visible} dapps (#7150)
* [ci skip] js-precompiled 20171128-091552
* fixes typo in user config path (#7159)
* Cleanup JS build artifacts (#7164)
* Cleanup JS build artifacts
* Trigger js & js-old
* [ci skip] js-precompiled 20171129-135441
* Use git flag to remove old js artifacts (#7165)
* [ci skip] js-precompiled 20171129-144917
* Remove *.css.map & *.js.map (#7168)
* [ci skip] js-precompiled 20171129-172021
* Delete unused package.json (dist) (#7173)
* [ci skip] js-precompiled 20171130-103432
* Assorted improvements for ethstore and ethkey (#6961)
* Testing many passwords for presale wallet.
* Add multiple threads.
* WiP: ethkey brain wallets recover.
* Refactor pre-sale-wallet cracking.
* Generate in multiple threads. Brain with prefix.
* Validate bain wallet phrase.
* Brain wallet recovery.
* Self-review fixes.
* Fix tests.
* More docs.
* Bump versions.
* Remove cmd_find from borked merge.
* Update wasm submodules.
* Use threadpool.
* upper limit is gas limit * 10 in estimate gas
* React 16 (#7174)
* Update packages to use React 16
* Rollback to react-router v3
* Use component instead of pure one
* Remove warning about mobx
* Make webpack load css from @parity/ui
* Update enzyme to support react16
* Fix lint
* Use @parity/ui v3
* Update refs of plugin-signer-* deps
* Exclude plugin-signer-* from babel processing
* Reupdate refs to old method
* Update refs again
* [ci skip] js-precompiled 20171201-114538
* pwasm-run-test utility upgrade
* Removed ethcore-util dependency from ethcore-network (#7180)
* Removed ethcore-util dependency
* Removed snappy
* New account selector UI in top bar (#7179)
* Add a dropdown popup for account selector
* Install sui latest version for hideOnScroll bug fix
* Update ui
* Update package-lock after rebase
* Require parity/ui v3.0.3
* Pass accountStore as props
* Require parity/ui v3.0.4
* [ci skip] js-precompiled 20171204-115345
* Update mocha import stubs (#7191)
* Update mocha import stubs
* Add .md files to ignore list
* [ci skip] js-precompiled 20171205-084709
* Update FirstRun for UI-2 (#7195)
* WIP
* Update after @parity/ui update
* Update to latest
* Update semver for @parity
* Update & -> &
* [ci skip] js-precompiled 20171205-102703
* Maximum uncle count transition (#7196)
* Enable delayed maximum_uncle_count activation.
* Fix tests.
* Defer kovan HF.
* mistake comment in calc difficulty (#7154)
* Send each log as a separate notifications. (#7175)
* Update config.full.toml
* Revert "Patch 1 (#1)" (#2)
This reverts commit 2fa0af6392f75cf9f7dd5f8250906e3767da8a5b.
* Update usd_per_tx test
* Fix tests
* Fix initial_minimum
2018-01-30 16:10:12 +01:00
arg_usd_per_tx : " 0.0001 " . into ( ) ,
2018-01-09 12:43:36 +01:00
arg_gas_price_percentile : 50 usize ,
2017-09-05 13:30:22 +02:00
arg_usd_per_eth : " auto " . into ( ) ,
arg_price_update_period : " hourly " . into ( ) ,
2018-09-17 08:33:00 +02:00
arg_gas_floor_target : " 8000000 " . into ( ) ,
arg_gas_cap : " 10000000 " . into ( ) ,
2017-09-05 13:30:22 +02:00
arg_extra_data : Some ( " Parity " . into ( ) ) ,
2018-06-18 15:32:18 +02:00
flag_tx_queue_no_unfamiliar_locals : false ,
2018-07-24 15:04:48 +02:00
flag_tx_queue_no_early_reject : false ,
2017-09-05 13:30:22 +02:00
arg_tx_queue_size : 8192 usize ,
2018-04-13 17:34:27 +02:00
arg_tx_queue_per_sender : None ,
arg_tx_queue_mem_limit : 4 u32 ,
2019-01-28 11:26:11 +01:00
arg_tx_queue_locals : Some ( " 0xdeadbeefcafe0000000000000000000000000000 " . into ( ) ) ,
2017-09-05 13:30:22 +02:00
arg_tx_queue_strategy : " gas_factor " . into ( ) ,
2018-07-09 21:36:04 +02:00
arg_tx_queue_ban_count : Some ( 1 u16 ) ,
arg_tx_queue_ban_time : Some ( 180 u16 ) ,
2016-09-10 11:37:14 +02:00
flag_remove_solved : false ,
2017-09-05 13:30:22 +02:00
arg_notify_work : Some ( " http://localhost:3001 " . into ( ) ) ,
2017-01-22 16:15:22 +01:00
flag_refuse_service_transactions : false ,
2017-11-03 15:20:20 +01:00
flag_infinite_pending_block : false ,
2018-10-26 13:21:36 +02:00
arg_max_round_blocks_to_import : 12 usize ,
2016-09-10 11:37:14 +02:00
2017-01-25 11:03:36 +01:00
flag_stratum : false ,
2017-09-05 13:30:22 +02:00
arg_stratum_interface : " local " . to_owned ( ) ,
arg_stratum_port : 8008 u16 ,
arg_stratum_secret : None ,
2017-01-25 11:03:36 +01:00
2016-09-10 11:37:14 +02:00
// -- Footprint Options
2017-09-05 13:30:22 +02:00
arg_tracing : " auto " . into ( ) ,
arg_pruning : " auto " . into ( ) ,
arg_pruning_history : 64 u64 ,
arg_pruning_memory : 500 usize ,
arg_cache_size_db : 64 u32 ,
arg_cache_size_blocks : 8 u32 ,
arg_cache_size_queue : 50 u32 ,
arg_cache_size_state : 25 u32 ,
arg_cache_size : Some ( 128 ) ,
2016-09-10 11:37:14 +02:00
flag_fast_and_loose : false ,
2017-09-05 13:30:22 +02:00
arg_db_compaction : " ssd " . into ( ) ,
arg_fat_db : " auto " . into ( ) ,
2016-12-02 18:36:00 +01:00
flag_scale_verifiers : true ,
2017-09-05 13:30:22 +02:00
arg_num_verifiers : Some ( 6 ) ,
2016-09-10 11:37:14 +02:00
// -- Import/Export Options
2017-09-05 13:30:22 +02:00
arg_export_blocks_from : " 1 " . into ( ) ,
arg_export_blocks_to : " latest " . into ( ) ,
2016-10-24 15:09:13 +02:00
flag_no_seal_check : false ,
2017-09-05 13:30:22 +02:00
flag_export_state_no_code : false ,
flag_export_state_no_storage : false ,
arg_export_state_min_balance : None ,
arg_export_state_max_balance : None ,
2016-09-10 11:37:14 +02:00
// -- Snapshot Optons
2017-09-05 13:30:22 +02:00
arg_export_state_at : " latest " . into ( ) ,
arg_snapshot_at : " latest " . into ( ) ,
2016-09-10 11:37:14 +02:00
flag_no_periodic_snapshot : false ,
2018-09-13 12:58:49 +02:00
arg_snapshot_threads : None ,
2016-09-10 11:37:14 +02:00
2018-09-12 11:47:01 +02:00
// -- Light options.
2018-12-05 12:17:26 +01:00
arg_on_demand_response_time_window : Some ( 2 ) ,
arg_on_demand_request_backoff_start : Some ( 9 ) ,
arg_on_demand_request_backoff_max : Some ( 15 ) ,
2018-12-05 10:36:53 +01:00
arg_on_demand_request_backoff_rounds_max : Some ( 100 ) ,
arg_on_demand_request_consecutive_failures : Some ( 1 ) ,
2018-09-12 11:47:01 +02:00
2017-07-14 20:40:28 +02:00
// -- Whisper options.
flag_whisper : false ,
2019-07-12 14:15:30 +02:00
arg_whisper_pool_size : Some ( 20 ) ,
2017-07-14 20:40:28 +02:00
2016-09-10 11:37:14 +02:00
// -- Legacy Options
2017-11-08 12:33:56 +01:00
flag_warp : false ,
2016-09-10 11:37:14 +02:00
flag_geth : false ,
flag_testnet : false ,
flag_import_geth_keys : false ,
2018-03-29 11:20:27 +02:00
arg_warp_barrier : None ,
2017-09-05 13:30:22 +02:00
arg_datadir : None ,
arg_networkid : None ,
arg_peers : None ,
arg_nodekey : None ,
2016-09-10 11:37:14 +02:00
flag_nodiscover : false ,
flag_jsonrpc : false ,
flag_jsonrpc_off : false ,
flag_webapp : false ,
flag_dapps_off : false ,
flag_rpc : false ,
2017-09-05 13:30:22 +02:00
arg_rpcaddr : None ,
arg_rpcport : None ,
arg_rpcapi : None ,
arg_rpccorsdomain : None ,
2016-09-10 11:37:14 +02:00
flag_ipcdisable : false ,
flag_ipc_off : false ,
2017-09-05 13:30:22 +02:00
arg_ipcapi : None ,
arg_ipcpath : None ,
arg_gasprice : None ,
arg_etherbase : None ,
arg_extradata : None ,
arg_cache : None ,
2017-04-03 10:27:37 +02:00
// Legacy-Dapps
2017-09-05 13:30:22 +02:00
arg_dapps_port : Some ( 8080 ) ,
arg_dapps_interface : Some ( " local " . into ( ) ) ,
arg_dapps_hosts : Some ( " none " . into ( ) ) ,
arg_dapps_cors : None ,
arg_dapps_user : Some ( " test_user " . into ( ) ) ,
arg_dapps_pass : Some ( " test_pass " . into ( ) ) ,
flag_dapps_apis_all : false ,
// -- Internal Options
flag_can_restart : false ,
2016-09-10 11:37:14 +02:00
// -- Miscellaneous Options
2018-07-18 16:27:29 +02:00
arg_ntp_servers : None ,
2016-09-10 11:37:14 +02:00
flag_version : false ,
2017-09-05 13:30:22 +02:00
arg_logging : Some ( " own_tx=trace " . into ( ) ) ,
arg_log_file : Some ( " /var/log/parity.log " . into ( ) ) ,
2016-09-10 11:37:14 +02:00
flag_no_color : false ,
2016-09-12 14:11:30 +02:00
flag_no_config : false ,
2016-09-10 11:37:14 +02:00
} ) ;
}
2016-09-11 11:52:12 +02:00
#[ test ]
fn should_parse_config_and_return_errors ( ) {
2017-09-05 13:30:22 +02:00
let config1 = Args ::parse_config ( include_str! ( " ./tests/config.invalid1.toml " ) ) ;
let config2 = Args ::parse_config ( include_str! ( " ./tests/config.invalid2.toml " ) ) ;
let config3 = Args ::parse_config ( include_str! ( " ./tests/config.invalid3.toml " ) ) ;
2018-01-03 10:51:39 +01:00
let config4 = Args ::parse_config ( include_str! ( " ./tests/config.invalid4.toml " ) ) ;
match ( config1 , config2 , config3 , config4 ) {
(
Err ( ArgsError ::Decode ( _ ) ) ,
Err ( ArgsError ::Decode ( _ ) ) ,
Err ( ArgsError ::Decode ( _ ) ) ,
Err ( ArgsError ::Decode ( _ ) ) ,
) = > { } ,
( a , b , c , d ) = > {
assert! ( false , " Got invalid error types: {:?}, {:?}, {:?}, {:?} " , a , b , c , d ) ;
2016-09-11 11:52:12 +02:00
}
}
}
2016-09-10 11:37:14 +02:00
#[ test ]
fn should_deserialize_toml_file ( ) {
2017-09-05 13:30:22 +02:00
let config : Config = toml ::from_str ( include_str! ( " ./tests/config.toml " ) ) . unwrap ( ) ;
2016-09-10 11:37:14 +02:00
assert_eq! ( config , Config {
2016-09-11 11:52:12 +02:00
parity : Some ( Operating {
2016-09-10 11:37:14 +02:00
mode : Some ( " dark " . into ( ) ) ,
mode_timeout : Some ( 15 u64 ) ,
mode_alarm : Some ( 10 u64 ) ,
2016-12-04 19:47:05 +01:00
auto_update : None ,
2018-04-03 16:49:23 +02:00
auto_update_delay : None ,
auto_update_check_frequency : None ,
2016-12-15 19:23:25 +01:00
release_track : None ,
2016-12-04 19:47:05 +01:00
no_download : None ,
no_consensus : None ,
2016-09-10 11:37:14 +02:00
chain : Some ( " ./chain.json " . into ( ) ) ,
2016-12-15 21:56:45 +01:00
base_path : None ,
2016-09-10 11:37:14 +02:00
db_path : None ,
keys_path : None ,
identity : None ,
2017-03-22 16:45:50 +01:00
light : None ,
2018-03-27 13:56:59 +02:00
no_hardcoded_sync : None ,
2017-05-04 12:13:50 +02:00
no_persistent_txqueue : None ,
2018-06-01 16:49:55 +02:00
_legacy_public_node : None ,
2016-09-11 11:52:12 +02:00
} ) ,
account : Some ( Account {
2016-09-10 11:37:14 +02:00
unlock : Some ( vec! [ " 0x1 " . into ( ) , " 0x2 " . into ( ) , " 0x3 " . into ( ) ] ) ,
password : Some ( vec! [ " passwdfile path " . into ( ) ] ) ,
keys_iterations : None ,
2017-12-22 04:33:49 +01:00
refresh_time : None ,
2017-06-06 18:06:40 +02:00
fast_unlock : None ,
2016-09-11 11:52:12 +02:00
} ) ,
2016-11-07 17:40:53 +01:00
ui : Some ( Ui {
2016-09-10 11:37:14 +02:00
path : None ,
2018-06-06 10:05:52 +02:00
_legacy_force : None ,
_legacy_disable : Some ( true ) ,
_legacy_port : None ,
_legacy_interface : None ,
_legacy_hosts : None ,
2016-09-11 11:52:12 +02:00
} ) ,
network : Some ( Network {
2016-10-18 18:16:00 +02:00
warp : Some ( false ) ,
2018-03-29 11:20:27 +02:00
warp_barrier : None ,
2016-09-10 11:37:14 +02:00
port : None ,
2018-05-31 13:36:47 +02:00
interface : None ,
2016-09-10 11:37:14 +02:00
min_peers : Some ( 10 ) ,
max_peers : Some ( 20 ) ,
2016-10-24 18:25:27 +02:00
max_pending_peers : Some ( 30 ) ,
snapshot_peers : Some ( 40 ) ,
allow_ips : Some ( " public " . into ( ) ) ,
2016-09-10 11:37:14 +02:00
nat : Some ( " any " . into ( ) ) ,
id : None ,
bootnodes : None ,
discovery : Some ( true ) ,
node_key : None ,
reserved_peers : Some ( " ./path/to/reserved_peers " . into ( ) ) ,
reserved_only : Some ( true ) ,
2017-03-22 16:45:50 +01:00
no_serve_light : None ,
2016-09-11 11:52:12 +02:00
} ) ,
2017-04-13 16:32:07 +02:00
websockets : Some ( Ws {
disable : Some ( true ) ,
port : None ,
interface : None ,
apis : None ,
origins : Some ( vec! [ " none " . into ( ) ] ) ,
hosts : None ,
2018-04-02 12:33:09 +02:00
max_connections : None ,
2017-04-13 16:32:07 +02:00
} ) ,
2016-09-11 11:52:12 +02:00
rpc : Some ( Rpc {
2016-09-10 11:37:14 +02:00
disable : Some ( true ) ,
port : Some ( 8180 ) ,
interface : None ,
cors : None ,
apis : None ,
hosts : None ,
2017-07-11 12:22:19 +02:00
server_threads : None ,
processing_threads : None ,
2018-07-02 10:23:57 +02:00
max_payload : None ,
2018-11-05 15:39:51 +01:00
keep_alive : None ,
2018-11-16 14:00:34 +01:00
experimental_rpcs : None ,
2018-11-16 12:39:29 +01:00
poll_lifetime : None ,
2018-11-26 19:58:27 +01:00
allow_missing_blocks : None
2016-09-11 11:52:12 +02:00
} ) ,
ipc : Some ( Ipc {
2016-09-10 11:37:14 +02:00
disable : None ,
path : None ,
apis : Some ( vec! [ " rpc " . into ( ) , " eth " . into ( ) ] ) ,
2016-09-11 11:52:12 +02:00
} ) ,
dapps : Some ( Dapps {
2018-07-11 12:19:54 +02:00
_legacy_disable : None ,
_legacy_port : Some ( 8080 ) ,
_legacy_path : None ,
_legacy_interface : None ,
_legacy_hosts : None ,
_legacy_cors : None ,
_legacy_user : Some ( " username " . into ( ) ) ,
_legacy_pass : Some ( " password " . into ( ) )
2016-09-11 11:52:12 +02:00
} ) ,
2017-02-20 16:13:21 +01:00
secretstore : Some ( SecretStore {
disable : None ,
2017-07-27 12:29:09 +02:00
disable_http : None ,
2018-01-10 11:33:45 +01:00
disable_auto_migrate : None ,
2018-06-14 09:01:52 +02:00
acl_contract : None ,
2017-11-24 10:33:33 +01:00
service_contract : None ,
2018-04-03 16:54:34 +02:00
service_contract_srv_gen : None ,
service_contract_srv_retr : None ,
service_contract_doc_store : None ,
service_contract_doc_sretr : None ,
2017-04-08 11:26:16 +02:00
self_secret : None ,
2017-10-02 15:27:31 +02:00
admin_public : None ,
2017-04-08 11:26:16 +02:00
nodes : None ,
2018-06-14 09:01:52 +02:00
server_set_contract : None ,
2017-02-20 16:13:21 +01:00
interface : None ,
2017-04-08 11:26:16 +02:00
port : Some ( 8083 ) ,
http_interface : None ,
http_port : Some ( 8082 ) ,
2017-02-20 16:13:21 +01:00
path : None ,
2019-04-20 07:31:37 +02:00
cors : None ,
2017-02-20 16:13:21 +01:00
} ) ,
2018-04-09 16:14:33 +02:00
private_tx : None ,
2017-02-15 20:29:29 +01:00
ipfs : Some ( Ipfs {
2017-02-16 14:41:33 +01:00
enable : Some ( false ) ,
2017-02-24 10:32:42 +01:00
port : Some ( 5001 ) ,
interface : None ,
cors : None ,
hosts : None ,
2017-02-15 20:29:29 +01:00
} ) ,
2016-09-11 11:52:12 +02:00
mining : Some ( Mining {
2016-09-10 11:37:14 +02:00
author : Some ( " 0xdeadbeefcafe0000000000000000000000000001 " . into ( ) ) ,
2016-12-05 22:31:38 +01:00
engine_signer : Some ( " 0xdeadbeefcafe0000000000000000000000000001 " . into ( ) ) ,
2016-09-10 11:37:14 +02:00
force_sealing : Some ( true ) ,
reseal_on_txs : Some ( " all " . into ( ) ) ,
2017-07-10 13:36:42 +02:00
reseal_on_uncle : None ,
2016-09-10 11:37:14 +02:00
reseal_min_period : Some ( 4000 ) ,
2017-03-15 14:04:42 +01:00
reseal_max_period : Some ( 60000 ) ,
2016-09-10 11:37:14 +02:00
work_queue_size : None ,
relay_set : None ,
2017-07-13 14:25:41 +02:00
min_gas_price : None ,
2018-01-09 12:43:36 +01:00
gas_price_percentile : None ,
2016-09-10 11:37:14 +02:00
usd_per_tx : None ,
usd_per_eth : None ,
price_update_period : Some ( " hourly " . into ( ) ) ,
gas_floor_target : None ,
gas_cap : None ,
2017-07-13 15:12:25 +02:00
tx_queue_size : Some ( 8192 ) ,
2018-04-13 17:34:27 +02:00
tx_queue_per_sender : None ,
2017-07-13 15:12:25 +02:00
tx_queue_mem_limit : None ,
2019-01-28 11:26:11 +01:00
tx_queue_locals : None ,
2016-10-15 14:46:33 +02:00
tx_queue_strategy : None ,
2016-10-27 19:28:34 +02:00
tx_queue_ban_count : None ,
tx_queue_ban_time : None ,
2018-06-18 15:32:18 +02:00
tx_queue_no_unfamiliar_locals : None ,
2018-07-24 15:04:48 +02:00
tx_queue_no_early_reject : None ,
2016-09-10 11:37:14 +02:00
tx_gas_limit : None ,
2016-10-27 19:28:34 +02:00
tx_time_limit : None ,
2016-09-10 11:37:14 +02:00
extra_data : None ,
remove_solved : None ,
notify_work : None ,
2017-01-22 16:15:22 +01:00
refuse_service_transactions : None ,
2017-11-03 15:20:20 +01:00
infinite_pending_block : None ,
2018-10-26 13:21:36 +02:00
max_round_blocks_to_import : None ,
2016-09-11 11:52:12 +02:00
} ) ,
footprint : Some ( Footprint {
2016-09-10 11:37:14 +02:00
tracing : Some ( " on " . into ( ) ) ,
pruning : Some ( " fast " . into ( ) ) ,
2016-10-14 14:44:56 +02:00
pruning_history : Some ( 64 ) ,
2017-01-20 13:25:53 +01:00
pruning_memory : None ,
2016-09-10 11:37:14 +02:00
fast_and_loose : None ,
cache_size : None ,
2018-01-03 11:00:37 +01:00
cache_size_db : Some ( 256 ) ,
2016-09-10 11:37:14 +02:00
cache_size_blocks : Some ( 16 ) ,
cache_size_queue : Some ( 100 ) ,
2016-10-07 00:28:42 +02:00
cache_size_state : Some ( 25 ) ,
2016-09-10 11:37:14 +02:00
db_compaction : Some ( " ssd " . into ( ) ) ,
2016-10-03 11:13:10 +02:00
fat_db : Some ( " off " . into ( ) ) ,
2016-12-02 18:36:00 +01:00
scale_verifiers : Some ( false ) ,
num_verifiers : None ,
2016-09-11 11:52:12 +02:00
} ) ,
2018-09-12 11:47:01 +02:00
light : Some ( Light {
2018-12-05 12:17:26 +01:00
on_demand_response_time_window : Some ( 2 ) ,
on_demand_request_backoff_start : Some ( 9 ) ,
on_demand_request_backoff_max : Some ( 15 ) ,
2018-12-05 10:36:53 +01:00
on_demand_request_backoff_rounds_max : Some ( 10 ) ,
on_demand_request_consecutive_failures : Some ( 1 ) ,
2018-09-12 11:47:01 +02:00
} ) ,
2016-09-11 11:52:12 +02:00
snapshots : Some ( Snapshots {
2016-09-10 11:37:14 +02:00
disable_periodic : Some ( true ) ,
2018-09-13 12:58:49 +02:00
processing_threads : None ,
2016-09-11 11:52:12 +02:00
} ) ,
misc : Some ( Misc {
2016-09-10 11:37:14 +02:00
logging : Some ( " own_tx=trace " . into ( ) ) ,
log_file : Some ( " /var/log/parity.log " . into ( ) ) ,
2016-09-11 11:52:12 +02:00
color : Some ( true ) ,
2017-05-23 12:24:32 +02:00
ports_shift : Some ( 0 ) ,
unsafe_expose : Some ( false ) ,
2017-01-25 11:03:36 +01:00
} ) ,
2017-07-14 20:40:28 +02:00
whisper : Some ( Whisper {
enabled : Some ( true ) ,
pool_size : Some ( 50 ) ,
} ) ,
2017-01-25 11:03:36 +01:00
stratum : None ,
2016-09-10 11:37:14 +02:00
} ) ;
}
2018-04-03 16:51:57 +02:00
#[ test ]
fn should_not_accept_min_peers_bigger_than_max_peers ( ) {
match Args ::parse ( & [ " parity " , " --max-peers=39 " , " --min-peers=40 " ] ) {
Err ( ArgsError ::PeerConfiguration ) = > ( ) ,
_ = > assert_eq! ( false , true ) ,
}
}
#[ test ]
fn should_accept_max_peers_equal_or_bigger_than_min_peers ( ) {
Args ::parse ( & [ " parity " , " --max-peers=40 " , " --min-peers=40 " ] ) . unwrap ( ) ;
Args ::parse ( & [ " parity " , " --max-peers=100 " , " --min-peers=40 " ] ) . unwrap ( ) ;
}
2016-09-10 11:37:14 +02:00
}