openethereum/parity/cli/mod.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

1642 lines
75 KiB
Rust
Raw Normal View History

2020-09-22 14:53:52 +02:00
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of OpenEthereum.
2016-09-10 11:37:14 +02:00
2020-09-22 14:53:52 +02:00
// OpenEthereum 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.
2020-09-22 14:53:52 +02:00
// OpenEthereum 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
2020-09-22 14:53:52 +02:00
// along with OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
2016-09-10 11:37:14 +02:00
#[macro_use]
mod usage;
mod presets;
2016-09-10 11:37:14 +02:00
use super::helpers;
use std::collections::HashSet;
2016-09-10 11:37:14 +02:00
usage! {
{
// 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_
// Flags must start with flag_
2020-08-05 06:08:03 +02:00
CMD cmd_daemon
{
2020-09-22 14:53:52 +02:00
"Use OpenEthereum as a daemon",
2020-08-05 06:08:03 +02:00
ARG arg_daemon_pid_file: (Option<String>) = None,
"<PID-FILE>",
"Path to the pid file",
}
2020-08-05 06:08:03 +02:00
CMD cmd_account
{
"Manage accounts",
2020-08-05 06:08:03 +02:00
CMD cmd_account_new {
"Create a new account (and its associated key) for the given --chain (default: mainnet)",
}
2020-08-05 06:08:03 +02:00
CMD cmd_account_list {
"List existing accounts of the given --chain (default: mainnet)",
}
2020-08-05 06:08:03 +02:00
CMD cmd_account_import
{
"Import accounts from JSON UTC keystore files to the specified --chain (default mainnet)",
2020-08-05 06:08:03 +02:00
ARG arg_account_import_path : (Option<Vec<String>>) = None,
"<PATH>...",
"Path to the accounts",
}
}
2020-08-05 06:08:03 +02:00
CMD cmd_wallet
{
"Manage wallet",
2020-08-05 06:08:03 +02:00
CMD cmd_wallet_import
{
"Import wallet into the given --chain (default: mainnet)",
2020-08-05 06:08:03 +02:00
ARG arg_wallet_import_path: (Option<String>) = None,
"<PATH>",
"Path to the wallet",
}
}
2020-08-05 06:08:03 +02:00
CMD cmd_import
{
"Import blockchain data from a file to the given --chain database (default: mainnet)",
2020-08-05 06:08:03 +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)",
2020-08-05 06:08:03 +02:00
ARG arg_import_file: (Option<String>) = None,
"[FILE]",
"Path to the file to import from",
}
2020-08-05 06:08:03 +02:00
CMD cmd_export
{
"Export blockchain",
2020-08-05 06:08:03 +02:00
CMD cmd_export_blocks
{
"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.",
2020-08-05 06:08:03 +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)",
2020-08-05 06:08:03 +02:00
ARG arg_export_blocks_from: (String) = "1",
"--from=[BLOCK]",
"Export from block BLOCK, which may be an index or hash.",
2020-08-05 06:08:03 +02:00
ARG arg_export_blocks_to: (String) = "latest",
"--to=[BLOCK]",
"Export to (including) block BLOCK, which may be an index, hash or latest.",
2020-08-05 06:08:03 +02:00
ARG arg_export_blocks_file: (Option<String>) = None,
"[FILE]",
"Path to the exported file",
}
2020-08-05 06:08:03 +02:00
CMD cmd_export_state
{
"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.",
2020-08-05 06:08:03 +02:00
FLAG flag_export_state_no_storage: (bool) = false,
"--no-storage",
"Don't export account storage.",
2020-08-05 06:08:03 +02:00
FLAG flag_export_state_no_code: (bool) = false,
"--no-code",
"Don't export account code.",
2020-08-05 06:08:03 +02:00
ARG arg_export_state_min_balance: (Option<String>) = None,
"--min-balance=[WEI]",
"Don't export accounts with balance less than specified.",
2020-08-05 06:08:03 +02:00
ARG arg_export_state_max_balance: (Option<String>) = None,
"--max-balance=[WEI]",
"Don't export accounts with balance greater than specified.",
2020-08-05 06:08:03 +02:00
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",
2020-08-05 06:08:03 +02:00
ARG arg_export_state_format: (Option<String>) = None,
"--format=[FORMAT]",
"Export in a given format. FORMAT must be either 'hex' or 'binary'. (default: binary)",
2020-08-05 06:08:03 +02:00
ARG arg_export_state_file: (Option<String>) = None,
"[FILE]",
"Path to the exported file",
}
}
2020-08-05 06:08:03 +02:00
CMD cmd_signer
{
"Manage signer",
2020-08-05 06:08:03 +02:00
CMD cmd_signer_new_token {
"Generate a new signer-authentication token for the given --chain (default: mainnet)",
}
2020-08-05 06:08:03 +02:00
CMD cmd_signer_list {
"List the signer-authentication tokens from given --chain (default: mainnet)",
}
2020-08-05 06:08:03 +02:00
CMD cmd_signer_sign
{
"Sign",
2020-08-05 06:08:03 +02:00
ARG arg_signer_sign_id: (Option<usize>) = None,
"[ID]",
"ID",
}
2020-08-05 06:08:03 +02:00
CMD cmd_signer_reject
{
"Reject",
2020-08-05 06:08:03 +02:00
ARG arg_signer_reject_id: (Option<usize>) = None,
"<ID>",
"ID",
}
}
2020-08-05 06:08:03 +02:00
CMD cmd_snapshot
{
"Make a snapshot of the database of the given --chain (default: mainnet)",
2020-08-05 06:08:03 +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",
2020-08-05 06:08:03 +02:00
ARG arg_snapshot_file: (Option<String>) = None,
"<FILE>",
"Path to the file to export to",
}
2020-08-05 06:08:03 +02:00
CMD cmd_restore
{
"Restore the database of the given --chain (default: mainnet) from a snapshot file",
2020-08-05 06:08:03 +02:00
ARG arg_restore_file: (Option<String>) = None,
"[FILE]",
"Path to the file to restore from",
}
2020-08-05 06:08:03 +02:00
CMD cmd_tools
{
"Tools",
2020-08-05 06:08:03 +02:00
CMD cmd_tools_hash
{
"Hash a file using the Keccak-256 algorithm",
2020-08-05 06:08:03 +02:00
ARG arg_tools_hash_file: (Option<String>) = None,
"<FILE>",
"File",
}
}
2020-08-05 06:08:03 +02:00
CMD cmd_db
{
"Manage the database representing the state of the blockchain on this system",
2020-08-05 06:08:03 +02:00
CMD cmd_db_kill {
"Clean the database of the given --chain (default: mainnet)",
}
2020-08-05 06:08:03 +02:00
CMD cmd_db_reset {
"Removes NUM latests blocks from the db",
2020-08-05 06:08:03 +02:00
ARG arg_db_reset_num: (u32) = 10u32,
"<NUM>",
"Number of blocks to revert",
}
2020-08-05 06:08:03 +02:00
}
2016-09-10 11:37:14 +02:00
}
{
// Global flags and arguments
["Operating Options"]
ARG arg_mode: (String) = "last", or |c: &Config| c.parity.as_ref()?.mode.clone(),
"--mode=[MODE]",
"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.",
2020-08-05 06:08:03 +02:00
ARG arg_mode_timeout: (u64) = 300u64, or |c: &Config| c.parity.as_ref()?.mode_timeout.clone(),
"--mode-timeout=[SECS]",
"Specify the number of seconds before inactivity timeout occurs when mode is dark or passive",
2020-08-05 06:08:03 +02:00
ARG arg_mode_alarm: (u64) = 3600u64, or |c: &Config| c.parity.as_ref()?.mode_alarm.clone(),
"--mode-alarm=[SECS]",
"Specify the number of seconds before auto sleep reawake timeout occurs when mode is passive",
2020-08-05 06:08:03 +02:00
ARG arg_chain: (String) = "foundation", or |c: &Config| c.parity.as_ref()?.chain.clone(),
"--chain=[CHAIN]",
"Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, poacore, xdai, volta, ewc, musicoin, ellaism, mix, callisto, morden, ropsten, kovan, rinkeby, goerli, poasokol, testnet, or dev.",
2020-08-05 06:08:03 +02:00
ARG arg_keys_path: (String) = "$BASE/keys", or |c: &Config| c.parity.as_ref()?.keys_path.clone(),
"--keys-path=[PATH]",
"Specify the path for JSON key files to be found",
2020-08-05 06:08:03 +02:00
ARG arg_identity: (String) = "", or |c: &Config| c.parity.as_ref()?.identity.clone(),
"--identity=[NAME]",
"Specify your node's name.",
2020-08-05 06:08:03 +02:00
ARG arg_base_path: (Option<String>) = None, or |c: &Config| c.parity.as_ref()?.base_path.clone(),
"-d, --base-path=[PATH]",
"Specify the base data storage path.",
2020-08-05 06:08:03 +02:00
ARG arg_db_path: (Option<String>) = None, or |c: &Config| c.parity.as_ref()?.db_path.clone(),
"--db-path=[PATH]",
"Specify the database directory path",
2020-08-05 06:08:03 +02:00
["Convenience Options"]
FLAG flag_unsafe_expose: (bool) = false, or |c: &Config| c.misc.as_ref()?.unsafe_expose,
"--unsafe-expose",
2020-08-17 12:47:53 +02:00
"All servers will listen on external interfaces and will be remotely accessible. It's equivalent with setting the following: --[ws,jsonrpc,secretstore,stratum,secretstore-http]-interface=all --*-hosts=all This option is UNSAFE and should be used with great care!",
2020-08-05 06:08:03 +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.",
2020-08-05 06:08:03 +02:00
ARG arg_ports_shift: (u16) = 0u16, or |c: &Config| c.misc.as_ref()?.ports_shift,
"--ports-shift=[SHIFT]",
2020-09-22 14:53:52 +02:00
"Add SHIFT to all port numbers OpenEthereum is listening on. Includes network port and all servers (HTTP JSON-RPC, WebSockets JSON-RPC, SecretStore).",
2020-08-05 06:08:03 +02:00
["Account Options"]
FLAG flag_fast_unlock: (bool) = false, or |c: &Config| c.account.as_ref()?.fast_unlock.clone(),
"--fast-unlock",
"Use drastically faster unlocking mode. This setting causes raw secrets to be stored unprotected in memory, so use with care.",
2020-08-05 06:08:03 +02:00
ARG arg_keys_iterations: (u32) = 10240u32, or |c: &Config| c.account.as_ref()?.keys_iterations.clone(),
"--keys-iterations=[NUM]",
"Specify the number of iterations to use when deriving key from the password (bigger is more secure)",
2020-08-05 06:08:03 +02:00
ARG arg_accounts_refresh: (u64) = 5u64, or |c: &Config| c.account.as_ref()?.refresh_time.clone(),
"--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.",
2020-08-05 06:08:03 +02:00
ARG arg_unlock: (Option<String>) = None, or |c: &Config| c.account.as_ref()?.unlock.as_ref().map(|vec| vec.join(",")),
"--unlock=[ACCOUNTS]",
"Unlock ACCOUNTS for the duration of the execution. ACCOUNTS is a comma-delimited list of addresses.",
2020-08-05 06:08:03 +02:00
ARG arg_password: (Vec<String>) = Vec::new(), or |c: &Config| c.account.as_ref()?.password.clone(),
"--password=[FILE]...",
"Provide a file containing a password for unlocking an account. Leading and trailing whitespace is trimmed.",
2020-08-05 06:08:03 +02:00
["UI Options"]
ARG arg_ui_path: (String) = "$BASE/signer", or |c: &Config| c.ui.as_ref()?.path.clone(),
"--ui-path=[PATH]",
"Specify directory where Trusted UIs tokens should be stored.",
2020-08-05 06:08:03 +02:00
["Networking Options"]
FLAG flag_no_warp: (bool) = false, or |c: &Config| c.network.as_ref()?.warp.clone().map(|w| !w),
"--no-warp",
"Disable syncing from the snapshot over the network.",
2020-08-05 06:08:03 +02:00
FLAG flag_no_discovery: (bool) = false, or |c: &Config| c.network.as_ref()?.discovery.map(|d| !d).clone(),
"--no-discovery",
"Disable new peer discovery.",
2020-08-05 06:08:03 +02:00
FLAG flag_reserved_only: (bool) = false, or |c: &Config| c.network.as_ref()?.reserved_only.clone(),
"--reserved-only",
"Connect only to reserved nodes.",
2020-08-05 06:08:03 +02:00
FLAG flag_no_ancient_blocks: (bool) = false, or |_| None,
"--no-ancient-blocks",
"Disable downloading old blocks after snapshot restoration or warp sync. Not recommended.",
2020-08-05 06:08:03 +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.",
2020-08-05 06:08:03 +02:00
ARG arg_port: (u16) = 30303u16, or |c: &Config| c.network.as_ref()?.port.clone(),
"--port=[PORT]",
"Override the port on which the node should listen.",
2020-08-05 06:08:03 +02:00
Allow dropping light client RPC query with no results (#9318) * OnDemand no longer loop until there is a query. All peer known at the time will be queried, and the query fail if all return no reply. Returning the failure is done through an empty Vec of reply (the type of the oneshot channel remains unchanged). Before this commit the query were send randomly to any peer until there is a reply (for a query that got no result it was an issue, for other queries it was quering multiple times the same peers). After this commit the first query is random but next queries follows hashmap iterator order. Test no_capability was broken by this commit (the pending query was removed). * OnDemand no longer loop until there is a query. All peer known at the time will be queried, and the query fail if all return no reply. Returning the failure is done through an empty Vec of reply (the type of the oneshot channel remains unchanged). Before this commit the query were send randomly to any peer until there is a reply (for a query that got no result it was an issue, for other queries it was quering multiple times the same peers). After this commit the first query is random but next queries follows hashmap iterator order. Test no_capability was broken by this commit (the pending query was removed). If adding some kind of timeout mechanism it could be restored. * Comment plus better field names. * No panick on dropped oneshot channel. * Use Set to avoid counter heuristic * Cli option `on_demand_nb_retry` for maximum number of retry when doing on demand query in light client. * Missing test update for previous commit * Add a timeout (only when there is no peer to query), that way we do not set number of query to minimum current number peer or configured number of query : that way capability test was restored. * Adding an error type for on_demand, it helps having variant of error reported at rpc level : choice of rpc error code error might not be right. * Duration as constant is nice * Switch to duration in main too * Fix indentation (sorry for that). * Fix error management (bad merge in previous commit) * Lots of english corrections, major change on the new command parameters : - use standard '-' instead of '_' - renaming nb_retry params to 'on-demand-retry-count'
2018-09-12 11:47:01 +02:00
ARG arg_interface: (String) = "all", or |c: &Config| c.network.as_ref()?.interface.clone(),
"--interface=[IP]",
2020-09-22 14:53:52 +02:00
"Network interfaces. Valid values are 'all', 'local' or the ip of the interface you want OpenEthereum to listen to.",
2020-08-05 06:08:03 +02:00
ARG arg_min_peers: (Option<u16>) = None, or |c: &Config| c.network.as_ref()?.min_peers.clone(),
"--min-peers=[NUM]",
"Try to maintain at least NUM peers.",
2020-08-05 06:08:03 +02:00
ARG arg_max_peers: (Option<u16>) = None, or |c: &Config| c.network.as_ref()?.max_peers.clone(),
"--max-peers=[NUM]",
"Allow up to NUM peers.",
2020-08-05 06:08:03 +02:00
ARG arg_snapshot_peers: (u16) = 0u16, or |c: &Config| c.network.as_ref()?.snapshot_peers.clone(),
"--snapshot-peers=[NUM]",
"Allow additional NUM peers for a snapshot sync.",
2020-08-05 06:08:03 +02:00
ARG arg_nat: (String) = "any", or |c: &Config| c.network.as_ref()?.nat.clone(),
"--nat=[METHOD]",
"Specify method to use for determining public address. Must be one of: any, none, upnp, extip:<IP>.",
2020-08-05 06:08:03 +02:00
ARG arg_allow_ips: (String) = "all", or |c: &Config| c.network.as_ref()?.allow_ips.clone(),
"--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.",
2020-08-05 06:08:03 +02:00
ARG arg_max_pending_peers: (u16) = 64u16, or |c: &Config| c.network.as_ref()?.max_pending_peers.clone(),
"--max-pending-peers=[NUM]",
"Allow up to NUM pending connections.",
2020-08-05 06:08:03 +02:00
ARG arg_network_id: (Option<u64>) = None, or |c: &Config| c.network.as_ref()?.id.clone(),
"--network-id=[INDEX]",
"Override the network identifier from the chain we are on.",
2020-08-05 06:08:03 +02:00
ARG arg_bootnodes: (Option<String>) = None, or |c: &Config| c.network.as_ref()?.bootnodes.as_ref().map(|vec| vec.join(",")),
"--bootnodes=[NODES]",
"Override the bootnodes from our chain. NODES should be comma-delimited enodes.",
2020-08-05 06:08:03 +02:00
ARG arg_node_key: (Option<String>) = None, or |c: &Config| c.network.as_ref()?.node_key.clone(),
"--node-key=[KEY]",
"Specify node secret key, either as 64-character hex string or input to SHA3 operation.",
2020-08-05 06:08:03 +02:00
ARG arg_reserved_peers: (Option<String>) = None, or |c: &Config| c.network.as_ref()?.reserved_peers.clone(),
"--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.",
2020-08-05 06:08:03 +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);
}
}
2020-08-05 06:08:03 +02:00
Ok(())
},
2020-08-05 06:08:03 +02:00
["API and Console Options HTTP JSON-RPC"]
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",
2020-08-05 06:08:03 +02:00
FLAG flag_no_jsonrpc: (bool) = false, or |c: &Config| c.rpc.as_ref()?.disable.clone(),
"--no-jsonrpc",
"Disable the HTTP JSON-RPC API server.",
2020-08-05 06:08:03 +02: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.",
2020-08-05 06:08:03 +02: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",
2020-08-05 06:08:03 +02:00
ARG arg_jsonrpc_port: (u16) = 8545u16, or |c: &Config| c.rpc.as_ref()?.port.clone(),
"--jsonrpc-port=[PORT]",
"Specify the port portion of the HTTP JSON-RPC API server.",
2020-08-05 06:08:03 +02:00
Allow dropping light client RPC query with no results (#9318) * OnDemand no longer loop until there is a query. All peer known at the time will be queried, and the query fail if all return no reply. Returning the failure is done through an empty Vec of reply (the type of the oneshot channel remains unchanged). Before this commit the query were send randomly to any peer until there is a reply (for a query that got no result it was an issue, for other queries it was quering multiple times the same peers). After this commit the first query is random but next queries follows hashmap iterator order. Test no_capability was broken by this commit (the pending query was removed). * OnDemand no longer loop until there is a query. All peer known at the time will be queried, and the query fail if all return no reply. Returning the failure is done through an empty Vec of reply (the type of the oneshot channel remains unchanged). Before this commit the query were send randomly to any peer until there is a reply (for a query that got no result it was an issue, for other queries it was quering multiple times the same peers). After this commit the first query is random but next queries follows hashmap iterator order. Test no_capability was broken by this commit (the pending query was removed). If adding some kind of timeout mechanism it could be restored. * Comment plus better field names. * No panick on dropped oneshot channel. * Use Set to avoid counter heuristic * Cli option `on_demand_nb_retry` for maximum number of retry when doing on demand query in light client. * Missing test update for previous commit * Add a timeout (only when there is no peer to query), that way we do not set number of query to minimum current number peer or configured number of query : that way capability test was restored. * Adding an error type for on_demand, it helps having variant of error reported at rpc level : choice of rpc error code error might not be right. * Duration as constant is nice * Switch to duration in main too * Fix indentation (sorry for that). * Fix error management (bad merge in previous commit) * Lots of english corrections, major change on the new command parameters : - use standard '-' instead of '_' - renaming nb_retry params to 'on-demand-retry-count'
2018-09-12 11:47:01 +02:00
ARG arg_jsonrpc_interface: (String) = "local", or |c: &Config| c.rpc.as_ref()?.interface.clone(),
"--jsonrpc-interface=[IP]",
"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.",
2020-08-05 06:08:03 +02:00
2020-09-02 17:43:14 +02:00
ARG arg_jsonrpc_apis: (String) = "web3,eth,pubsub,net,parity,parity_pubsub,traces", or |c: &Config| c.rpc.as_ref()?.apis.as_ref().map(|vec| vec.join(",")),
"--jsonrpc-apis=[APIS]",
2020-08-12 12:00:28 +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, 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",
2020-08-05 06:08:03 +02:00
ARG arg_jsonrpc_hosts: (String) = "none", or |c: &Config| c.rpc.as_ref()?.hosts.as_ref().map(|vec| vec.join(",")),
"--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\",.",
2020-08-05 06:08:03 +02:00
ARG arg_jsonrpc_threads: (usize) = 4usize, or |c: &Config| c.rpc.as_ref()?.processing_threads,
"--jsonrpc-threads=[THREADS]",
"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.",
2020-08-05 06:08:03 +02:00
ARG arg_jsonrpc_cors: (String) = "none", or |c: &Config| c.rpc.as_ref()?.cors.as_ref().map(|vec| vec.join(",")),
"--jsonrpc-cors=[URL]",
"Specify CORS header for HTTP JSON-RPC API responses. Special options: \"all\", \"none\".",
2020-08-05 06:08:03 +02:00
ARG arg_jsonrpc_server_threads: (Option<usize>) = None, or |c: &Config| c.rpc.as_ref()?.server_threads,
"--jsonrpc-server-threads=[NUM]",
"Enables multiple threads handling incoming connections for HTTP JSON-RPC server.",
2020-08-05 06:08:03 +02:00
ARG arg_jsonrpc_max_payload: (Option<usize>) = None, or |c: &Config| c.rpc.as_ref()?.max_payload,
"--jsonrpc-max-payload=[MB]",
"Specify maximum size for HTTP JSON-RPC requests in megabytes.",
2020-08-05 06:08:03 +02:00
ARG arg_poll_lifetime: (u32) = 60u32, 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.",
2020-08-05 06:08:03 +02:00
["API and Console Options WebSockets"]
FLAG flag_no_ws: (bool) = false, or |c: &Config| c.websockets.as_ref()?.disable.clone(),
"--no-ws",
"Disable the WebSockets JSON-RPC server.",
2020-08-05 06:08:03 +02:00
ARG arg_ws_port: (u16) = 8546u16, or |c: &Config| c.websockets.as_ref()?.port.clone(),
"--ws-port=[PORT]",
"Specify the port portion of the WebSockets JSON-RPC server.",
2020-08-05 06:08:03 +02:00
Allow dropping light client RPC query with no results (#9318) * OnDemand no longer loop until there is a query. All peer known at the time will be queried, and the query fail if all return no reply. Returning the failure is done through an empty Vec of reply (the type of the oneshot channel remains unchanged). Before this commit the query were send randomly to any peer until there is a reply (for a query that got no result it was an issue, for other queries it was quering multiple times the same peers). After this commit the first query is random but next queries follows hashmap iterator order. Test no_capability was broken by this commit (the pending query was removed). * OnDemand no longer loop until there is a query. All peer known at the time will be queried, and the query fail if all return no reply. Returning the failure is done through an empty Vec of reply (the type of the oneshot channel remains unchanged). Before this commit the query were send randomly to any peer until there is a reply (for a query that got no result it was an issue, for other queries it was quering multiple times the same peers). After this commit the first query is random but next queries follows hashmap iterator order. Test no_capability was broken by this commit (the pending query was removed). If adding some kind of timeout mechanism it could be restored. * Comment plus better field names. * No panick on dropped oneshot channel. * Use Set to avoid counter heuristic * Cli option `on_demand_nb_retry` for maximum number of retry when doing on demand query in light client. * Missing test update for previous commit * Add a timeout (only when there is no peer to query), that way we do not set number of query to minimum current number peer or configured number of query : that way capability test was restored. * Adding an error type for on_demand, it helps having variant of error reported at rpc level : choice of rpc error code error might not be right. * Duration as constant is nice * Switch to duration in main too * Fix indentation (sorry for that). * Fix error management (bad merge in previous commit) * Lots of english corrections, major change on the new command parameters : - use standard '-' instead of '_' - renaming nb_retry params to 'on-demand-retry-count'
2018-09-12 11:47:01 +02:00
ARG arg_ws_interface: (String) = "local", or |c: &Config| c.websockets.as_ref()?.interface.clone(),
"--ws-interface=[IP]",
"Specify the hostname portion of the WebSockets JSON-RPC server, IP should be an interface's IP address, or all (all interfaces) or local.",
2020-08-05 06:08:03 +02:00
2020-09-02 17:43:14 +02:00
ARG arg_ws_apis: (String) = "web3,eth,pubsub,net,parity,parity_pubsub,traces", or |c: &Config| c.websockets.as_ref()?.apis.as_ref().map(|vec| vec.join(",")),
"--ws-apis=[APIS]",
2020-08-12 12:00:28 +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, 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",
2020-08-05 06:08:03 +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(",")),
"--ws-origins=[URL]",
"Specify Origin header values allowed to connect. Special options: \"all\", \"none\".",
2020-08-05 06:08:03 +02:00
ARG arg_ws_hosts: (String) = "none", or |c: &Config| c.websockets.as_ref()?.hosts.as_ref().map(|vec| vec.join(",")),
"--ws-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\".",
2020-08-05 06:08:03 +02:00
ARG arg_ws_max_connections: (usize) = 100usize, or |c: &Config| c.websockets.as_ref()?.max_connections,
"--ws-max-connections=[CONN]",
"Maximum number of allowed concurrent WebSockets JSON-RPC connections.",
2020-08-05 06:08:03 +02:00
["Metrics"]
FLAG flag_metrics: (bool) = false, or |c: &Config| c.metrics.as_ref()?.enable.clone(),
"--metrics",
"Enable prometheus metrics (only full client).",
ARG arg_metrics_port: (u16) = 3000u16, or |c: &Config| c.metrics.as_ref()?.port.clone(),
"--metrics-port=[PORT]",
"Specify the port portion of the metrics server.",
ARG arg_metrics_interface: (String) = "local", or |c: &Config| c.metrics.as_ref()?.interface.clone(),
"--metrics-interface=[IP]",
"Specify the hostname portion of the metrics server, IP should be an interface's IP address, or all (all interfaces) or local.",
["API and Console Options IPC"]
FLAG flag_no_ipc: (bool) = false, or |c: &Config| c.ipc.as_ref()?.disable.clone(),
"--no-ipc",
"Disable JSON-RPC over IPC service.",
2020-08-05 06:08:03 +02: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(),
"--ipc-path=[PATH]",
"Specify custom path for JSON-RPC over IPC service.",
2020-08-05 06:08:03 +02:00
2020-09-02 17:43:14 +02:00
ARG arg_ipc_apis: (String) = "web3,eth,pubsub,net,parity,parity_pubsub,parity_accounts,traces", or |c: &Config| c.ipc.as_ref()?.apis.as_ref().map(|vec| vec.join(",")),
"--ipc-apis=[APIS]",
2020-08-12 12:00:28 +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, 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",
2020-08-05 06:08:03 +02:00
["Secret Store Options"]
FLAG flag_no_secretstore: (bool) = false, or |c: &Config| c.secretstore.as_ref()?.disable.clone(),
"--no-secretstore",
"Disable Secret Store functionality.",
2020-08-05 06:08:03 +02:00
FLAG flag_no_secretstore_http: (bool) = false, or |c: &Config| c.secretstore.as_ref()?.disable_http.clone(),
"--no-secretstore-http",
"Disable Secret Store HTTP API.",
2020-08-05 06:08:03 +02:00
FLAG flag_no_secretstore_auto_migrate: (bool) = false, or |c: &Config| c.secretstore.as_ref()?.disable_auto_migrate.clone(),
"--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.",
2020-08-05 06:08:03 +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.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_contract: (Option<String>) = None, or |c: &Config| c.secretstore.as_ref()?.service_contract.clone(),
"--secretstore-contract=[SOURCE]",
"Secret Store Service contract address source: none, registry (contract address is read from 'secretstore_service' entry in registry) or address.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_srv_gen_contract: (Option<String>) = None, or |c: &Config| c.secretstore.as_ref()?.service_contract_srv_gen.clone(),
SecretStore: generating and retrieving decryption keys via service contract (#8029) * SecretStore: started document keys generation via contract * fixed Cargo.lock * SecretStore: doc key contract gen tests * SecretStore: fixed log parsing * SecretStore: flush * SecretStore: secretstore_generateDocumentKey RPC * SecretStore: return encrypted_key from secretstore_generateDocumentKey * prepare to GenerateDocKey -> StoreDocKey * SecretStore: ability to identify requester via Public/Address * SecretStore: store author address instead of public in db * flush * SecretStore: flush * SecretStore: fixed test * SecretStore: flush * SecretStore: flush * SecretStore: flush * SecretStore: flush * SecretStore: start async generation session * SecretStore: process StoreDocumentKey service tasks * SecretStore: flush * SecretStore: update service contact ABI * SecretStore: flush * SecretStore: flush * SecretStore: fixed event * SecretStore: flush * SecretStore: fixed tests * SecretStore: fix broadcast shadows decryption * SecretStore: finally decryption via service contract works * SecretStore: fix for updated contract * SecretStore: restored pending requests reqding * SecretStore: fixed some TODOs * SecretStore: OnChainServiceContractAggregate * SecretStore: different names for different contracts types * SecretStore: updated contracts interfaces * SecretStore: utilize aggregate service contract * fixed compilation * SecretStore: fixes for updated contract * SecretStore: service fixes after testing * fixed cli test compilation * SecretStore: decryption_session_origin_is_known_to_all_initialized_nodes * SecretStore: added new contract listener tests * SecretStore: session_listener_works * removed optional TODO * SecretStore: fixed KeyServer shutdown * fixed warn + grumble * const durations
2018-04-03 16:54:34 +02:00
"--secretstore-srv-gen-contract=[SOURCE]",
"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.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_srv_retr_contract: (Option<String>) = None, or |c: &Config| c.secretstore.as_ref()?.service_contract_srv_retr.clone(),
SecretStore: generating and retrieving decryption keys via service contract (#8029) * SecretStore: started document keys generation via contract * fixed Cargo.lock * SecretStore: doc key contract gen tests * SecretStore: fixed log parsing * SecretStore: flush * SecretStore: secretstore_generateDocumentKey RPC * SecretStore: return encrypted_key from secretstore_generateDocumentKey * prepare to GenerateDocKey -> StoreDocKey * SecretStore: ability to identify requester via Public/Address * SecretStore: store author address instead of public in db * flush * SecretStore: flush * SecretStore: fixed test * SecretStore: flush * SecretStore: flush * SecretStore: flush * SecretStore: flush * SecretStore: start async generation session * SecretStore: process StoreDocumentKey service tasks * SecretStore: flush * SecretStore: update service contact ABI * SecretStore: flush * SecretStore: flush * SecretStore: fixed event * SecretStore: flush * SecretStore: fixed tests * SecretStore: fix broadcast shadows decryption * SecretStore: finally decryption via service contract works * SecretStore: fix for updated contract * SecretStore: restored pending requests reqding * SecretStore: fixed some TODOs * SecretStore: OnChainServiceContractAggregate * SecretStore: different names for different contracts types * SecretStore: updated contracts interfaces * SecretStore: utilize aggregate service contract * fixed compilation * SecretStore: fixes for updated contract * SecretStore: service fixes after testing * fixed cli test compilation * SecretStore: decryption_session_origin_is_known_to_all_initialized_nodes * SecretStore: added new contract listener tests * SecretStore: session_listener_works * removed optional TODO * SecretStore: fixed KeyServer shutdown * fixed warn + grumble * const durations
2018-04-03 16:54:34 +02:00
"--secretstore-srv-retr-contract=[SOURCE]",
"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.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_doc_store_contract: (Option<String>) = None, or |c: &Config| c.secretstore.as_ref()?.service_contract_doc_store.clone(),
SecretStore: generating and retrieving decryption keys via service contract (#8029) * SecretStore: started document keys generation via contract * fixed Cargo.lock * SecretStore: doc key contract gen tests * SecretStore: fixed log parsing * SecretStore: flush * SecretStore: secretstore_generateDocumentKey RPC * SecretStore: return encrypted_key from secretstore_generateDocumentKey * prepare to GenerateDocKey -> StoreDocKey * SecretStore: ability to identify requester via Public/Address * SecretStore: store author address instead of public in db * flush * SecretStore: flush * SecretStore: fixed test * SecretStore: flush * SecretStore: flush * SecretStore: flush * SecretStore: flush * SecretStore: start async generation session * SecretStore: process StoreDocumentKey service tasks * SecretStore: flush * SecretStore: update service contact ABI * SecretStore: flush * SecretStore: flush * SecretStore: fixed event * SecretStore: flush * SecretStore: fixed tests * SecretStore: fix broadcast shadows decryption * SecretStore: finally decryption via service contract works * SecretStore: fix for updated contract * SecretStore: restored pending requests reqding * SecretStore: fixed some TODOs * SecretStore: OnChainServiceContractAggregate * SecretStore: different names for different contracts types * SecretStore: updated contracts interfaces * SecretStore: utilize aggregate service contract * fixed compilation * SecretStore: fixes for updated contract * SecretStore: service fixes after testing * fixed cli test compilation * SecretStore: decryption_session_origin_is_known_to_all_initialized_nodes * SecretStore: added new contract listener tests * SecretStore: session_listener_works * removed optional TODO * SecretStore: fixed KeyServer shutdown * fixed warn + grumble * const durations
2018-04-03 16:54:34 +02:00
"--secretstore-doc-store-contract=[SOURCE]",
"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.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_doc_sretr_contract: (Option<String>) = None, or |c: &Config| c.secretstore.as_ref()?.service_contract_doc_sretr.clone(),
SecretStore: generating and retrieving decryption keys via service contract (#8029) * SecretStore: started document keys generation via contract * fixed Cargo.lock * SecretStore: doc key contract gen tests * SecretStore: fixed log parsing * SecretStore: flush * SecretStore: secretstore_generateDocumentKey RPC * SecretStore: return encrypted_key from secretstore_generateDocumentKey * prepare to GenerateDocKey -> StoreDocKey * SecretStore: ability to identify requester via Public/Address * SecretStore: store author address instead of public in db * flush * SecretStore: flush * SecretStore: fixed test * SecretStore: flush * SecretStore: flush * SecretStore: flush * SecretStore: flush * SecretStore: start async generation session * SecretStore: process StoreDocumentKey service tasks * SecretStore: flush * SecretStore: update service contact ABI * SecretStore: flush * SecretStore: flush * SecretStore: fixed event * SecretStore: flush * SecretStore: fixed tests * SecretStore: fix broadcast shadows decryption * SecretStore: finally decryption via service contract works * SecretStore: fix for updated contract * SecretStore: restored pending requests reqding * SecretStore: fixed some TODOs * SecretStore: OnChainServiceContractAggregate * SecretStore: different names for different contracts types * SecretStore: updated contracts interfaces * SecretStore: utilize aggregate service contract * fixed compilation * SecretStore: fixes for updated contract * SecretStore: service fixes after testing * fixed cli test compilation * SecretStore: decryption_session_origin_is_known_to_all_initialized_nodes * SecretStore: added new contract listener tests * SecretStore: session_listener_works * removed optional TODO * SecretStore: fixed KeyServer shutdown * fixed warn + grumble * const durations
2018-04-03 16:54:34 +02:00
"--secretstore-doc-sretr-contract=[SOURCE]",
"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.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_nodes: (String) = "", or |c: &Config| c.secretstore.as_ref()?.nodes.as_ref().map(|vec| vec.join(",")),
"--secretstore-nodes=[NODES]",
"Comma-separated list of other secret store cluster nodes in form NODE_PUBLIC_KEY_IN_HEX@NODE_IP_ADDR:NODE_PORT.",
2020-08-05 06:08:03 +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.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_interface: (String) = "local", or |c: &Config| c.secretstore.as_ref()?.interface.clone(),
"--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.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_port: (u16) = 8083u16, or |c: &Config| c.secretstore.as_ref()?.port.clone(),
"--secretstore-port=[PORT]",
"Specify the port portion for listening to Secret Store Key Server internal requests.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_http_interface: (String) = "local", or |c: &Config| c.secretstore.as_ref()?.http_interface.clone(),
"--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.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_http_port: (u16) = 8082u16, or |c: &Config| c.secretstore.as_ref()?.http_port.clone(),
"--secretstore-http-port=[PORT]",
"Specify the port portion for listening to Secret Store Key Server HTTP requests.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_path: (String) = "$BASE/secretstore", or |c: &Config| c.secretstore.as_ref()?.path.clone(),
"--secretstore-path=[PATH]",
"Specify directory where Secret Store should save its data.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_secret: (Option<String>) = None, or |c: &Config| c.secretstore.as_ref()?.self_secret.clone(),
"--secretstore-secret=[SECRET]",
"Hex-encoded secret key of this node.",
2020-08-05 06:08:03 +02:00
ARG arg_secretstore_admin_public: (Option<String>) = None, or |c: &Config| c.secretstore.as_ref()?.admin_public.clone(),
"--secretstore-admin=[PUBLIC]",
SecretStore: administrative sessions prototypes (#6605) * generate random channel encryption key on restart * session-level nonces * fixed warning after rebase * session_nonce -> nonce * full_generation_math_session_with_refreshing_shares && full_generation_math_session_with_adding_new_node * add serveral secret shares at once * SecretStore: initial ShareAdd session prototype * SecretStore: ServersSetChange jobs * SecretStore: servers set change session continued * SecretStore: servers set change session continued * SecretStore: servers set change session continued * SecretStore: known_sessions iterator * SecretStore: implemented SessionsQueue * SecretStore: UnknownSessionsJobTransport * SecretStore: node_added_using_servers_set_change almost done * SecretStore: continue adding tests * SecretStore: node_added_using_servers_set_change + node_added_using_share_add * SecretStore: node_added_using_server_set_change_from_this_node * SecretStore: node_moved_using_share_move * SecretStore: node_moved_using_servers_set_change * SecretStore: node_removed_using_share_remove * SecretStore: node_removed_using_servers_set_change * SecretStore: different folders for client && admin sessions * SecretStore: started adding share change consensus (flush) * SecretStore: fixed spurious tests failures * enum JobPartialRequestAction * SecretStore: started adding consensus layer to ShareAdd session * SecretStore: starting external consensus for ShareAdd * SecretStore: started restoring node_added_using_servers_set_change * SecretStore: node_added_using_servers_set_change works with external consensus * SecretStore: node_added_using_server_set_change_from_this_node works with external consensus * removed debug comments/printlns * SecretStore: share move session supports consensus * SecretStore: share remove with external consensus * SecretStore: started adding basic ShareAdd tests * SecretStore: added ShareAdd tests * SecretStore: added ShareAdd session to cluster * SecretStore: added share move && remove sessions to cluster * SecretStore: ShareMove session tests cleanup * SecretStore: ShareRemove session tests cleanup * SecretStore: added check_secret_is_preserved check * SecretStore: added servers set change to cluster * SecretStore: cleaned up ServersSetChange session tests * SecretStore: cleaning + added tests for ShareRemove * SecretStore: cleaning up * SecretStore: propagated admin_public * SecretStore: fixed persistent_key_storage test * SecretStore: upgrade_db_from_1 * SecretStore: fixed ServersSetChange session completion * SecretStore: check polynom1 in ShareAdd sessions (error for pre-v2 shares) * SecretStore: fixing TODOs * SecretStore: fixing TODOs * SecretStore: check share change plan on 'old' slave nodes * SecretStore: fixing TODOs * SecretStore: store all admin sessions in single container to avoid overlaps * SecretStore: do not update nodes set during admin sessions * SecretStore: moved TODOs to appropriate methods * SecretStore: TODOs * SecretStore: added admin_public arg && fixed warnigs * SecretStore: added shares_to_move_reversed to ShareMove session * SecretStore: additional checks during consensus establishing * license * SecretStore: added TODO about starting ServersSetChange session * SecretStore: redundant clones + docs + lsot unimplemented-s * SecretStore: generation_session_completion_signalled_if_failed_on_master * SecretStore: updated obsolete comment * SecretStore: added type alias for current DocumentKeyShare serialization format * SecretStore: fixed typo * SecretStore; fixed warnings for futures 0.1.15 * fixed warning
2017-10-02 15:27:31 +02:00
"Hex-encoded public key of secret store administrator.",
2020-08-05 06:08:03 +02:00
["Sealing/Mining Options"]
FLAG flag_force_sealing: (bool) = false, or |c: &Config| c.mining.as_ref()?.force_sealing.clone(),
"--force-sealing",
"Force the node to author new blocks as if it were always sealing/mining.",
FLAG flag_reseal_on_uncle: (bool) = false, or |c: &Config| c.mining.as_ref()?.reseal_on_uncle.clone(),
"--reseal-on-uncle",
"Force the node to author new blocks when a new uncle block is imported.",
FLAG flag_remove_solved: (bool) = false, or |c: &Config| c.mining.as_ref()?.remove_solved.clone(),
"--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.",
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",
"Local transactions sent through JSON-RPC (HTTP, WebSockets, etc) will be treated as 'external' if the sending account is unknown.",
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.",
FLAG flag_refuse_service_transactions: (bool) = false, or |c: &Config| c.mining.as_ref()?.refuse_service_transactions.clone(),
"--refuse-service-transactions",
"Always refuse service transactions.",
FLAG flag_infinite_pending_block: (bool) = false, or |c: &Config| c.mining.as_ref()?.infinite_pending_block.clone(),
"--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.",
FLAG flag_no_persistent_txqueue: (bool) = false, or |c: &Config| c.parity.as_ref()?.no_persistent_txqueue,
"--no-persistent-txqueue",
"Don't save pending local transactions to disk to be restored whenever the node restarts.",
FLAG flag_stratum: (bool) = false, or |c: &Config| Some(c.stratum.is_some()),
"--stratum",
"Run Stratum server for miner push notification.",
ARG arg_reseal_on_txs: (String) = "own", or |c: &Config| c.mining.as_ref()?.reseal_on_txs.clone(),
"--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.",
ARG arg_reseal_min_period: (u64) = 2000u64, or |c: &Config| c.mining.as_ref()?.reseal_min_period.clone(),
"--reseal-min-period=[MS]",
"Specify the minimum time between reseals from incoming transactions. MS is time measured in milliseconds.",
ARG arg_reseal_max_period: (u64) = 120000u64, or |c: &Config| c.mining.as_ref()?.reseal_max_period.clone(),
"--reseal-max-period=[MS]",
"Specify the maximum time since last block to enable force-sealing. MS is time measured in milliseconds.",
2020-08-05 06:08:03 +02:00
ARG arg_work_queue_size: (usize) = 20usize, or |c: &Config| c.mining.as_ref()?.work_queue_size.clone(),
"--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.",
2020-08-05 06:08:03 +02:00
ARG arg_relay_set: (String) = "cheap", or |c: &Config| c.mining.as_ref()?.relay_set.clone(),
"--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.",
2020-08-05 06:08:03 +02:00
ARG arg_usd_per_tx: (String) = "0.0001", or |c: &Config| c.mining.as_ref()?.usd_per_tx.clone(),
"--usd-per-tx=[USD]",
"Amount of USD to be paid for a basic transaction. The minimum gas price is set accordingly.",
2020-08-05 06:08:03 +02:00
ARG arg_usd_per_eth: (String) = "auto", or |c: &Config| c.mining.as_ref()?.usd_per_eth.clone(),
"--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.",
2020-08-05 06:08:03 +02:00
ARG arg_price_update_period: (String) = "hourly", or |c: &Config| c.mining.as_ref()?.price_update_period.clone(),
"--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..",
2020-08-05 06:08:03 +02:00
ARG arg_gas_floor_target: (String) = "8000000", or |c: &Config| c.mining.as_ref()?.gas_floor_target.clone(),
"--gas-floor-target=[GAS]",
"Amount of gas per block to target when sealing a new block.",
2020-08-05 06:08:03 +02:00
ARG arg_gas_cap: (String) = "10000000", or |c: &Config| c.mining.as_ref()?.gas_cap.clone(),
"--gas-cap=[GAS]",
"A cap on how large we will raise the gas limit per block due to transaction volume.",
2020-08-05 06:08:03 +02:00
New Transaction Queue implementation (#8074) * Implementation of Verifier, Scoring and Ready. * Queue in progress. * TransactionPool. * Prepare for txpool release. * Miner refactor [WiP] * WiP reworking miner. * Make it compile. * Add some docs. * Split blockchain access to a separate file. * Work on miner API. * Fix ethcore tests. * Refactor miner interface for sealing/work packages. * Implement next nonce. * RPC compiles. * Implement couple of missing methdods for RPC. * Add transaction queue listeners. * Compiles! * Clean-up and parallelize. * Get rid of RefCell in header. * Revert "Get rid of RefCell in header." This reverts commit 0f2424c9b7319a786e1565ea2a8a6d801a21b4fb. * Override Sync requirement. * Fix status display. * Unify logging. * Extract some cheap checks. * Measurements and optimizations. * Fix scoring bug, heap size of bug and add cache * Disable tx queueing and parallel verification. * Make ethcore and ethcore-miner compile again. * Make RPC compile again. * Bunch of txpool tests. * Migrate transaction queue tests. * Nonce Cap * Nonce cap cache and tests. * Remove stale future transactions from the queue. * Optimize scoring and write some tests. * Simple penalization. * Clean up and support for different scoring algorithms. * Add CLI parameters for the new queue. * Remove banning queue. * Disable debug build. * Change per_sender limit to be 1% instead of 5% * Avoid cloning when propagating transactions. * Remove old todo. * Post-review fixes. * Fix miner options default. * Implement back ready transactions for light client. * Get rid of from_pending_block * Pass rejection reason. * Add more details to drop. * Rollback heap size of. * Avoid cloning hashes when propagating and include more details on rejection. * Fix tests. * Introduce nonces cache. * Remove uneccessary hashes allocation. * Lower the mem limit. * Re-enable parallel verification. * Add miner log. Don't check the type if not below min_gas_price. * Add more traces, fix disabling miner. * Fix creating pending blocks twice on AuRa authorities. * Fix tests. * re-use pending blocks in AuRa * Use reseal_min_period to prevent too frequent update_sealing. * Fix log to contain hash not sender. * Optimize local transactions. * Fix aura tests. * Update locks comments. * Get rid of unsafe Sync impl. * Review fixes. * Remove excessive matches. * Fix compilation errors. * Use new pool in private transactions. * Fix private-tx test. * Fix secret store tests. * Actually use gas_floor_target * Fix config tests. * Fix pool tests. * Address grumbles.
2018-04-13 17:34:27 +02:00
ARG arg_tx_queue_mem_limit: (u32) = 4u32, or |c: &Config| c.mining.as_ref()?.tx_queue_mem_limit.clone(),
"--tx-queue-mem-limit=[MB]",
"Maximum amount of memory that can be used by the transaction queue. Setting this parameter to 0 disables limiting.",
2020-08-05 06:08:03 +02:00
New Transaction Queue implementation (#8074) * Implementation of Verifier, Scoring and Ready. * Queue in progress. * TransactionPool. * Prepare for txpool release. * Miner refactor [WiP] * WiP reworking miner. * Make it compile. * Add some docs. * Split blockchain access to a separate file. * Work on miner API. * Fix ethcore tests. * Refactor miner interface for sealing/work packages. * Implement next nonce. * RPC compiles. * Implement couple of missing methdods for RPC. * Add transaction queue listeners. * Compiles! * Clean-up and parallelize. * Get rid of RefCell in header. * Revert "Get rid of RefCell in header." This reverts commit 0f2424c9b7319a786e1565ea2a8a6d801a21b4fb. * Override Sync requirement. * Fix status display. * Unify logging. * Extract some cheap checks. * Measurements and optimizations. * Fix scoring bug, heap size of bug and add cache * Disable tx queueing and parallel verification. * Make ethcore and ethcore-miner compile again. * Make RPC compile again. * Bunch of txpool tests. * Migrate transaction queue tests. * Nonce Cap * Nonce cap cache and tests. * Remove stale future transactions from the queue. * Optimize scoring and write some tests. * Simple penalization. * Clean up and support for different scoring algorithms. * Add CLI parameters for the new queue. * Remove banning queue. * Disable debug build. * Change per_sender limit to be 1% instead of 5% * Avoid cloning when propagating transactions. * Remove old todo. * Post-review fixes. * Fix miner options default. * Implement back ready transactions for light client. * Get rid of from_pending_block * Pass rejection reason. * Add more details to drop. * Rollback heap size of. * Avoid cloning hashes when propagating and include more details on rejection. * Fix tests. * Introduce nonces cache. * Remove uneccessary hashes allocation. * Lower the mem limit. * Re-enable parallel verification. * Add miner log. Don't check the type if not below min_gas_price. * Add more traces, fix disabling miner. * Fix creating pending blocks twice on AuRa authorities. * Fix tests. * re-use pending blocks in AuRa * Use reseal_min_period to prevent too frequent update_sealing. * Fix log to contain hash not sender. * Optimize local transactions. * Fix aura tests. * Update locks comments. * Get rid of unsafe Sync impl. * Review fixes. * Remove excessive matches. * Fix compilation errors. * Use new pool in private transactions. * Fix private-tx test. * Fix secret store tests. * Actually use gas_floor_target * Fix config tests. * Fix pool tests. * Address grumbles.
2018-04-13 17:34:27 +02:00
ARG arg_tx_queue_size: (usize) = 8_192usize, or |c: &Config| c.mining.as_ref()?.tx_queue_size.clone(),
"--tx-queue-size=[LIMIT]",
"Maximum amount of transactions in the queue (waiting to be included in next block).",
2020-08-05 06:08:03 +02:00
New Transaction Queue implementation (#8074) * Implementation of Verifier, Scoring and Ready. * Queue in progress. * TransactionPool. * Prepare for txpool release. * Miner refactor [WiP] * WiP reworking miner. * Make it compile. * Add some docs. * Split blockchain access to a separate file. * Work on miner API. * Fix ethcore tests. * Refactor miner interface for sealing/work packages. * Implement next nonce. * RPC compiles. * Implement couple of missing methdods for RPC. * Add transaction queue listeners. * Compiles! * Clean-up and parallelize. * Get rid of RefCell in header. * Revert "Get rid of RefCell in header." This reverts commit 0f2424c9b7319a786e1565ea2a8a6d801a21b4fb. * Override Sync requirement. * Fix status display. * Unify logging. * Extract some cheap checks. * Measurements and optimizations. * Fix scoring bug, heap size of bug and add cache * Disable tx queueing and parallel verification. * Make ethcore and ethcore-miner compile again. * Make RPC compile again. * Bunch of txpool tests. * Migrate transaction queue tests. * Nonce Cap * Nonce cap cache and tests. * Remove stale future transactions from the queue. * Optimize scoring and write some tests. * Simple penalization. * Clean up and support for different scoring algorithms. * Add CLI parameters for the new queue. * Remove banning queue. * Disable debug build. * Change per_sender limit to be 1% instead of 5% * Avoid cloning when propagating transactions. * Remove old todo. * Post-review fixes. * Fix miner options default. * Implement back ready transactions for light client. * Get rid of from_pending_block * Pass rejection reason. * Add more details to drop. * Rollback heap size of. * Avoid cloning hashes when propagating and include more details on rejection. * Fix tests. * Introduce nonces cache. * Remove uneccessary hashes allocation. * Lower the mem limit. * Re-enable parallel verification. * Add miner log. Don't check the type if not below min_gas_price. * Add more traces, fix disabling miner. * Fix creating pending blocks twice on AuRa authorities. * Fix tests. * re-use pending blocks in AuRa * Use reseal_min_period to prevent too frequent update_sealing. * Fix log to contain hash not sender. * Optimize local transactions. * Fix aura tests. * Update locks comments. * Get rid of unsafe Sync impl. * Review fixes. * Remove excessive matches. * Fix compilation errors. * Use new pool in private transactions. * Fix private-tx test. * Fix secret store tests. * Actually use gas_floor_target * Fix config tests. * Fix pool tests. * Address grumbles.
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.",
2020-08-05 06:08:03 +02: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.",
2020-08-05 06:08:03 +02:00
ARG arg_tx_queue_strategy: (String) = "gas_price", or |c: &Config| c.mining.as_ref()?.tx_queue_strategy.clone(),
"--tx-queue-strategy=[S]",
New Transaction Queue implementation (#8074) * Implementation of Verifier, Scoring and Ready. * Queue in progress. * TransactionPool. * Prepare for txpool release. * Miner refactor [WiP] * WiP reworking miner. * Make it compile. * Add some docs. * Split blockchain access to a separate file. * Work on miner API. * Fix ethcore tests. * Refactor miner interface for sealing/work packages. * Implement next nonce. * RPC compiles. * Implement couple of missing methdods for RPC. * Add transaction queue listeners. * Compiles! * Clean-up and parallelize. * Get rid of RefCell in header. * Revert "Get rid of RefCell in header." This reverts commit 0f2424c9b7319a786e1565ea2a8a6d801a21b4fb. * Override Sync requirement. * Fix status display. * Unify logging. * Extract some cheap checks. * Measurements and optimizations. * Fix scoring bug, heap size of bug and add cache * Disable tx queueing and parallel verification. * Make ethcore and ethcore-miner compile again. * Make RPC compile again. * Bunch of txpool tests. * Migrate transaction queue tests. * Nonce Cap * Nonce cap cache and tests. * Remove stale future transactions from the queue. * Optimize scoring and write some tests. * Simple penalization. * Clean up and support for different scoring algorithms. * Add CLI parameters for the new queue. * Remove banning queue. * Disable debug build. * Change per_sender limit to be 1% instead of 5% * Avoid cloning when propagating transactions. * Remove old todo. * Post-review fixes. * Fix miner options default. * Implement back ready transactions for light client. * Get rid of from_pending_block * Pass rejection reason. * Add more details to drop. * Rollback heap size of. * Avoid cloning hashes when propagating and include more details on rejection. * Fix tests. * Introduce nonces cache. * Remove uneccessary hashes allocation. * Lower the mem limit. * Re-enable parallel verification. * Add miner log. Don't check the type if not below min_gas_price. * Add more traces, fix disabling miner. * Fix creating pending blocks twice on AuRa authorities. * Fix tests. * re-use pending blocks in AuRa * Use reseal_min_period to prevent too frequent update_sealing. * Fix log to contain hash not sender. * Optimize local transactions. * Fix aura tests. * Update locks comments. * Get rid of unsafe Sync impl. * Review fixes. * Remove excessive matches. * Fix compilation errors. * Use new pool in private transactions. * Fix private-tx test. * Fix secret store tests. * Actually use gas_floor_target * Fix config tests. * Fix pool tests. * Address grumbles.
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",
2020-08-05 06:08:03 +02:00
ARG arg_stratum_interface: (String) = "local", or |c: &Config| c.stratum.as_ref()?.interface.clone(),
"--stratum-interface=[IP]",
"Interface address for Stratum server.",
2020-08-05 06:08:03 +02:00
ARG arg_stratum_port: (u16) = 8008u16, or |c: &Config| c.stratum.as_ref()?.port.clone(),
"--stratum-port=[PORT]",
"Port for Stratum server to listen on.",
ARG arg_min_gas_price: (Option<u64>) = None, or |c: &Config| c.mining.as_ref()?.min_gas_price.clone(),
"--min-gas-price=[STRING]",
"Minimum amount of Wei per GAS to be paid for a transaction to be accepted for mining. Overrides --usd-per-tx.",
ARG arg_gas_price_percentile: (usize) = 50usize, or |c: &Config| c.mining.as_ref()?.gas_price_percentile,
"--gas-price-percentile=[PCT]",
"Set PCT percentile gas price value from last 100 blocks as default gas price when sending transactions.",
ARG arg_author: (Option<String>) = None, or |c: &Config| c.mining.as_ref()?.author.clone(),
"--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
ARG arg_engine_signer: (Option<String>) = None, or |c: &Config| c.mining.as_ref()?.engine_signer.clone(),
"--engine-signer=[ADDRESS]",
"Specify the address which should be used to sign consensus messages and issue blocks. Relevant only to non-PoW chains.",
ARG arg_tx_gas_limit: (Option<String>) = None, or |c: &Config| c.mining.as_ref()?.tx_gas_limit.clone(),
"--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.",
ARG arg_tx_time_limit: (Option<u64>) = None, or |c: &Config| c.mining.as_ref()?.tx_time_limit.clone(),
"--tx-time-limit=[MS]",
New Transaction Queue implementation (#8074) * Implementation of Verifier, Scoring and Ready. * Queue in progress. * TransactionPool. * Prepare for txpool release. * Miner refactor [WiP] * WiP reworking miner. * Make it compile. * Add some docs. * Split blockchain access to a separate file. * Work on miner API. * Fix ethcore tests. * Refactor miner interface for sealing/work packages. * Implement next nonce. * RPC compiles. * Implement couple of missing methdods for RPC. * Add transaction queue listeners. * Compiles! * Clean-up and parallelize. * Get rid of RefCell in header. * Revert "Get rid of RefCell in header." This reverts commit 0f2424c9b7319a786e1565ea2a8a6d801a21b4fb. * Override Sync requirement. * Fix status display. * Unify logging. * Extract some cheap checks. * Measurements and optimizations. * Fix scoring bug, heap size of bug and add cache * Disable tx queueing and parallel verification. * Make ethcore and ethcore-miner compile again. * Make RPC compile again. * Bunch of txpool tests. * Migrate transaction queue tests. * Nonce Cap * Nonce cap cache and tests. * Remove stale future transactions from the queue. * Optimize scoring and write some tests. * Simple penalization. * Clean up and support for different scoring algorithms. * Add CLI parameters for the new queue. * Remove banning queue. * Disable debug build. * Change per_sender limit to be 1% instead of 5% * Avoid cloning when propagating transactions. * Remove old todo. * Post-review fixes. * Fix miner options default. * Implement back ready transactions for light client. * Get rid of from_pending_block * Pass rejection reason. * Add more details to drop. * Rollback heap size of. * Avoid cloning hashes when propagating and include more details on rejection. * Fix tests. * Introduce nonces cache. * Remove uneccessary hashes allocation. * Lower the mem limit. * Re-enable parallel verification. * Add miner log. Don't check the type if not below min_gas_price. * Add more traces, fix disabling miner. * Fix creating pending blocks twice on AuRa authorities. * Fix tests. * re-use pending blocks in AuRa * Use reseal_min_period to prevent too frequent update_sealing. * Fix log to contain hash not sender. * Optimize local transactions. * Fix aura tests. * Update locks comments. * Get rid of unsafe Sync impl. * Review fixes. * Remove excessive matches. * Fix compilation errors. * Use new pool in private transactions. * Fix private-tx test. * Fix secret store tests. * Actually use gas_floor_target * Fix config tests. * Fix pool tests. * Address grumbles.
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.",
ARG arg_extra_data: (Option<String>) = None, or |c: &Config| c.mining.as_ref()?.extra_data.clone(),
"--extra-data=[STRING]",
"Specify a custom extra-data for authored blocks, no more than 32 characters.",
2020-08-05 06:08:03 +02:00
ARG arg_notify_work: (Option<String>) = None, or |c: &Config| c.mining.as_ref()?.notify_work.as_ref().map(|vec| vec.join(",")),
"--notify-work=[URLS]",
"URLs to which work package notifications are pushed. URLS should be a comma-delimited list of HTTP URLs.",
2020-08-05 06:08:03 +02:00
ARG arg_stratum_secret: (Option<String>) = None, or |c: &Config| c.stratum.as_ref()?.secret.clone(),
"--stratum-secret=[STRING]",
"Secret for authorizing Stratum server for peers.",
2020-08-05 06:08:03 +02:00
ARG arg_max_round_blocks_to_import: (usize) = 12usize, 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.",
2020-08-05 06:08:03 +02:00
["Internal Options"]
FLAG flag_can_restart: (bool) = false, or |_| None,
"--can-restart",
"Executable will auto-restart if exiting with 69",
2020-08-05 06:08:03 +02:00
["Miscellaneous Options"]
FLAG flag_no_color: (bool) = false, or |c: &Config| c.misc.as_ref()?.color.map(|c| !c).clone(),
"--no-color",
"Don't use terminal color codes in output.",
2020-08-05 06:08:03 +02:00
FLAG flag_version: (bool) = false, or |_| None,
"-v, --version",
"Show information about version.",
2020-08-05 06:08:03 +02:00
FLAG flag_no_config: (bool) = false, or |_| None,
"--no-config",
"Don't load a configuration file.",
2020-08-05 06:08:03 +02:00
ARG arg_logging: (Option<String>) = None, or |c: &Config| c.misc.as_ref()?.logging.clone(),
"-l, --logging=[LOGGING]",
"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'",
2020-08-05 06:08:03 +02:00
ARG arg_log_file: (Option<String>) = None, or |c: &Config| c.misc.as_ref()?.log_file.clone(),
"--log-file=[FILENAME]",
"Specify a filename into which logging should be appended.",
2020-08-05 06:08:03 +02:00
["Footprint Options"]
FLAG flag_scale_verifiers: (bool) = false, or |c: &Config| c.footprint.as_ref()?.scale_verifiers.clone(),
"--scale-verifiers",
"Automatically scale amount of verifier threads based on workload. Not guaranteed to be faster.",
2020-08-05 06:08:03 +02:00
ARG arg_tracing: (String) = "auto", or |c: &Config| c.footprint.as_ref()?.tracing.clone(),
"--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
2020-08-05 06:08:03 +02:00
ARG arg_pruning: (String) = "auto", or |c: &Config| c.footprint.as_ref()?.pruning.clone(),
"--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.",
2020-08-05 06:08:03 +02:00
ARG arg_pruning_history: (u64) = 64u64, or |c: &Config| c.footprint.as_ref()?.pruning_history.clone(),
"--pruning-history=[NUM]",
"Set a minimum number of recent states to keep in memory when pruning is active.",
2020-08-05 06:08:03 +02:00
ARG arg_pruning_memory: (usize) = 32usize, or |c: &Config| c.footprint.as_ref()?.pruning_memory.clone(),
"--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.",
2020-08-05 06:08:03 +02:00
ARG arg_cache_size_db: (u32) = 128u32, or |c: &Config| c.footprint.as_ref()?.cache_size_db.clone(),
"--cache-size-db=[MB]",
"Override database cache size.",
2020-08-05 06:08:03 +02:00
ARG arg_cache_size_blocks: (u32) = 8u32, or |c: &Config| c.footprint.as_ref()?.cache_size_blocks.clone(),
"--cache-size-blocks=[MB]",
"Specify the preferred size of the blockchain cache in megabytes.",
2020-08-05 06:08:03 +02:00
ARG arg_cache_size_queue: (u32) = 40u32, or |c: &Config| c.footprint.as_ref()?.cache_size_queue.clone(),
"--cache-size-queue=[MB]",
"Specify the maximum size of memory to use for block queue.",
ARG arg_cache_size_state: (u32) = 25u32, or |c: &Config| c.footprint.as_ref()?.cache_size_state.clone(),
"--cache-size-state=[MB]",
"Specify the maximum size of memory to use for the state cache.",
ARG arg_db_compaction: (String) = "auto", or |c: &Config| c.footprint.as_ref()?.db_compaction.clone(),
"--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.",
ARG arg_fat_db: (String) = "auto", or |c: &Config| c.footprint.as_ref()?.fat_db.clone(),
"--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.",
ARG arg_cache_size: (Option<u32>) = None, or |c: &Config| c.footprint.as_ref()?.cache_size.clone(),
"--cache-size=[MB]",
"Set total amount of discretionary memory to use for the entire system, overrides other cache and queue options.",
ARG arg_num_verifiers: (Option<usize>) = None, or |c: &Config| c.footprint.as_ref()?.num_verifiers.clone(),
"--num-verifiers=[INT]",
"Amount of verifier threads to use or to begin with, if verifier auto-scaling is enabled.",
["Import/export Options"]
FLAG flag_no_seal_check: (bool) = false, or |_| None,
"--no-seal-check",
"Skip block seal check.",
["Snapshot Options"]
2020-09-15 16:51:49 +02:00
FLAG flag_enable_snapshotting: (bool) = false, or |c: &Config| c.snapshots.as_ref()?.enable.clone(),
"--enable-snapshotting",
"Enable automated snapshots which usually occur once every 5000 blocks.",
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.",
}
2016-09-10 11:37:14 +02:00
}
2017-07-06 11:36:15 +02:00
#[derive(Default, Debug, PartialEq, Deserialize)]
#[serde(deny_unknown_fields)]
2016-09-10 11:37:14 +02:00
struct Config {
parity: Option<Operating>,
account: Option<Account>,
ui: Option<Ui>,
network: Option<Network>,
rpc: Option<Rpc>,
websockets: Option<Ws>,
ipc: Option<Ipc>,
secretstore: Option<SecretStore>,
mining: Option<Mining>,
footprint: Option<Footprint>,
snapshots: Option<Snapshots>,
misc: Option<Misc>,
stratum: Option<Stratum>,
metrics: Option<Metrics>,
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>,
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>,
no_persistent_txqueue: 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>,
refresh_time: Option<u64>,
2017-06-06 18:06:40 +02:00
fast_unlock: 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)]
struct Ui {
2016-09-10 11:37:14 +02:00
path: 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 Network {
warp: Option<bool>,
warp_barrier: Option<u64>,
2016-09-10 11:37:14 +02:00
port: Option<u16>,
interface: Option<String>,
2016-09-10 11:37:14 +02:00
min_peers: Option<u16>,
max_peers: Option<u16>,
snapshot_peers: Option<u16>,
max_pending_peers: Option<u16>,
2016-09-10 11:37:14 +02:00
nat: Option<String>,
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-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>,
cors: Option<Vec<String>>,
2016-09-10 11:37:14 +02:00
apis: Option<Vec<String>>,
hosts: Option<Vec<String>>,
server_threads: Option<usize>,
processing_threads: Option<usize>,
max_payload: Option<usize>,
keep_alive: Option<bool>,
experimental_rpcs: Option<bool>,
poll_lifetime: Option<u32>,
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)]
struct Ws {
disable: Option<bool>,
port: Option<u16>,
interface: Option<String>,
apis: Option<Vec<String>>,
origins: Option<Vec<String>>,
hosts: Option<Vec<String>>,
max_connections: Option<usize>,
}
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>>,
}
#[derive(Default, Debug, PartialEq, Deserialize)]
#[serde(deny_unknown_fields)]
struct Metrics {
enable: Option<bool>,
port: Option<u16>,
interface: 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)]
struct SecretStore {
disable: Option<bool>,
2017-07-27 12:29:09 +02:00
disable_http: Option<bool>,
disable_auto_migrate: Option<bool>,
acl_contract: Option<String>,
service_contract: Option<String>,
SecretStore: generating and retrieving decryption keys via service contract (#8029) * SecretStore: started document keys generation via contract * fixed Cargo.lock * SecretStore: doc key contract gen tests * SecretStore: fixed log parsing * SecretStore: flush * SecretStore: secretstore_generateDocumentKey RPC * SecretStore: return encrypted_key from secretstore_generateDocumentKey * prepare to GenerateDocKey -> StoreDocKey * SecretStore: ability to identify requester via Public/Address * SecretStore: store author address instead of public in db * flush * SecretStore: flush * SecretStore: fixed test * SecretStore: flush * SecretStore: flush * SecretStore: flush * SecretStore: flush * SecretStore: start async generation session * SecretStore: process StoreDocumentKey service tasks * SecretStore: flush * SecretStore: update service contact ABI * SecretStore: flush * SecretStore: flush * SecretStore: fixed event * SecretStore: flush * SecretStore: fixed tests * SecretStore: fix broadcast shadows decryption * SecretStore: finally decryption via service contract works * SecretStore: fix for updated contract * SecretStore: restored pending requests reqding * SecretStore: fixed some TODOs * SecretStore: OnChainServiceContractAggregate * SecretStore: different names for different contracts types * SecretStore: updated contracts interfaces * SecretStore: utilize aggregate service contract * fixed compilation * SecretStore: fixes for updated contract * SecretStore: service fixes after testing * fixed cli test compilation * SecretStore: decryption_session_origin_is_known_to_all_initialized_nodes * SecretStore: added new contract listener tests * SecretStore: session_listener_works * removed optional TODO * SecretStore: fixed KeyServer shutdown * fixed warn + grumble * const durations
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>,
Fixing secretstore TODOs - part 1 (#5386) * ECDKG protocol prototype * added test for enc/dec math * get rid of decryption_session * added licenses * fix after merge * get rid of unused serde dependency * doc * decryption session [without commutative enc] * failed_dec_session * fixed tests * added commen * added more decryption session tests * helper to localize an issue * more computations to localize error * decryption_session::SessionParams * added tests for EC math to localize problem * secretstore network transport * encryption_session_works_over_network * network errors processing * connecting to KeyServer * licenses * get rid of debug println-s * fixed secretstore args * encryption results are stored in KS database * decryption protocol works over network * enc/dec Session traits * fixing warnings * fix after merge * on-chain ACL checker proto * fixed compilation * fixed compilation * finally fixed <odd>-of-N-scheme * temporary commented test * 1-of-N works in math * scheme 1-of-N works * updated AclStorage with real contract ABI * remove unnecessary unsafety * fixed grumbles * wakeup on access denied * encrypt secretstore messages * 'shadow' decryption * fix grumbles * lost files * secretstore cli-options * decryption seccion when ACL check failed on master * disallow regenerating key for existing document * removed obsolete TODO * fix after merge * switched to tokio_io * fix after merge * fix after merge * fix after merge * fix after merge * fix after merge * fixed test * fix after merge
2017-04-08 11:26:16 +02:00
self_secret: Option<String>,
SecretStore: administrative sessions prototypes (#6605) * generate random channel encryption key on restart * session-level nonces * fixed warning after rebase * session_nonce -> nonce * full_generation_math_session_with_refreshing_shares && full_generation_math_session_with_adding_new_node * add serveral secret shares at once * SecretStore: initial ShareAdd session prototype * SecretStore: ServersSetChange jobs * SecretStore: servers set change session continued * SecretStore: servers set change session continued * SecretStore: servers set change session continued * SecretStore: known_sessions iterator * SecretStore: implemented SessionsQueue * SecretStore: UnknownSessionsJobTransport * SecretStore: node_added_using_servers_set_change almost done * SecretStore: continue adding tests * SecretStore: node_added_using_servers_set_change + node_added_using_share_add * SecretStore: node_added_using_server_set_change_from_this_node * SecretStore: node_moved_using_share_move * SecretStore: node_moved_using_servers_set_change * SecretStore: node_removed_using_share_remove * SecretStore: node_removed_using_servers_set_change * SecretStore: different folders for client && admin sessions * SecretStore: started adding share change consensus (flush) * SecretStore: fixed spurious tests failures * enum JobPartialRequestAction * SecretStore: started adding consensus layer to ShareAdd session * SecretStore: starting external consensus for ShareAdd * SecretStore: started restoring node_added_using_servers_set_change * SecretStore: node_added_using_servers_set_change works with external consensus * SecretStore: node_added_using_server_set_change_from_this_node works with external consensus * removed debug comments/printlns * SecretStore: share move session supports consensus * SecretStore: share remove with external consensus * SecretStore: started adding basic ShareAdd tests * SecretStore: added ShareAdd tests * SecretStore: added ShareAdd session to cluster * SecretStore: added share move && remove sessions to cluster * SecretStore: ShareMove session tests cleanup * SecretStore: ShareRemove session tests cleanup * SecretStore: added check_secret_is_preserved check * SecretStore: added servers set change to cluster * SecretStore: cleaned up ServersSetChange session tests * SecretStore: cleaning + added tests for ShareRemove * SecretStore: cleaning up * SecretStore: propagated admin_public * SecretStore: fixed persistent_key_storage test * SecretStore: upgrade_db_from_1 * SecretStore: fixed ServersSetChange session completion * SecretStore: check polynom1 in ShareAdd sessions (error for pre-v2 shares) * SecretStore: fixing TODOs * SecretStore: fixing TODOs * SecretStore: check share change plan on 'old' slave nodes * SecretStore: fixing TODOs * SecretStore: store all admin sessions in single container to avoid overlaps * SecretStore: do not update nodes set during admin sessions * SecretStore: moved TODOs to appropriate methods * SecretStore: TODOs * SecretStore: added admin_public arg && fixed warnigs * SecretStore: added shares_to_move_reversed to ShareMove session * SecretStore: additional checks during consensus establishing * license * SecretStore: added TODO about starting ServersSetChange session * SecretStore: redundant clones + docs + lsot unimplemented-s * SecretStore: generation_session_completion_signalled_if_failed_on_master * SecretStore: updated obsolete comment * SecretStore: added type alias for current DocumentKeyShare serialization format * SecretStore: fixed typo * SecretStore; fixed warnings for futures 0.1.15 * fixed warning
2017-10-02 15:27:31 +02:00
admin_public: Option<String>,
Fixing secretstore TODOs - part 1 (#5386) * ECDKG protocol prototype * added test for enc/dec math * get rid of decryption_session * added licenses * fix after merge * get rid of unused serde dependency * doc * decryption session [without commutative enc] * failed_dec_session * fixed tests * added commen * added more decryption session tests * helper to localize an issue * more computations to localize error * decryption_session::SessionParams * added tests for EC math to localize problem * secretstore network transport * encryption_session_works_over_network * network errors processing * connecting to KeyServer * licenses * get rid of debug println-s * fixed secretstore args * encryption results are stored in KS database * decryption protocol works over network * enc/dec Session traits * fixing warnings * fix after merge * on-chain ACL checker proto * fixed compilation * fixed compilation * finally fixed <odd>-of-N-scheme * temporary commented test * 1-of-N works in math * scheme 1-of-N works * updated AclStorage with real contract ABI * remove unnecessary unsafety * fixed grumbles * wakeup on access denied * encrypt secretstore messages * 'shadow' decryption * fix grumbles * lost files * secretstore cli-options * decryption seccion when ACL check failed on master * disallow regenerating key for existing document * removed obsolete TODO * fix after merge * switched to tokio_io * fix after merge * fix after merge * fix after merge * fix after merge * fix after merge * fixed test * fix after merge
2017-04-08 11:26:16 +02:00
nodes: Option<Vec<String>>,
server_set_contract: Option<String>,
interface: Option<String>,
Fixing secretstore TODOs - part 1 (#5386) * ECDKG protocol prototype * added test for enc/dec math * get rid of decryption_session * added licenses * fix after merge * get rid of unused serde dependency * doc * decryption session [without commutative enc] * failed_dec_session * fixed tests * added commen * added more decryption session tests * helper to localize an issue * more computations to localize error * decryption_session::SessionParams * added tests for EC math to localize problem * secretstore network transport * encryption_session_works_over_network * network errors processing * connecting to KeyServer * licenses * get rid of debug println-s * fixed secretstore args * encryption results are stored in KS database * decryption protocol works over network * enc/dec Session traits * fixing warnings * fix after merge * on-chain ACL checker proto * fixed compilation * fixed compilation * finally fixed <odd>-of-N-scheme * temporary commented test * 1-of-N works in math * scheme 1-of-N works * updated AclStorage with real contract ABI * remove unnecessary unsafety * fixed grumbles * wakeup on access denied * encrypt secretstore messages * 'shadow' decryption * fix grumbles * lost files * secretstore cli-options * decryption seccion when ACL check failed on master * disallow regenerating key for existing document * removed obsolete TODO * fix after merge * switched to tokio_io * fix after merge * fix after merge * fix after merge * fix after merge * fix after merge * fixed test * fix after merge
2017-04-08 11:26:16 +02:00
port: Option<u16>,
http_interface: Option<String>,
http_port: Option<u16>,
path: 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 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>,
reseal_on_uncle: Option<bool>,
2016-09-10 11:37:14 +02:00
reseal_on_txs: Option<String>,
reseal_min_period: Option<u64>,
reseal_max_period: Option<u64>,
2016-09-10 11:37:14 +02:00
work_queue_size: Option<usize>,
tx_gas_limit: Option<String>,
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>,
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>,
New Transaction Queue implementation (#8074) * Implementation of Verifier, Scoring and Ready. * Queue in progress. * TransactionPool. * Prepare for txpool release. * Miner refactor [WiP] * WiP reworking miner. * Make it compile. * Add some docs. * Split blockchain access to a separate file. * Work on miner API. * Fix ethcore tests. * Refactor miner interface for sealing/work packages. * Implement next nonce. * RPC compiles. * Implement couple of missing methdods for RPC. * Add transaction queue listeners. * Compiles! * Clean-up and parallelize. * Get rid of RefCell in header. * Revert "Get rid of RefCell in header." This reverts commit 0f2424c9b7319a786e1565ea2a8a6d801a21b4fb. * Override Sync requirement. * Fix status display. * Unify logging. * Extract some cheap checks. * Measurements and optimizations. * Fix scoring bug, heap size of bug and add cache * Disable tx queueing and parallel verification. * Make ethcore and ethcore-miner compile again. * Make RPC compile again. * Bunch of txpool tests. * Migrate transaction queue tests. * Nonce Cap * Nonce cap cache and tests. * Remove stale future transactions from the queue. * Optimize scoring and write some tests. * Simple penalization. * Clean up and support for different scoring algorithms. * Add CLI parameters for the new queue. * Remove banning queue. * Disable debug build. * Change per_sender limit to be 1% instead of 5% * Avoid cloning when propagating transactions. * Remove old todo. * Post-review fixes. * Fix miner options default. * Implement back ready transactions for light client. * Get rid of from_pending_block * Pass rejection reason. * Add more details to drop. * Rollback heap size of. * Avoid cloning hashes when propagating and include more details on rejection. * Fix tests. * Introduce nonces cache. * Remove uneccessary hashes allocation. * Lower the mem limit. * Re-enable parallel verification. * Add miner log. Don't check the type if not below min_gas_price. * Add more traces, fix disabling miner. * Fix creating pending blocks twice on AuRa authorities. * Fix tests. * re-use pending blocks in AuRa * Use reseal_min_period to prevent too frequent update_sealing. * Fix log to contain hash not sender. * Optimize local transactions. * Fix aura tests. * Update locks comments. * Get rid of unsafe Sync impl. * Review fixes. * Remove excessive matches. * Fix compilation errors. * Use new pool in private transactions. * Fix private-tx test. * Fix secret store tests. * Actually use gas_floor_target * Fix config tests. * Fix pool tests. * Address grumbles.
2018-04-13 17:34:27 +02:00
tx_queue_per_sender: Option<usize>,
tx_queue_mem_limit: Option<u32>,
tx_queue_locals: Option<HashSet<String>>,
tx_queue_strategy: Option<String>,
tx_queue_ban_count: Option<u16>,
tx_queue_ban_time: Option<u16>,
tx_queue_no_unfamiliar_locals: Option<bool>,
tx_queue_no_early_reject: Option<bool>,
2016-09-10 11:37:14 +02:00
remove_solved: Option<bool>,
notify_work: Option<Vec<String>>,
refuse_service_transactions: Option<bool>,
infinite_pending_block: Option<bool>,
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)]
struct Stratum {
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>,
pruning_history: Option<u64>,
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>,
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 {
2020-09-15 16:51:49 +02:00
enable: Option<bool>,
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>,
color: Option<bool>,
ports_shift: Option<u16>,
unsafe_expose: Option<bool>,
2016-09-10 11:37:14 +02:00
}
#[cfg(test)]
mod tests {
use super::{
Account, Args, ArgsError, Config, Footprint, Ipc, Metrics, Mining, Misc, Network,
Operating, Rpc, SecretStore, Snapshots, Ws,
2016-09-10 11:37:14 +02:00
};
use clap::ErrorKind as ClapErrorKind;
2016-09-10 11:37:14 +02:00
use toml;
2020-08-05 06:08:03 +02:00
#[test]
fn should_accept_any_argument_order() {
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "--no-warp", "account", "list"]).unwrap();
assert_eq!(args.flag_no_warp, true);
2020-08-05 06:08:03 +02:00
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "account", "list", "--no-warp"]).unwrap();
assert_eq!(args.flag_no_warp, true);
2020-08-05 06:08:03 +02:00
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "--chain=dev", "account", "list"]).unwrap();
assert_eq!(args.arg_chain, "dev");
2020-08-05 06:08:03 +02:00
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "account", "list", "--chain=dev"]).unwrap();
assert_eq!(args.arg_chain, "dev");
}
2020-08-05 06:08:03 +02:00
#[test]
fn should_reject_invalid_values() {
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "--jsonrpc-port=8545"]);
assert!(args.is_ok());
2020-08-05 06:08:03 +02:00
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "--jsonrpc-port=asd"]);
assert!(args.is_err());
}
2020-08-05 06:08:03 +02:00
#[test]
fn should_parse_args_and_flags() {
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "--no-warp"]).unwrap();
assert_eq!(args.flag_no_warp, true);
2020-08-05 06:08:03 +02:00
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "--pruning", "archive"]).unwrap();
assert_eq!(args.arg_pruning, "archive");
2020-08-05 06:08:03 +02:00
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "export", "state", "--no-storage"]).unwrap();
assert_eq!(args.flag_export_state_no_storage, true);
2020-08-05 06:08:03 +02:00
2020-09-22 14:53:52 +02:00
let args =
Args::parse(&["openethereum", "export", "state", "--min-balance", "123"]).unwrap();
assert_eq!(args.arg_export_state_min_balance, Some("123".to_string()));
}
2020-08-05 06:08:03 +02:00
#[test]
fn should_exit_gracefully_on_unknown_argument() {
2020-09-22 14:53:52 +02:00
let result = Args::parse(&["openethereum", "--please-exit-gracefully"]);
assert!(match result {
Err(ArgsError::Clap(ref clap_error))
if clap_error.kind == ClapErrorKind::UnknownArgument =>
true,
_ => false,
});
}
2020-08-05 06:08:03 +02:00
#[test]
fn should_use_subcommand_arg_default() {
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "export", "state", "--at", "123"]).unwrap();
assert_eq!(args.arg_export_state_at, "123");
assert_eq!(args.arg_snapshot_at, "latest");
2020-08-05 06:08:03 +02:00
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "snapshot", "--at", "123", "file.dump"]).unwrap();
assert_eq!(args.arg_snapshot_at, "123");
assert_eq!(args.arg_export_state_at, "latest");
2020-08-05 06:08:03 +02:00
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "export", "state"]).unwrap();
assert_eq!(args.arg_snapshot_at, "latest");
assert_eq!(args.arg_export_state_at, "latest");
2020-08-05 06:08:03 +02:00
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "snapshot", "file.dump"]).unwrap();
assert_eq!(args.arg_snapshot_at, "latest");
assert_eq!(args.arg_export_state_at, "latest");
}
2020-08-05 06:08:03 +02:00
#[test]
fn should_parse_multiple_values() {
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "account", "import", "~/1", "~/2"]).unwrap();
assert_eq!(
args.arg_account_import_path,
Some(vec!["~/1".to_owned(), "~/2".to_owned()])
);
2020-08-05 06:08:03 +02:00
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "account", "import", "~/1,ext"]).unwrap();
assert_eq!(
args.arg_account_import_path,
Some(vec!["~/1,ext".to_owned()])
);
2020-08-05 06:08:03 +02:00
let args = Args::parse(&[
2020-09-22 14:53:52 +02:00
"openethereum",
"--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"
);
2020-08-05 06:08:03 +02:00
let args = Args::parse(&[
2020-09-22 14:53:52 +02:00
"openethereum",
"--password",
"~/.safe/1",
"--password",
"~/.safe/2",
])
.unwrap();
assert_eq!(
args.arg_password,
vec!["~/.safe/1".to_owned(), "~/.safe/2".to_owned()]
2020-08-05 06:08:03 +02:00
);
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "--password", "~/.safe/1,~/.safe/2"]).unwrap();
assert_eq!(
v2.5.10 stable (#11239) * ropsten #6631425 foundation #8798209 (#11201) * [stable] builtin, istanbul and mordor testnet backports (#11234) * ethcore-builtin (#10850) * [builtin]: support `multiple prices and activations` in chain spec (#11039) * [chain specs]: activate `Istanbul` on mainnet (#11228) * ethcore/res: add mordor testnet configuration (#11200) * Update list of bootnodes for xDai chain (#11236) * ethcore: remove `test-helper feat` from build (#11047) * Secret store: fix Instant::now() related race in net_keep_alive (#11155) (#11159) * [stable]: backport #10691 and #10683 (#11143) * Fix compiler warning (that will become an error) (#10683) * Refactor Clique stepping (#10691) * Add Constantinople eips to the dev (instant_seal) config (#10809) * Add cargo-remote dir to .gitignore (?) * Insert explicit warning into the panic hook (#11225) * Fix docker centos build (#11226) * Update MIX bootnodes. (#11203) * Use provided usd-per-eth value if an endpoint is specified (#11209) * Add new line after writing block to hex file. (#10984) * Type annotation for next_key() matching of json filter options (#11192) (but no `FilterOption` in 2.5 so…) * Upgrade jsonrpc to latest (#11206) * [CI] check evmbin build (#11096) * Correct EIP-712 encoding (#11092) * [client]: Fix for incorrectly dropped consensus messages (#11086) * Fix block detail updating (#11015) * Switching sccache from local to Redis (#10971) * Made ecrecover implementation trait public (#11188) * [dependencies]: jsonrpc `14.0.1` (#11183) * [receipt]: add `sender` & `receiver` to `RichReceipts` (#11179) * [ethcore/builtin]: do not panic in blake2pricer on short input (#11180) * util Host: fix a double Read Lock bug in fn Host::session_readable() (#11175) * ethcore client: fix a double Read Lock bug in fn Client::logs() (#11172) * Change how RPCs eth_call and eth_estimateGas handle "Pending" (#11127) * Cleanup stratum a bit (#11161) * Upgrade to jsonrpc v14 (#11151) * SecretStore: expose restore_key_public in HTTP API (#10241)
2019-11-11 21:57:38 +01:00
args.arg_password,
vec!["~/.safe/1".to_owned(), "~/.safe/2".to_owned()]
2020-08-05 06:08:03 +02:00
);
2016-09-10 11:37:14 +02:00
}
2020-08-05 06:08:03 +02:00
2016-09-10 11:37:14 +02:00
#[test]
fn should_parse_global_args_with_subcommand() {
2020-09-22 14:53:52 +02:00
let args = Args::parse(&["openethereum", "--chain", "dev", "account", "list"]).unwrap();
assert_eq!(args.arg_chain, "dev".to_owned());
2016-09-10 11:37:14 +02:00
}
2020-08-05 06:08:03 +02:00
#[test]
fn should_parse_args_and_include_config() {
2020-08-05 06:08:03 +02:00
// given
let mut config = Config::default();
let mut operating = Operating::default();
operating.chain = Some("goerli".into());
config.parity = Some(operating);
2020-08-05 06:08:03 +02:00
// when
2020-09-22 14:53:52 +02:00
let args = Args::parse_with_config(&["openethereum"], config).unwrap();
2020-08-05 06:08:03 +02:00
// then
assert_eq!(args.arg_chain, "goerli".to_owned());
}
2020-08-05 06:08:03 +02:00
2016-09-10 11:37:14 +02:00
#[test]
fn should_not_use_config_if_cli_is_provided() {
// given
let mut config = Config::default();
2016-09-10 11:37:14 +02:00
let mut operating = Operating::default();
operating.chain = Some("goerli".into());
config.parity = Some(operating);
2020-08-05 06:08:03 +02:00
2016-09-10 11:37:14 +02:00
// when
2020-09-22 14:53:52 +02:00
let args = Args::parse_with_config(&["openethereum", "--chain", "xyz"], config).unwrap();
2020-08-05 06:08:03 +02:00
2016-09-10 11:37:14 +02:00
// then
assert_eq!(args.arg_chain, "xyz".to_owned());
2020-08-05 06:08:03 +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);
2020-08-05 06:08:03 +02:00
// when
2020-09-22 14:53:52 +02:00
let args = Args::parse_with_config(&["openethereum"], config).unwrap();
2020-08-05 06:08:03 +02:00
// then
assert_eq!(args.arg_pruning_history, 128);
2020-08-05 06:08:03 +02:00
}
#[test]
fn should_parse_full_config() {
2020-08-05 06:08:03 +02:00
// given
let config = toml::from_str(include_str!("./tests/config.full.toml")).unwrap();
2020-08-05 06:08:03 +02:00
// when
2020-09-22 14:53:52 +02:00
let args = Args::parse_with_config(&["openethereum", "--chain", "xyz"], config).unwrap();
2020-08-05 06:08:03 +02:00
// then
assert_eq!(
2020-08-05 06:08:03 +02:00
args,
Args {
2016-09-10 11:37:14 +02:00
// Commands
cmd_daemon: false,
2016-09-10 11:37:14 +02:00
cmd_account: false,
cmd_account_new: false,
2016-09-10 11:37:14 +02:00
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,
cmd_export: false,
cmd_export_blocks: false,
cmd_export_state: false,
cmd_signer: false,
cmd_signer_list: false,
cmd_signer_sign: false,
cmd_signer_reject: false,
cmd_signer_new_token: false,
cmd_snapshot: false,
cmd_restore: false,
cmd_tools: false,
cmd_tools_hash: false,
2016-12-12 17:19:41 +01:00
cmd_db: false,
cmd_db_kill: false,
cmd_db_reset: false,
2020-08-05 06:08:03 +02:00
// Arguments
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,
Auto-updater improvements (#8078) * updater: refactor updater flow into state machine * updater: delay update randomly within max range * updater: configurable update delay * updater: split polling and updater state machine step * updater: drop state to avoid deadlocking * updater: fix fetch backoff * updater: fix overflow in update delay calculation * updater: configurable update check frequency * updater: fix update policy frequency comparison * updater: use lazy_static for platform and platform_id_hash * updater: refactor operations contract calls into OperationsClient * updater: make updater generic over operations and fetch client * updater: fix compilation * updater: add testing infrastructure and minimal test * updater: fix minor grumbles * updater: add test for successful updater flow * updater: add test for update delay * updater: add test for update check frequency * updater: mock time and rng for deterministic tests * updater: test backoff on failure * updater: add test for backoff short-circuit on new release * updater: refactor to increase readability * updater: cap maximum backoff to one month * updater: add test for detecting already downloaded update * updater: add test for updater disable on fatal errors * updater: add test for pending outdated fetch * updater: test auto install of updates * updater: add test for capability updates * updater: fix capability update * updater: use ethabi to create event topic filter * updater: decrease maximum backoff to 1 day * updater: cap maximum update delay with upcoming fork block number * updater: receive state mutex guard in updater_step * updater: overload execute_upgrade to take state mutex guard * updater: remove unnecessary clone of latest operations info * updater: remove latest operations info clone when triggering fetch
2018-04-03 16:49:23 +02:00
arg_export_state_format: None,
arg_snapshot_file: None,
arg_restore_file: None,
arg_tools_hash_file: None,
2020-08-05 06:08:03 +02:00
arg_signer_sign_id: None,
New Transaction Queue implementation (#8074) * Implementation of Verifier, Scoring and Ready. * Queue in progress. * TransactionPool. * Prepare for txpool release. * Miner refactor [WiP] * WiP reworking miner. * Make it compile. * Add some docs. * Split blockchain access to a separate file. * Work on miner API. * Fix ethcore tests. * Refactor miner interface for sealing/work packages. * Implement next nonce. * RPC compiles. * Implement couple of missing methdods for RPC. * Add transaction queue listeners. * Compiles! * Clean-up and parallelize. * Get rid of RefCell in header. * Revert "Get rid of RefCell in header." This reverts commit 0f2424c9b7319a786e1565ea2a8a6d801a21b4fb. * Override Sync requirement. * Fix status display. * Unify logging. * Extract some cheap checks. * Measurements and optimizations. * Fix scoring bug, heap size of bug and add cache * Disable tx queueing and parallel verification. * Make ethcore and ethcore-miner compile again. * Make RPC compile again. * Bunch of txpool tests. * Migrate transaction queue tests. * Nonce Cap * Nonce cap cache and tests. * Remove stale future transactions from the queue. * Optimize scoring and write some tests. * Simple penalization. * Clean up and support for different scoring algorithms. * Add CLI parameters for the new queue. * Remove banning queue. * Disable debug build. * Change per_sender limit to be 1% instead of 5% * Avoid cloning when propagating transactions. * Remove old todo. * Post-review fixes. * Fix miner options default. * Implement back ready transactions for light client. * Get rid of from_pending_block * Pass rejection reason. * Add more details to drop. * Rollback heap size of. * Avoid cloning hashes when propagating and include more details on rejection. * Fix tests. * Introduce nonces cache. * Remove uneccessary hashes allocation. * Lower the mem limit. * Re-enable parallel verification. * Add miner log. Don't check the type if not below min_gas_price. * Add more traces, fix disabling miner. * Fix creating pending blocks twice on AuRa authorities. * Fix tests. * re-use pending blocks in AuRa * Use reseal_min_period to prevent too frequent update_sealing. * Fix log to contain hash not sender. * Optimize local transactions. * Fix aura tests. * Update locks comments. * Get rid of unsafe Sync impl. * Review fixes. * Remove excessive matches. * Fix compilation errors. * Use new pool in private transactions. * Fix private-tx test. * Fix secret store tests. * Actually use gas_floor_target * Fix config tests. * Fix pool tests. * Address grumbles.
2018-04-13 17:34:27 +02:00
arg_signer_reject_id: None,
arg_account_import_path: None,
arg_wallet_import_path: None,
arg_db_reset_num: 10,
2020-08-05 06:08:03 +02:00
// -- Operating Options
arg_mode: "last".into(),
arg_mode_timeout: 300u64,
arg_mode_alarm: 3600u64,
2016-09-10 11:37:14 +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-06-08 09:20:50 +02:00
flag_no_persistent_txqueue: false,
2020-08-05 06:08:03 +02:00
Private transactions integration pr (#6422) * Private transaction message added * Empty line removed * Private transactions logic removed from client into the separate module * Fixed compilation after merge with head * Signed private transaction message added as well * Comments after the review fixed * Private tx execution * Test update * Renamed some methods * Fixed some tests * Reverted submodules * Fixed build * Private transaction message added * Empty line removed * Private transactions logic removed from client into the separate module * Fixed compilation after merge with head * Signed private transaction message added as well * Comments after the review fixed * Encrypted private transaction message and signed reply added * Private tx execution * Test update * Main scenario completed * Merged with the latest head * Private transactions API * Comments after review fixed * Parameters for private transactions added to parity arguments * New files added * New API methods added * Do not process packets from unconfirmed peers * Merge with ptm_ss branch * Encryption and permissioning with key server added * Fixed compilation after merge * Version of Parity protocol incremented in order to support private transactions * Doc strings for constants added * Proper format for doc string added * fixed some encryptor.rs grumbles * Private transactions functionality moved to the separate crate * Refactoring in order to remove late initialisation * Tests fixed after moving to the separate crate * Fetch method removed * Sync test helpers refactored * Interaction with encryptor refactored * Contract address retrieving via substate removed * Sensible gas limit for private transactions implemented * New private contract with nonces added * Parsing of the response from key server fixed * Build fixed after the merge, native contracts removed * Crate renamed * Tests moved to the separate directory * Handling of errors reworked in order to use error chain * Encodable macro added, new constructor replaced with default * Native ethabi usage removed * Couple conversions optimized * Interactions with client reworked * Errors omitting removed * Fix after merge * Fix after the merge * private transactions improvements in progress * private_transactions -> ethcore/private-tx * making private transactions more idiomatic * private-tx encryptor uses shared FetchClient and is more idiomatic * removed redundant tests, moved integration tests to tests/ dir * fixed failing service test * reenable add_notify on private tx provider * removed private_tx tests from sync module * removed commented out code * Use plain password instead of unlocking account manager * remove dead code * Link to the contract changed * Transaction signature chain replay protection module created * Redundant type conversion removed * Contract address returned by private provider * Test fixed * Addressing grumbles in PrivateTransactions (#8249) * Tiny fixes part 1. * A bunch of additional comments and todos. * Fix ethsync tests. * resolved merge conflicts * final private tx pr (#8318) * added cli option that enables private transactions * fixed failing test * fixed failing test * fixed failing test * fixed failing test
2018-04-09 16:14:33 +02:00
// -- Convenience Options
arg_config: "$BASE/config.toml".into(),
arg_ports_shift: 0,
flag_unsafe_expose: false,
2020-08-05 06:08:03 +02:00
2016-09-10 11:37:14 +02:00
// -- Account Options
Private transactions integration pr (#6422) * Private transaction message added * Empty line removed * Private transactions logic removed from client into the separate module * Fixed compilation after merge with head * Signed private transaction message added as well * Comments after the review fixed * Private tx execution * Test update * Renamed some methods * Fixed some tests * Reverted submodules * Fixed build * Private transaction message added * Empty line removed * Private transactions logic removed from client into the separate module * Fixed compilation after merge with head * Signed private transaction message added as well * Comments after the review fixed * Encrypted private transaction message and signed reply added * Private tx execution * Test update * Main scenario completed * Merged with the latest head * Private transactions API * Comments after review fixed * Parameters for private transactions added to parity arguments * New files added * New API methods added * Do not process packets from unconfirmed peers * Merge with ptm_ss branch * Encryption and permissioning with key server added * Fixed compilation after merge * Version of Parity protocol incremented in order to support private transactions * Doc strings for constants added * Proper format for doc string added * fixed some encryptor.rs grumbles * Private transactions functionality moved to the separate crate * Refactoring in order to remove late initialisation * Tests fixed after moving to the separate crate * Fetch method removed * Sync test helpers refactored * Interaction with encryptor refactored * Contract address retrieving via substate removed * Sensible gas limit for private transactions implemented * New private contract with nonces added * Parsing of the response from key server fixed * Build fixed after the merge, native contracts removed * Crate renamed * Tests moved to the separate directory * Handling of errors reworked in order to use error chain * Encodable macro added, new constructor replaced with default * Native ethabi usage removed * Couple conversions optimized * Interactions with client reworked * Errors omitting removed * Fix after merge * Fix after the merge * private transactions improvements in progress * private_transactions -> ethcore/private-tx * making private transactions more idiomatic * private-tx encryptor uses shared FetchClient and is more idiomatic * removed redundant tests, moved integration tests to tests/ dir * fixed failing service test * reenable add_notify on private tx provider * removed private_tx tests from sync module * removed commented out code * Use plain password instead of unlocking account manager * remove dead code * Link to the contract changed * Transaction signature chain replay protection module created * Redundant type conversion removed * Contract address returned by private provider * Test fixed * Addressing grumbles in PrivateTransactions (#8249) * Tiny fixes part 1. * A bunch of additional comments and todos. * Fix ethsync tests. * resolved merge conflicts * final private tx pr (#8318) * added cli option that enables private transactions * fixed failing test * fixed failing test * fixed failing test * fixed failing test
2018-04-09 16:14:33 +02:00
arg_unlock: Some("0xdeadbeefcafe0000000000000000000000000000".into()),
arg_password: vec!["~/.safe/password.file".into()],
arg_keys_iterations: 10240u32,
arg_accounts_refresh: 5u64,
flag_fast_unlock: false,
2020-08-05 06:08:03 +02:00
2017-03-22 16:45:50 +01:00
arg_ui_path: "$HOME/.parity/signer".into(),
2020-08-05 06:08:03 +02:00
2016-09-10 11:37:14 +02:00
// -- Networking Options
flag_no_warp: false,
arg_port: 30303u16,
arg_interface: "all".into(),
arg_min_peers: Some(25u16),
arg_max_peers: Some(50u16),
arg_max_pending_peers: 64u16,
arg_snapshot_peers: 0u16,
arg_allow_ips: "all".into(),
arg_nat: "any".into(),
arg_network_id: Some(1),
Private transactions integration pr (#6422) * Private transaction message added * Empty line removed * Private transactions logic removed from client into the separate module * Fixed compilation after merge with head * Signed private transaction message added as well * Comments after the review fixed * Private tx execution * Test update * Renamed some methods * Fixed some tests * Reverted submodules * Fixed build * Private transaction message added * Empty line removed * Private transactions logic removed from client into the separate module * Fixed compilation after merge with head * Signed private transaction message added as well * Comments after the review fixed * Encrypted private transaction message and signed reply added * Private tx execution * Test update * Main scenario completed * Merged with the latest head * Private transactions API * Comments after review fixed * Parameters for private transactions added to parity arguments * New files added * New API methods added * Do not process packets from unconfirmed peers * Merge with ptm_ss branch * Encryption and permissioning with key server added * Fixed compilation after merge * Version of Parity protocol incremented in order to support private transactions * Doc strings for constants added * Proper format for doc string added * fixed some encryptor.rs grumbles * Private transactions functionality moved to the separate crate * Refactoring in order to remove late initialisation * Tests fixed after moving to the separate crate * Fetch method removed * Sync test helpers refactored * Interaction with encryptor refactored * Contract address retrieving via substate removed * Sensible gas limit for private transactions implemented * New private contract with nonces added * Parsing of the response from key server fixed * Build fixed after the merge, native contracts removed * Crate renamed * Tests moved to the separate directory * Handling of errors reworked in order to use error chain * Encodable macro added, new constructor replaced with default * Native ethabi usage removed * Couple conversions optimized * Interactions with client reworked * Errors omitting removed * Fix after merge * Fix after the merge * private transactions improvements in progress * private_transactions -> ethcore/private-tx * making private transactions more idiomatic * private-tx encryptor uses shared FetchClient and is more idiomatic * removed redundant tests, moved integration tests to tests/ dir * fixed failing service test * reenable add_notify on private tx provider * removed private_tx tests from sync module * removed commented out code * Use plain password instead of unlocking account manager * remove dead code * Link to the contract changed * Transaction signature chain replay protection module created * Redundant type conversion removed * Contract address returned by private provider * Test fixed * Addressing grumbles in PrivateTransactions (#8249) * Tiny fixes part 1. * A bunch of additional comments and todos. * Fix ethsync tests. * resolved merge conflicts * final private tx pr (#8318) * added cli option that enables private transactions * fixed failing test * fixed failing test * fixed failing test * fixed failing test
2018-04-09 16:14:33 +02:00
arg_bootnodes: Some("".into()),
flag_no_discovery: false,
arg_node_key: None,
arg_reserved_peers: Some("./path_to_file".into()),
flag_reserved_only: false,
flag_no_ancient_blocks: false,
2020-08-07 19:36:32 +02:00
arg_warp_barrier: None,
2020-08-05 06:08:03 +02:00
// -- API and Console Options
2020-08-05 06:08:03 +02:00
// RPC
flag_no_jsonrpc: false,
flag_jsonrpc_no_keep_alive: false,
flag_jsonrpc_experimental: false,
arg_jsonrpc_port: 8545u16,
arg_jsonrpc_interface: "local".into(),
arg_jsonrpc_cors: "null".into(),
2020-08-07 19:36:32 +02:00
arg_jsonrpc_apis: "web3,eth,net,parity,traces,secretstore".into(),
arg_jsonrpc_hosts: "none".into(),
arg_jsonrpc_server_threads: None,
arg_jsonrpc_threads: 4,
arg_jsonrpc_max_payload: None,
arg_poll_lifetime: 60u32,
2016-09-10 11:37:14 +02:00
flag_jsonrpc_allow_missing_blocks: false,
2020-08-05 06:08:03 +02:00
2016-09-10 11:37:14 +02:00
// WS
flag_no_ws: false,
arg_ws_port: 8546u16,
arg_ws_interface: "local".into(),
2020-08-07 19:36:32 +02:00
arg_ws_apis: "web3,eth,net,parity,traces,secretstore".into(),
arg_ws_origins: "none".into(),
arg_ws_hosts: "none".into(),
arg_ws_max_connections: 100,
2020-08-05 06:08:03 +02:00
// IPC
flag_no_ipc: false,
arg_ipc_path: "$HOME/.parity/jsonrpc.ipc".into(),
2020-08-07 19:36:32 +02:00
arg_ipc_apis: "web3,eth,net,parity,parity_accounts,personal,traces,secretstore"
2020-08-05 06:08:03 +02:00
.into(),
// METRICS
flag_metrics: false,
arg_metrics_port: 3000u16,
arg_metrics_interface: "local".into(),
// SECRETSTORE
flag_no_secretstore: false,
flag_no_secretstore_http: false,
SecretStore: administrative sessions prototypes (#6605) * generate random channel encryption key on restart * session-level nonces * fixed warning after rebase * session_nonce -> nonce * full_generation_math_session_with_refreshing_shares && full_generation_math_session_with_adding_new_node * add serveral secret shares at once * SecretStore: initial ShareAdd session prototype * SecretStore: ServersSetChange jobs * SecretStore: servers set change session continued * SecretStore: servers set change session continued * SecretStore: servers set change session continued * SecretStore: known_sessions iterator * SecretStore: implemented SessionsQueue * SecretStore: UnknownSessionsJobTransport * SecretStore: node_added_using_servers_set_change almost done * SecretStore: continue adding tests * SecretStore: node_added_using_servers_set_change + node_added_using_share_add * SecretStore: node_added_using_server_set_change_from_this_node * SecretStore: node_moved_using_share_move * SecretStore: node_moved_using_servers_set_change * SecretStore: node_removed_using_share_remove * SecretStore: node_removed_using_servers_set_change * SecretStore: different folders for client && admin sessions * SecretStore: started adding share change consensus (flush) * SecretStore: fixed spurious tests failures * enum JobPartialRequestAction * SecretStore: started adding consensus layer to ShareAdd session * SecretStore: starting external consensus for ShareAdd * SecretStore: started restoring node_added_using_servers_set_change * SecretStore: node_added_using_servers_set_change works with external consensus * SecretStore: node_added_using_server_set_change_from_this_node works with external consensus * removed debug comments/printlns * SecretStore: share move session supports consensus * SecretStore: share remove with external consensus * SecretStore: started adding basic ShareAdd tests * SecretStore: added ShareAdd tests * SecretStore: added ShareAdd session to cluster * SecretStore: added share move && remove sessions to cluster * SecretStore: ShareMove session tests cleanup * SecretStore: ShareRemove session tests cleanup * SecretStore: added check_secret_is_preserved check * SecretStore: added servers set change to cluster * SecretStore: cleaned up ServersSetChange session tests * SecretStore: cleaning + added tests for ShareRemove * SecretStore: cleaning up * SecretStore: propagated admin_public * SecretStore: fixed persistent_key_storage test * SecretStore: upgrade_db_from_1 * SecretStore: fixed ServersSetChange session completion * SecretStore: check polynom1 in ShareAdd sessions (error for pre-v2 shares) * SecretStore: fixing TODOs * SecretStore: fixing TODOs * SecretStore: check share change plan on 'old' slave nodes * SecretStore: fixing TODOs * SecretStore: store all admin sessions in single container to avoid overlaps * SecretStore: do not update nodes set during admin sessions * SecretStore: moved TODOs to appropriate methods * SecretStore: TODOs * SecretStore: added admin_public arg && fixed warnigs * SecretStore: added shares_to_move_reversed to ShareMove session * SecretStore: additional checks during consensus establishing * license * SecretStore: added TODO about starting ServersSetChange session * SecretStore: redundant clones + docs + lsot unimplemented-s * SecretStore: generation_session_completion_signalled_if_failed_on_master * SecretStore: updated obsolete comment * SecretStore: added type alias for current DocumentKeyShare serialization format * SecretStore: fixed typo * SecretStore; fixed warnings for futures 0.1.15 * fixed warning
2017-10-02 15:27:31 +02:00
flag_no_secretstore_auto_migrate: false,
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()),
arg_secretstore_secret: None,
arg_secretstore_admin_public: None,
arg_secretstore_nodes: "".into(),
arg_secretstore_server_set_contract: Some("registry".into()),
arg_secretstore_interface: "local".into(),
arg_secretstore_port: 8083u16,
arg_secretstore_http_interface: "local".into(),
arg_secretstore_http_port: 8082u16,
arg_secretstore_path: "$HOME/.parity/secretstore".into(),
2020-08-05 06:08:03 +02:00
// -- Sealing/Mining Options
arg_author: Some("0xdeadbeefcafe0000000000000000000000000001".into()),
arg_engine_signer: Some("0xdeadbeefcafe0000000000000000000000000001".into()),
flag_force_sealing: true,
arg_reseal_on_txs: "all".into(),
arg_reseal_min_period: 4000u64,
arg_reseal_max_period: 60000u64,
flag_reseal_on_uncle: false,
arg_work_queue_size: 20usize,
arg_tx_gas_limit: Some("10000000".into()),
arg_tx_time_limit: Some(100u64),
arg_relay_set: "cheap".into(),
arg_min_gas_price: Some(0u64),
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 & -> &amp; * [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(),
arg_gas_price_percentile: 50usize,
arg_usd_per_eth: "auto".into(),
arg_price_update_period: "hourly".into(),
arg_gas_floor_target: "8000000".into(),
arg_gas_cap: "10000000".into(),
arg_extra_data: Some("Parity".into()),
flag_tx_queue_no_unfamiliar_locals: false,
2016-09-10 11:37:14 +02:00
flag_tx_queue_no_early_reject: false,
arg_tx_queue_size: 8192usize,
arg_tx_queue_per_sender: None,
arg_tx_queue_mem_limit: 4u32,
arg_tx_queue_locals: Some("0xdeadbeefcafe0000000000000000000000000000".into()),
arg_tx_queue_strategy: "gas_factor".into(),
flag_remove_solved: false,
arg_notify_work: Some("http://localhost:3001".into()),
flag_refuse_service_transactions: false,
flag_infinite_pending_block: false,
arg_max_round_blocks_to_import: 12usize,
2020-08-05 06:08:03 +02:00
flag_stratum: false,
arg_stratum_interface: "local".to_owned(),
arg_stratum_port: 8008u16,
arg_stratum_secret: None,
2020-08-05 06:08:03 +02:00
// -- Footprint Options
arg_tracing: "auto".into(),
arg_pruning: "auto".into(),
arg_pruning_history: 64u64,
arg_pruning_memory: 500usize,
arg_cache_size_db: 64u32,
arg_cache_size_blocks: 8u32,
arg_cache_size_queue: 50u32,
arg_cache_size_state: 25u32,
arg_cache_size: Some(128),
2016-09-10 11:37:14 +02:00
arg_db_compaction: "ssd".into(),
arg_fat_db: "auto".into(),
2016-12-02 18:36:00 +01:00
flag_scale_verifiers: true,
arg_num_verifiers: Some(6),
2020-08-05 06:08:03 +02:00
// -- Import/Export Options
arg_export_blocks_from: "1".into(),
arg_export_blocks_to: "latest".into(),
flag_no_seal_check: false,
flag_export_state_no_code: false,
flag_export_state_no_storage: false,
arg_export_state_min_balance: None,
arg_export_state_max_balance: None,
2020-08-05 06:08:03 +02:00
// -- Snapshot Optons
arg_export_state_at: "latest".into(),
2016-09-10 11:37:14 +02:00
arg_snapshot_at: "latest".into(),
2020-09-15 16:51:49 +02:00
flag_enable_snapshotting: false,
Allow dropping light client RPC query with no results (#9318) * OnDemand no longer loop until there is a query. All peer known at the time will be queried, and the query fail if all return no reply. Returning the failure is done through an empty Vec of reply (the type of the oneshot channel remains unchanged). Before this commit the query were send randomly to any peer until there is a reply (for a query that got no result it was an issue, for other queries it was quering multiple times the same peers). After this commit the first query is random but next queries follows hashmap iterator order. Test no_capability was broken by this commit (the pending query was removed). * OnDemand no longer loop until there is a query. All peer known at the time will be queried, and the query fail if all return no reply. Returning the failure is done through an empty Vec of reply (the type of the oneshot channel remains unchanged). Before this commit the query were send randomly to any peer until there is a reply (for a query that got no result it was an issue, for other queries it was quering multiple times the same peers). After this commit the first query is random but next queries follows hashmap iterator order. Test no_capability was broken by this commit (the pending query was removed). If adding some kind of timeout mechanism it could be restored. * Comment plus better field names. * No panick on dropped oneshot channel. * Use Set to avoid counter heuristic * Cli option `on_demand_nb_retry` for maximum number of retry when doing on demand query in light client. * Missing test update for previous commit * Add a timeout (only when there is no peer to query), that way we do not set number of query to minimum current number peer or configured number of query : that way capability test was restored. * Adding an error type for on_demand, it helps having variant of error reported at rpc level : choice of rpc error code error might not be right. * Duration as constant is nice * Switch to duration in main too * Fix indentation (sorry for that). * Fix error management (bad merge in previous commit) * Lots of english corrections, major change on the new command parameters : - use standard '-' instead of '_' - renaming nb_retry params to 'on-demand-retry-count'
2018-09-12 11:47:01 +02:00
arg_snapshot_threads: None,
2020-08-05 06:08:03 +02:00
// -- Internal Options
flag_can_restart: false,
2020-08-05 06:08:03 +02:00
2016-09-10 11:37:14 +02:00
// -- Miscellaneous Options
flag_version: false,
arg_logging: Some("own_tx=trace".into()),
2020-09-22 14:53:52 +02:00
arg_log_file: Some("/var/log/openethereum.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
}
);
}
2020-08-05 06:08:03 +02:00
#[test]
fn should_parse_config_and_return_errors() {
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"));
2020-08-05 06:08:03 +02:00
2018-01-03 10:51:39 +01:00
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
2020-08-05 06:08:03 +02:00
);
}
}
2020-08-05 06:08:03 +02:00
}
2016-09-10 11:37:14 +02:00
#[test]
fn should_deserialize_toml_file() {
let config: Config = toml::from_str(include_str!("./tests/config.toml")).unwrap();
2020-08-05 06:08:03 +02:00
2016-09-10 11:37:14 +02:00
assert_eq!(
config,
2020-08-05 06:08:03 +02:00
Config {
2016-09-10 11:37:14 +02:00
parity: Some(Operating {
mode: Some("dark".into()),
2016-12-04 19:47:05 +01:00
mode_timeout: Some(15u64),
Auto-updater improvements (#8078) * updater: refactor updater flow into state machine * updater: delay update randomly within max range * updater: configurable update delay * updater: split polling and updater state machine step * updater: drop state to avoid deadlocking * updater: fix fetch backoff * updater: fix overflow in update delay calculation * updater: configurable update check frequency * updater: fix update policy frequency comparison * updater: use lazy_static for platform and platform_id_hash * updater: refactor operations contract calls into OperationsClient * updater: make updater generic over operations and fetch client * updater: fix compilation * updater: add testing infrastructure and minimal test * updater: fix minor grumbles * updater: add test for successful updater flow * updater: add test for update delay * updater: add test for update check frequency * updater: mock time and rng for deterministic tests * updater: test backoff on failure * updater: add test for backoff short-circuit on new release * updater: refactor to increase readability * updater: cap maximum backoff to one month * updater: add test for detecting already downloaded update * updater: add test for updater disable on fatal errors * updater: add test for pending outdated fetch * updater: test auto install of updates * updater: add test for capability updates * updater: fix capability update * updater: use ethabi to create event topic filter * updater: decrease maximum backoff to 1 day * updater: cap maximum update delay with upcoming fork block number * updater: receive state mutex guard in updater_step * updater: overload execute_upgrade to take state mutex guard * updater: remove unnecessary clone of latest operations info * updater: remove latest operations info clone when triggering fetch
2018-04-03 16:49:23 +02:00
mode_alarm: Some(10u64),
2016-09-10 11:37:14 +02:00
chain: Some("./chain.json".into()),
base_path: None,
db_path: None,
keys_path: None,
identity: None,
no_persistent_txqueue: None,
2020-08-05 06:08:03 +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,
refresh_time: None,
2017-06-06 18:06:40 +02:00
fast_unlock: None,
}),
2020-08-07 19:36:32 +02:00
ui: None,
network: Some(Network {
warp: Some(false),
warp_barrier: None,
2016-09-10 11:37:14 +02:00
port: None,
interface: None,
2016-09-10 11:37:14 +02:00
min_peers: Some(10),
max_peers: Some(20),
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),
}),
websockets: Some(Ws {
disable: Some(true),
port: None,
interface: None,
apis: None,
origins: Some(vec!["none".into()]),
hosts: None,
max_connections: None,
}),
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,
server_threads: None,
processing_threads: None,
max_payload: None,
keep_alive: None,
experimental_rpcs: None,
poll_lifetime: None,
allow_missing_blocks: None
}),
ipc: Some(Ipc {
2016-09-10 11:37:14 +02:00
disable: None,
path: None,
apis: Some(vec!["rpc".into(), "eth".into()]),
}),
metrics: Some(Metrics {
enable: Some(true),
interface: Some("local".to_string()),
port: Some(4000),
}),
secretstore: Some(SecretStore {
disable: None,
2017-07-27 12:29:09 +02:00
disable_http: None,
disable_auto_migrate: None,
acl_contract: None,
service_contract: None,
SecretStore: generating and retrieving decryption keys via service contract (#8029) * SecretStore: started document keys generation via contract * fixed Cargo.lock * SecretStore: doc key contract gen tests * SecretStore: fixed log parsing * SecretStore: flush * SecretStore: secretstore_generateDocumentKey RPC * SecretStore: return encrypted_key from secretstore_generateDocumentKey * prepare to GenerateDocKey -> StoreDocKey * SecretStore: ability to identify requester via Public/Address * SecretStore: store author address instead of public in db * flush * SecretStore: flush * SecretStore: fixed test * SecretStore: flush * SecretStore: flush * SecretStore: flush * SecretStore: flush * SecretStore: start async generation session * SecretStore: process StoreDocumentKey service tasks * SecretStore: flush * SecretStore: update service contact ABI * SecretStore: flush * SecretStore: flush * SecretStore: fixed event * SecretStore: flush * SecretStore: fixed tests * SecretStore: fix broadcast shadows decryption * SecretStore: finally decryption via service contract works * SecretStore: fix for updated contract * SecretStore: restored pending requests reqding * SecretStore: fixed some TODOs * SecretStore: OnChainServiceContractAggregate * SecretStore: different names for different contracts types * SecretStore: updated contracts interfaces * SecretStore: utilize aggregate service contract * fixed compilation * SecretStore: fixes for updated contract * SecretStore: service fixes after testing * fixed cli test compilation * SecretStore: decryption_session_origin_is_known_to_all_initialized_nodes * SecretStore: added new contract listener tests * SecretStore: session_listener_works * removed optional TODO * SecretStore: fixed KeyServer shutdown * fixed warn + grumble * const durations
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,
Fixing secretstore TODOs - part 1 (#5386) * ECDKG protocol prototype * added test for enc/dec math * get rid of decryption_session * added licenses * fix after merge * get rid of unused serde dependency * doc * decryption session [without commutative enc] * failed_dec_session * fixed tests * added commen * added more decryption session tests * helper to localize an issue * more computations to localize error * decryption_session::SessionParams * added tests for EC math to localize problem * secretstore network transport * encryption_session_works_over_network * network errors processing * connecting to KeyServer * licenses * get rid of debug println-s * fixed secretstore args * encryption results are stored in KS database * decryption protocol works over network * enc/dec Session traits * fixing warnings * fix after merge * on-chain ACL checker proto * fixed compilation * fixed compilation * finally fixed <odd>-of-N-scheme * temporary commented test * 1-of-N works in math * scheme 1-of-N works * updated AclStorage with real contract ABI * remove unnecessary unsafety * fixed grumbles * wakeup on access denied * encrypt secretstore messages * 'shadow' decryption * fix grumbles * lost files * secretstore cli-options * decryption seccion when ACL check failed on master * disallow regenerating key for existing document * removed obsolete TODO * fix after merge * switched to tokio_io * fix after merge * fix after merge * fix after merge * fix after merge * fix after merge * fixed test * fix after merge
2017-04-08 11:26:16 +02:00
self_secret: None,
SecretStore: administrative sessions prototypes (#6605) * generate random channel encryption key on restart * session-level nonces * fixed warning after rebase * session_nonce -> nonce * full_generation_math_session_with_refreshing_shares && full_generation_math_session_with_adding_new_node * add serveral secret shares at once * SecretStore: initial ShareAdd session prototype * SecretStore: ServersSetChange jobs * SecretStore: servers set change session continued * SecretStore: servers set change session continued * SecretStore: servers set change session continued * SecretStore: known_sessions iterator * SecretStore: implemented SessionsQueue * SecretStore: UnknownSessionsJobTransport * SecretStore: node_added_using_servers_set_change almost done * SecretStore: continue adding tests * SecretStore: node_added_using_servers_set_change + node_added_using_share_add * SecretStore: node_added_using_server_set_change_from_this_node * SecretStore: node_moved_using_share_move * SecretStore: node_moved_using_servers_set_change * SecretStore: node_removed_using_share_remove * SecretStore: node_removed_using_servers_set_change * SecretStore: different folders for client && admin sessions * SecretStore: started adding share change consensus (flush) * SecretStore: fixed spurious tests failures * enum JobPartialRequestAction * SecretStore: started adding consensus layer to ShareAdd session * SecretStore: starting external consensus for ShareAdd * SecretStore: started restoring node_added_using_servers_set_change * SecretStore: node_added_using_servers_set_change works with external consensus * SecretStore: node_added_using_server_set_change_from_this_node works with external consensus * removed debug comments/printlns * SecretStore: share move session supports consensus * SecretStore: share remove with external consensus * SecretStore: started adding basic ShareAdd tests * SecretStore: added ShareAdd tests * SecretStore: added ShareAdd session to cluster * SecretStore: added share move && remove sessions to cluster * SecretStore: ShareMove session tests cleanup * SecretStore: ShareRemove session tests cleanup * SecretStore: added check_secret_is_preserved check * SecretStore: added servers set change to cluster * SecretStore: cleaned up ServersSetChange session tests * SecretStore: cleaning + added tests for ShareRemove * SecretStore: cleaning up * SecretStore: propagated admin_public * SecretStore: fixed persistent_key_storage test * SecretStore: upgrade_db_from_1 * SecretStore: fixed ServersSetChange session completion * SecretStore: check polynom1 in ShareAdd sessions (error for pre-v2 shares) * SecretStore: fixing TODOs * SecretStore: fixing TODOs * SecretStore: check share change plan on 'old' slave nodes * SecretStore: fixing TODOs * SecretStore: store all admin sessions in single container to avoid overlaps * SecretStore: do not update nodes set during admin sessions * SecretStore: moved TODOs to appropriate methods * SecretStore: TODOs * SecretStore: added admin_public arg && fixed warnigs * SecretStore: added shares_to_move_reversed to ShareMove session * SecretStore: additional checks during consensus establishing * license * SecretStore: added TODO about starting ServersSetChange session * SecretStore: redundant clones + docs + lsot unimplemented-s * SecretStore: generation_session_completion_signalled_if_failed_on_master * SecretStore: updated obsolete comment * SecretStore: added type alias for current DocumentKeyShare serialization format * SecretStore: fixed typo * SecretStore; fixed warnings for futures 0.1.15 * fixed warning
2017-10-02 15:27:31 +02:00
admin_public: None,
Fixing secretstore TODOs - part 1 (#5386) * ECDKG protocol prototype * added test for enc/dec math * get rid of decryption_session * added licenses * fix after merge * get rid of unused serde dependency * doc * decryption session [without commutative enc] * failed_dec_session * fixed tests * added commen * added more decryption session tests * helper to localize an issue * more computations to localize error * decryption_session::SessionParams * added tests for EC math to localize problem * secretstore network transport * encryption_session_works_over_network * network errors processing * connecting to KeyServer * licenses * get rid of debug println-s * fixed secretstore args * encryption results are stored in KS database * decryption protocol works over network * enc/dec Session traits * fixing warnings * fix after merge * on-chain ACL checker proto * fixed compilation * fixed compilation * finally fixed <odd>-of-N-scheme * temporary commented test * 1-of-N works in math * scheme 1-of-N works * updated AclStorage with real contract ABI * remove unnecessary unsafety * fixed grumbles * wakeup on access denied * encrypt secretstore messages * 'shadow' decryption * fix grumbles * lost files * secretstore cli-options * decryption seccion when ACL check failed on master * disallow regenerating key for existing document * removed obsolete TODO * fix after merge * switched to tokio_io * fix after merge * fix after merge * fix after merge * fix after merge * fix after merge * fixed test * fix after merge
2017-04-08 11:26:16 +02:00
nodes: None,
server_set_contract: None,
interface: None,
Fixing secretstore TODOs - part 1 (#5386) * ECDKG protocol prototype * added test for enc/dec math * get rid of decryption_session * added licenses * fix after merge * get rid of unused serde dependency * doc * decryption session [without commutative enc] * failed_dec_session * fixed tests * added commen * added more decryption session tests * helper to localize an issue * more computations to localize error * decryption_session::SessionParams * added tests for EC math to localize problem * secretstore network transport * encryption_session_works_over_network * network errors processing * connecting to KeyServer * licenses * get rid of debug println-s * fixed secretstore args * encryption results are stored in KS database * decryption protocol works over network * enc/dec Session traits * fixing warnings * fix after merge * on-chain ACL checker proto * fixed compilation * fixed compilation * finally fixed <odd>-of-N-scheme * temporary commented test * 1-of-N works in math * scheme 1-of-N works * updated AclStorage with real contract ABI * remove unnecessary unsafety * fixed grumbles * wakeup on access denied * encrypt secretstore messages * 'shadow' decryption * fix grumbles * lost files * secretstore cli-options * decryption seccion when ACL check failed on master * disallow regenerating key for existing document * removed obsolete TODO * fix after merge * switched to tokio_io * fix after merge * fix after merge * fix after merge * fix after merge * fix after merge * fixed test * fix after merge
2017-04-08 11:26:16 +02:00
port: Some(8083),
http_interface: None,
http_port: Some(8082),
path: None,
}),
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()),
reseal_on_uncle: None,
2016-09-10 11:37:14 +02:00
reseal_min_period: Some(4000),
reseal_max_period: Some(60000),
2016-09-10 11:37:14 +02:00
work_queue_size: None,
relay_set: None,
min_gas_price: None,
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,
tx_queue_size: Some(8192),
New Transaction Queue implementation (#8074) * Implementation of Verifier, Scoring and Ready. * Queue in progress. * TransactionPool. * Prepare for txpool release. * Miner refactor [WiP] * WiP reworking miner. * Make it compile. * Add some docs. * Split blockchain access to a separate file. * Work on miner API. * Fix ethcore tests. * Refactor miner interface for sealing/work packages. * Implement next nonce. * RPC compiles. * Implement couple of missing methdods for RPC. * Add transaction queue listeners. * Compiles! * Clean-up and parallelize. * Get rid of RefCell in header. * Revert "Get rid of RefCell in header." This reverts commit 0f2424c9b7319a786e1565ea2a8a6d801a21b4fb. * Override Sync requirement. * Fix status display. * Unify logging. * Extract some cheap checks. * Measurements and optimizations. * Fix scoring bug, heap size of bug and add cache * Disable tx queueing and parallel verification. * Make ethcore and ethcore-miner compile again. * Make RPC compile again. * Bunch of txpool tests. * Migrate transaction queue tests. * Nonce Cap * Nonce cap cache and tests. * Remove stale future transactions from the queue. * Optimize scoring and write some tests. * Simple penalization. * Clean up and support for different scoring algorithms. * Add CLI parameters for the new queue. * Remove banning queue. * Disable debug build. * Change per_sender limit to be 1% instead of 5% * Avoid cloning when propagating transactions. * Remove old todo. * Post-review fixes. * Fix miner options default. * Implement back ready transactions for light client. * Get rid of from_pending_block * Pass rejection reason. * Add more details to drop. * Rollback heap size of. * Avoid cloning hashes when propagating and include more details on rejection. * Fix tests. * Introduce nonces cache. * Remove uneccessary hashes allocation. * Lower the mem limit. * Re-enable parallel verification. * Add miner log. Don't check the type if not below min_gas_price. * Add more traces, fix disabling miner. * Fix creating pending blocks twice on AuRa authorities. * Fix tests. * re-use pending blocks in AuRa * Use reseal_min_period to prevent too frequent update_sealing. * Fix log to contain hash not sender. * Optimize local transactions. * Fix aura tests. * Update locks comments. * Get rid of unsafe Sync impl. * Review fixes. * Remove excessive matches. * Fix compilation errors. * Use new pool in private transactions. * Fix private-tx test. * Fix secret store tests. * Actually use gas_floor_target * Fix config tests. * Fix pool tests. * Address grumbles.
2018-04-13 17:34:27 +02:00
tx_queue_per_sender: None,
tx_queue_mem_limit: None,
tx_queue_locals: None,
tx_queue_strategy: None,
tx_queue_ban_count: None,
tx_queue_ban_time: None,
tx_queue_no_unfamiliar_locals: None,
tx_queue_no_early_reject: None,
2016-09-10 11:37:14 +02:00
tx_gas_limit: None,
tx_time_limit: None,
2016-09-10 11:37:14 +02:00
extra_data: None,
remove_solved: None,
notify_work: None,
refuse_service_transactions: None,
infinite_pending_block: None,
max_round_blocks_to_import: None,
}),
footprint: Some(Footprint {
2016-09-10 11:37:14 +02:00
tracing: Some("on".into()),
pruning: Some("fast".into()),
pruning_history: Some(64),
pruning_memory: None,
2016-09-10 11:37:14 +02:00
fast_and_loose: None,
cache_size: None,
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()),
fat_db: Some("off".into()),
2016-12-02 18:36:00 +01:00
scale_verifiers: Some(false),
num_verifiers: None,
}),
snapshots: Some(Snapshots {
2020-09-15 16:51:49 +02:00
enable: Some(false),
processing_threads: None,
}),
misc: Some(Misc {
2016-09-10 11:37:14 +02:00
logging: Some("own_tx=trace".into()),
2020-09-22 14:53:52 +02:00
log_file: Some("/var/log/openethereum.log".into()),
color: Some(true),
ports_shift: Some(0),
unsafe_expose: Some(false),
}),
stratum: None,
2016-09-10 11:37:14 +02:00
}
);
}
2020-08-05 06:08:03 +02:00
#[test]
fn should_not_accept_min_peers_bigger_than_max_peers() {
2020-09-22 14:53:52 +02:00
match Args::parse(&["openethereum", "--max-peers=39", "--min-peers=40"]) {
Err(ArgsError::PeerConfiguration) => (),
_ => assert_eq!(false, true),
}
}
2020-08-05 06:08:03 +02:00
#[test]
fn should_accept_max_peers_equal_or_bigger_than_min_peers() {
2020-09-22 14:53:52 +02:00
Args::parse(&["openethereum", "--max-peers=40", "--min-peers=40"]).unwrap();
Args::parse(&["openethereum", "--max-peers=100", "--min-peers=40"]).unwrap();
}
2016-09-10 11:37:14 +02:00
}