diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -16,7 +16,6 @@ void AppendParamsHelpMessages(std::string &strUsage, bool debugHelp) { strUsage += HelpMessageGroup(_("Chain selection options:")); - strUsage += HelpMessageOpt("-testnet", _("Use the test chain")); if (debugHelp) { strUsage += HelpMessageOpt( "-regtest", "Enter regression test mode, which uses a special " @@ -24,6 +23,7 @@ "This is intended for regression testing tools and app " "development."); } + strUsage += HelpMessageOpt("-testnet", _("Use the test chain")); } /** diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -340,9 +340,22 @@ "-alertnotify=", _("Execute command when a relevant alert is received or we see a " "really long fork (%s in cmd is replaced by message)")); + strUsage += HelpMessageOpt( + "-assumevalid=", + strprintf( + _("If this block is in the chain assume that it and its ancestors " + "are valid and potentially skip their script verification (0 to " + "verify all, default: %s, testnet: %s)"), + defaultChainParams->GetConsensus().defaultAssumeValid.GetHex(), + testnetChainParams->GetConsensus().defaultAssumeValid.GetHex())); strUsage += HelpMessageOpt("-blocknotify=", _("Execute command when the best block changes " "(%s in cmd is replaced by block hash)")); + strUsage += HelpMessageOpt( + "-blockreconstructionextratxn=", + strprintf(_("Extra transactions to keep in memory for compact block " + "reconstructions (default: %u)"), + DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN)); if (showDebug) { strUsage += HelpMessageOpt( "-blocksonly", @@ -350,14 +363,6 @@ _("Whether to operate in a blocks only mode (default: %d)"), DEFAULT_BLOCKSONLY)); } - strUsage += HelpMessageOpt( - "-assumevalid=", - strprintf( - _("If this block is in the chain assume that it and its ancestors " - "are valid and potentially skip their script verification (0 to " - "verify all, default: %s, testnet: %s)"), - defaultChainParams->GetConsensus().defaultAssumeValid.GetHex(), - testnetChainParams->GetConsensus().defaultAssumeValid.GetHex())); strUsage += HelpMessageOpt( "-conf=", strprintf(_("Specify configuration file (default: %s)"), BITCOIN_CONF_FILENAME)); @@ -391,14 +396,14 @@ strUsage += HelpMessageOpt( "-loadblock=", _("Imports blocks from external blk000??.dat file on startup")); - strUsage += HelpMessageOpt( - "-maxorphantx=", strprintf(_("Keep at most unconnectable " - "transactions in memory (default: %u)"), - DEFAULT_MAX_ORPHAN_TRANSACTIONS)); strUsage += HelpMessageOpt("-maxmempool=", strprintf(_("Keep the transaction memory pool " "below megabytes (default: %u)"), DEFAULT_MAX_MEMPOOL_SIZE)); + strUsage += HelpMessageOpt( + "-maxorphantx=", strprintf(_("Keep at most unconnectable " + "transactions in memory (default: %u)"), + DEFAULT_MAX_ORPHAN_TRANSACTIONS)); strUsage += HelpMessageOpt("-mempoolexpiry=", strprintf(_("Do not keep transactions in the mempool " @@ -413,22 +418,17 @@ defaultChainParams->GetConsensus().nMinimumChainWork.GetHex(), testnetChainParams->GetConsensus().nMinimumChainWork.GetHex())); } - strUsage += - HelpMessageOpt("-persistmempool", - strprintf(_("Whether to save the mempool on shutdown " - "and load on restart (default: %u)"), - DEFAULT_PERSIST_MEMPOOL)); - strUsage += HelpMessageOpt( - "-blockreconstructionextratxn=", - strprintf(_("Extra transactions to keep in memory for compact block " - "reconstructions (default: %u)"), - DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN)); strUsage += HelpMessageOpt( "-par=", strprintf(_("Set the number of script verification threads (%u to %d, " "0 = auto, <0 = leave that many cores free, default: %d)"), -GetNumCores(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS)); + strUsage += + HelpMessageOpt("-persistmempool", + strprintf(_("Whether to save the mempool on shutdown " + "and load on restart (default: %u)"), + DEFAULT_PERSIST_MEMPOOL)); #ifndef WIN32 strUsage += HelpMessageOpt( "-pid=", @@ -448,12 +448,12 @@ "via RPC, >%u = automatically prune block files to stay under " "the specified target size in MiB)"), MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024)); - strUsage += HelpMessageOpt( - "-reindex-chainstate", - _("Rebuild chain state from the currently indexed blocks")); strUsage += HelpMessageOpt("-reindex", _("Rebuild chain state and block index from " "the blk*.dat files on disk")); + strUsage += HelpMessageOpt( + "-reindex-chainstate", + _("Rebuild chain state from the currently indexed blocks")); #ifndef WIN32 strUsage += HelpMessageOpt( "-sysperms", @@ -532,6 +532,11 @@ "perspective of time may be influenced by peers forward or " "backward by this amount. (default: %u seconds)"), DEFAULT_MAX_TIME_ADJUSTMENT)); + strUsage += HelpMessageOpt( + "-maxuploadtarget=", + strprintf(_("Tries to keep outbound traffic under the given target (in " + "MiB per 24h), 0 = no limit (default: %d)"), + DEFAULT_MAX_UPLOAD_TARGET)); strUsage += HelpMessageOpt("-onion=", strprintf(_("Use separate SOCKS5 proxy to reach peers " @@ -540,15 +545,15 @@ strUsage += HelpMessageOpt( "-onlynet=", _("Only connect to nodes in network (ipv4, ipv6 or onion)")); - strUsage += - HelpMessageOpt("-permitbaremultisig", - strprintf(_("Relay non-P2SH multisig (default: %d)"), - DEFAULT_PERMIT_BAREMULTISIG)); strUsage += HelpMessageOpt( "-peerbloomfilters", strprintf(_("Support filtering of blocks and transaction with bloom " "filters (default: %d)"), DEFAULT_PEERBLOOMFILTERS)); + strUsage += + HelpMessageOpt("-permitbaremultisig", + strprintf(_("Relay non-P2SH multisig (default: %d)"), + DEFAULT_PERMIT_BAREMULTISIG)); strUsage += HelpMessageOpt( "-port=", strprintf( @@ -598,22 +603,16 @@ " " + _("Whitelisted peers cannot be DoS banned and their " "transactions are always relayed, even if they are already " "in the mempool, useful e.g. for a gateway")); - strUsage += HelpMessageOpt( - "-whitelistrelay", - strprintf(_("Accept relayed transactions received from whitelisted " - "peers even when not relaying transactions (default: %d)"), - DEFAULT_WHITELISTRELAY)); strUsage += HelpMessageOpt( "-whitelistforcerelay", strprintf(_("Force relay of transactions from whitelisted peers even " "if they violate local relay policy (default: %d)"), DEFAULT_WHITELISTFORCERELAY)); strUsage += HelpMessageOpt( - "-maxuploadtarget=", - strprintf(_("Tries to keep outbound traffic under the given target (in " - "MiB per 24h), 0 = no limit (default: %d)"), - DEFAULT_MAX_UPLOAD_TARGET)); - + "-whitelistrelay", + strprintf(_("Accept relayed transactions received from whitelisted " + "peers even when not relaying transactions (default: %d)"), + DEFAULT_WHITELISTRELAY)); strUsage += g_wallet_init_interface->GetHelpString(showDebug); #if ENABLE_ZMQ @@ -631,9 +630,14 @@ #endif strUsage += HelpMessageGroup(_("Debugging/Testing options:")); - strUsage += HelpMessageOpt("-uacomment=", - _("Append comment to the user agent string")); if (showDebug) { + strUsage += HelpMessageOpt( + "-checkblockindex", + strprintf("Do a full consistency check for mapBlockIndex, " + "setBlockIndexCandidates, chainActive and " + "mapBlocksUnlinked occasionally. Also sets -checkmempool " + "(default: %u)", + defaultChainParams->DefaultConsistencyChecks())); strUsage += HelpMessageOpt( "-checkblocks=", strprintf( @@ -644,13 +648,6 @@ strprintf(_("How thorough the block verification of " "-checkblocks is (0-4, default: %u)"), DEFAULT_CHECKLEVEL)); - strUsage += HelpMessageOpt( - "-checkblockindex", - strprintf("Do a full consistency check for mapBlockIndex, " - "setBlockIndexCandidates, chainActive and " - "mapBlocksUnlinked occasionally. Also sets -checkmempool " - "(default: %u)", - defaultChainParams->DefaultConsistencyChecks())); strUsage += HelpMessageOpt( "-checkmempool=", strprintf("Run checks every transactions (default: %u)", @@ -659,31 +656,19 @@ "-checkpoints", strprintf("Only accept block chain matching " "built-in checkpoints (default: %d)", DEFAULT_CHECKPOINTS_ENABLED)); - strUsage += HelpMessageOpt( - "-disablesafemode", strprintf("Disable safemode, override a real " - "safe mode event (default: %d)", - DEFAULT_DISABLE_SAFEMODE)); strUsage += HelpMessageOpt("-deprecatedrpc=", "Allows deprecated RPC method(s) to be used"); strUsage += HelpMessageOpt( - "-testsafemode", - strprintf("Force safe mode (default: %d)", DEFAULT_TESTSAFEMODE)); + "-disablesafemode", strprintf("Disable safemode, override a real " + "safe mode event (default: %d)", + DEFAULT_DISABLE_SAFEMODE)); strUsage += HelpMessageOpt("-dropmessagestest=", "Randomly drop 1 of every network messages"); strUsage += HelpMessageOpt("-fuzzmessagestest=", "Randomly fuzz 1 of every network messages"); - strUsage += HelpMessageOpt( - "-stopafterblockimport", - strprintf( - "Stop running after importing blocks from disk (default: %d)", - DEFAULT_STOPAFTERBLOCKIMPORT)); - strUsage += HelpMessageOpt( - "-stopatheight", strprintf("Stop running after reaching the given " - "height in the main chain (default: %u)", - DEFAULT_STOPATHEIGHT)); strUsage += HelpMessageOpt( "-limitancestorcount=", strprintf("Do not accept transactions if number of in-mempool " @@ -706,6 +691,20 @@ "more than kilobytes of in-mempool descendants " "(default: %u).", DEFAULT_DESCENDANT_SIZE_LIMIT)); + strUsage += HelpMessageOpt( + "-stopafterblockimport", + strprintf( + "Stop running after importing blocks from disk (default: %d)", + DEFAULT_STOPAFTERBLOCKIMPORT)); + strUsage += HelpMessageOpt( + "-stopatheight", strprintf("Stop running after reaching the given " + "height in the main chain (default: %u)", + DEFAULT_STOPATHEIGHT)); + strUsage += HelpMessageOpt( + "-testsafemode", + strprintf("Force safe mode (default: %d)", DEFAULT_TESTSAFEMODE)); + strUsage += HelpMessageOpt( + "-uacomment=", _("Append comment to the user agent string")); } strUsage += HelpMessageOpt( "-debug=", @@ -720,65 +719,51 @@ strprintf(_("Exclude debugging information for a category. Can be used " "in conjunction with -debug=1 to output debug logs for all " "categories except one or more specified categories."))); - if (showDebug) { - strUsage += HelpMessageOpt( - "-nodebug", "Turn off debugging messages, same as -debug=0"); - } + strUsage += HelpMessageOpt( + "-excessutxocharge=", + strprintf(_("Fees (in %s/kB) to charge per utxo created for" + "relaying, and mining (default: %s)"), + CURRENCY_UNIT, FormatMoney(DEFAULT_UTXO_FEE))); strUsage += HelpMessageOpt( "-help-debug", _("Show all debugging options (usage: --help -help-debug)")); + if (showDebug) { + strUsage += HelpMessageOpt( + "-limitfreerelay=", + strprintf("Continuously rate-limit free transactions to *1000 " + "bytes per minute (default: %u)", + DEFAULT_LIMITFREERELAY)); + } strUsage += HelpMessageOpt( "-logips", strprintf(_("Include IP addresses in debug output (default: %d)"), DEFAULT_LOGIPS)); - strUsage += HelpMessageOpt( - "-logtimestamps", - strprintf(_("Prepend debug output with timestamp (default: %d)"), - DEFAULT_LOGTIMESTAMPS)); if (showDebug) { strUsage += HelpMessageOpt( "-logtimemicros", strprintf( "Add microsecond precision to debug timestamps (default: %d)", DEFAULT_LOGTIMEMICROS)); + } + strUsage += HelpMessageOpt( + "-logtimestamps", + strprintf(_("Prepend debug output with timestamp (default: %d)"), + DEFAULT_LOGTIMESTAMPS)); + if (showDebug) { strUsage += HelpMessageOpt( - "-mocktime=", - "Replace actual time with seconds since epoch (default: 0)"); - strUsage += HelpMessageOpt( - "-limitfreerelay=", - strprintf("Continuously rate-limit free transactions to *1000 " - "bytes per minute (default: %u)", - DEFAULT_LIMITFREERELAY)); - strUsage += - HelpMessageOpt("-relaypriority", - strprintf("Require high priority for relaying free " - "or low-fee transactions (default: %d)", - DEFAULT_RELAYPRIORITY)); + "-maxscriptcachesize=", + strprintf("Limit size of script cache to MiB (default: %u)", + DEFAULT_MAX_SCRIPT_CACHE_SIZE)); strUsage += HelpMessageOpt( "-maxsigcachesize=", strprintf("Limit size of signature cache to MiB (default: %u)", DEFAULT_MAX_SIG_CACHE_SIZE)); - strUsage += HelpMessageOpt( - "-maxscriptcachesize=", - strprintf("Limit size of script cache to MiB (default: %u)", - DEFAULT_MAX_SCRIPT_CACHE_SIZE)); strUsage += HelpMessageOpt( "-maxtipage=", strprintf("Maximum tip age in seconds to consider node in initial " "block download (default: %u)", DEFAULT_MAX_TIP_AGE)); } - strUsage += HelpMessageOpt( - "-excessutxocharge=", - strprintf(_("Fees (in %s/kB) to charge per utxo created for" - "relaying, and mining (default: %s)"), - CURRENCY_UNIT, FormatMoney(DEFAULT_UTXO_FEE))); - strUsage += HelpMessageOpt( - "-minrelaytxfee=", - strprintf( - _("Fees (in %s/kB) smaller than this are considered zero fee for " - "relaying, mining and transaction creation (default: %s)"), - CURRENCY_UNIT, FormatMoney(DEFAULT_MIN_RELAY_TX_FEE_PER_KB))); strUsage += HelpMessageOpt( "-maxtxfee=", strprintf(_("Maximum total fees (in %s) to use in a single wallet " @@ -786,14 +771,30 @@ "abort large transactions (default: %s)"), CURRENCY_UNIT, FormatMoney(DEFAULT_TRANSACTION_MAXFEE))); strUsage += HelpMessageOpt( - "-printtoconsole", - _("Send trace/debug info to console instead of debug.log file")); + "-minrelaytxfee=", + strprintf( + _("Fees (in %s/kB) smaller than this are considered zero fee for " + "relaying, mining and transaction creation (default: %s)"), + CURRENCY_UNIT, FormatMoney(DEFAULT_MIN_RELAY_TX_FEE_PER_KB))); if (showDebug) { + strUsage += HelpMessageOpt( + "-mocktime=", + "Replace actual time with seconds since epoch (default: 0)"); + strUsage += + HelpMessageOpt("-relaypriority", + strprintf("Require high priority for relaying free " + "or low-fee transactions (default: %d)", + DEFAULT_RELAYPRIORITY)); + strUsage += HelpMessageOpt( + "-nodebug", "Turn off debugging messages, same as -debug=0"); strUsage += HelpMessageOpt( "-printpriority", strprintf("Log transaction priority and fee per " "kB when mining blocks (default: %d)", DEFAULT_PRINTPRIORITY)); } + strUsage += HelpMessageOpt( + "-printtoconsole", + _("Send trace/debug info to console instead of debug.log file")); strUsage += HelpMessageOpt("-shrinkdebugfile", _("Shrink debug.log file on client startup " "(default: 1 when no -debug)")); @@ -808,17 +809,6 @@ "Relay and mine \"non-standard\" transactions (%sdefault: %u)", "testnet/regtest only; ", defaultChainParams->RequireStandard())); - strUsage += - HelpMessageOpt("-excessiveblocksize=", - strprintf(_("Do not accept blocks larger than this " - "limit, in bytes (default: %d)"), - DEFAULT_MAX_BLOCK_SIZE)); - strUsage += HelpMessageOpt( - "-dustrelayfee=", - strprintf("Fee rate (in %s/kB) used to defined dust, the value of " - "an output such that it will cost about 1/3 of its value " - "in fees at this fee rate to spend it. (default: %s)", - CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE))); } strUsage += HelpMessageOpt("-bytespersigop", @@ -834,22 +824,35 @@ strprintf(_("Maximum size of data in data carrier transactions we " "relay and mine (default: %u)"), MAX_OP_RETURN_RELAY)); + if (showDebug) { + strUsage += HelpMessageOpt( + "-dustrelayfee=", + strprintf("Fee rate (in %s/kB) used to defined dust, the value of " + "an output such that it will cost about 1/3 of its value " + "in fees at this fee rate to spend it. (default: %s)", + CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE))); + strUsage += + HelpMessageOpt("-excessiveblocksize=", + strprintf(_("Do not accept blocks larger than this " + "limit, in bytes (default: %d)"), + DEFAULT_MAX_BLOCK_SIZE)); + } strUsage += HelpMessageGroup(_("Block creation options:")); strUsage += HelpMessageOpt( "-blockmaxsize=", strprintf(_("Set maximum block size in bytes (default: %d)"), DEFAULT_MAX_GENERATED_BLOCK_SIZE)); - strUsage += HelpMessageOpt( - "-blockprioritypercentage=", - strprintf(_("Set maximum percentage of a block reserved to " - "high-priority/low-fee transactions (default: %d)"), - DEFAULT_BLOCK_PRIORITY_PERCENTAGE)); strUsage += HelpMessageOpt( "-blockmintxfee=", strprintf(_("Set lowest fee rate (in %s/kB) for transactions to be " "included in block creation. (default: %s)"), CURRENCY_UNIT, FormatMoney(DEFAULT_BLOCK_MIN_TX_FEE_PER_KB))); + strUsage += HelpMessageOpt( + "-blockprioritypercentage=", + strprintf(_("Set maximum percentage of a block reserved to " + "high-priority/low-fee transactions (default: %d)"), + DEFAULT_BLOCK_PRIORITY_PERCENTAGE)); if (showDebug) { strUsage += HelpMessageOpt("-blockversion=", @@ -857,11 +860,23 @@ } strUsage += HelpMessageGroup(_("RPC server options:")); - strUsage += HelpMessageOpt("-server", - _("Accept command line and JSON-RPC commands")); strUsage += HelpMessageOpt( "-rest", strprintf(_("Accept public REST requests (default: %d)"), DEFAULT_REST_ENABLE)); + strUsage += HelpMessageOpt( + "-rpcallowip=", + _("Allow JSON-RPC connections from specified source. Valid for " + "are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. " + "1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This " + "option can be specified multiple times")); + strUsage += HelpMessageOpt( + "-rpcauth=", + _("Username and hashed password for JSON-RPC connections. The field " + " comes in the format: :$. A canonical " + "python script is included in share/rpcuser. The client then " + "connects normally using the " + "rpcuser=/rpcpassword= pair of arguments. This " + "option can be specified multiple times")); strUsage += HelpMessageOpt( "-rpcbind=", _("Bind to given address to listen for JSON-RPC connections. Use " @@ -870,47 +885,35 @@ strUsage += HelpMessageOpt("-rpccookiefile=", _("Location of the auth cookie (default: data dir)")); - strUsage += HelpMessageOpt("-rpcuser=", - _("Username for JSON-RPC connections")); + strUsage += HelpMessageOpt( + "-rpccorsdomain=value", + "Domain from which to accept cross origin requests (browser enforced)"); strUsage += HelpMessageOpt("-rpcpassword=", _("Password for JSON-RPC connections")); - strUsage += HelpMessageOpt( - "-rpcauth=", - _("Username and hashed password for JSON-RPC connections. The field " - " comes in the format: :$. A canonical " - "python script is included in share/rpcuser. The client then " - "connects normally using the " - "rpcuser=/rpcpassword= pair of arguments. This " - "option can be specified multiple times")); strUsage += HelpMessageOpt( "-rpcport=", strprintf(_("Listen for JSON-RPC connections on (default: %u or " "testnet: %u)"), defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort())); - strUsage += HelpMessageOpt( - "-rpcallowip=", - _("Allow JSON-RPC connections from specified source. Valid for " - "are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. " - "1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This " - "option can be specified multiple times")); + strUsage += + HelpMessageOpt("-rpcservertimeout=", + strprintf("Timeout during HTTP requests (default: %d)", + DEFAULT_HTTP_SERVER_TIMEOUT)); strUsage += HelpMessageOpt( "-rpcthreads=", strprintf( _("Set the number of threads to service RPC calls (default: %d)"), DEFAULT_HTTP_THREADS)); - strUsage += HelpMessageOpt( - "-rpccorsdomain=value", - "Domain from which to accept cross origin requests (browser enforced)"); + strUsage += HelpMessageOpt("-rpcuser=", + _("Username for JSON-RPC connections")); if (showDebug) { strUsage += HelpMessageOpt( "-rpcworkqueue=", strprintf("Set the depth of the work queue to " "service RPC calls (default: %d)", DEFAULT_HTTP_WORKQUEUE)); - strUsage += HelpMessageOpt( - "-rpcservertimeout=", - strprintf("Timeout during HTTP requests (default: %d)", - DEFAULT_HTTP_SERVER_TIMEOUT)); } + strUsage += HelpMessageOpt("-server", + _("Accept command line and JSON-RPC commands")); return strUsage; } diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -56,14 +56,14 @@ strUsage += HelpMessageOpt( "-disablewallet", _("Do not load the wallet and disable wallet RPC calls")); - strUsage += HelpMessageOpt( - "-keypool=", strprintf(_("Set key pool size to (default: %u)"), - DEFAULT_KEYPOOL_SIZE)); strUsage += HelpMessageOpt( "-fallbackfee=", strprintf(_("A fee rate (in %s/kB) that will be used when fee " "estimation has insufficient data (default: %s)"), CURRENCY_UNIT, FormatMoney(DEFAULT_FALLBACK_FEE))); + strUsage += HelpMessageOpt( + "-keypool=", strprintf(_("Set key pool size to (default: %u)"), + DEFAULT_KEYPOOL_SIZE)); strUsage += HelpMessageOpt( "-paytxfee=", strprintf( @@ -87,13 +87,13 @@ "so transactions begin confirmation on " "average within n blocks (default: %u)"), DEFAULT_TX_CONFIRM_TARGET)); + strUsage += HelpMessageOpt("-upgradewallet", + _("Upgrade wallet to latest format on startup")); strUsage += HelpMessageOpt( "-usehd", _("Use hierarchical deterministic key generation (HD) after BIP32. " "Only has effect during wallet creation/first start") + " " + strprintf(_("(default: %d)"), DEFAULT_USE_HD_WALLET)); - strUsage += HelpMessageOpt("-upgradewallet", - _("Upgrade wallet to latest format on startup")); strUsage += HelpMessageOpt("-wallet=", _("Specify wallet file (within data directory)") + " " +