aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
AgeCommit message (Collapse)Author
2019-10-19rpc: fix -rpcclienttimeout 0 optionFabian Jahr
Github-Pull: #17131 Rebased-From: b3b26e149c34fee9c7ae8548c6e547ec6254b441
2019-09-06Testchains: Generic selection with -chain=<str> in addition of -testnet and ↵Jorge Timón
-regtest
2019-08-19Merge #15864: Fix datadir handlingMarcoFalke
ffea41f5301d5582665cf10ba5c2b9547a1443de Enable all tests in feature_config_args.py (Hennadii Stepanov) 66f5c17f8a3fe06fc65191e379ffc04e43cbbc86 Use CheckDataDirOption() for code uniformity (Hennadii Stepanov) 7e33a18a34b1a9b0f115076c142661d6d30c0585 Fix datadir handling in bitcoin-cli (Hennadii Stepanov) b28dada37465c0a773cf08b0e6766f0081bcb943 Fix datadir handling in bitcoin-qt (Hennadii Stepanov) 50824093bb2d68fe1393dfd636fab5f8795faa5d Fix datadir handling in bitcoind (Hennadii Stepanov) 740d41ce9f7fdf209366e930bd0fdcc6b1bc6b79 Add CheckDataDirOption() function (Hennadii Stepanov) c1f325126cf51d28dce8da74bfdf5cd05ab237ea Return absolute path early in AbsPathForConfigVal (Hennadii Stepanov) Pull request description: Fix #15240, see: https://github.com/bitcoin/bitcoin/issues/15240#issuecomment-487353760 Fix #15745 Fix broken `feature_config_args.py` tests (disabled by MarcoFalke@fabe28a0cdcfa13e0e595a0905e3642a960d3077). All test are enabled now. This PR is alternative to #13621. User's `$HOME` directory is not touched unnecessarily now. ~To make reviewing easier only `bitcoind` code is modified (neither `bitcoin-cli` nor `bitcoin-qt`).~ Refs: - https://github.com/bitcoin/bitcoin/issues/15745#issuecomment-479852569 by **laanwj** - #16220 Top commit has no ACKs. Tree-SHA512: 4a4cda10e0b67c8f374da0c9567003d2b566d948e7f8550fe246868b5794c15010e88ea206009480b9cd2f737f310a15e984f920730448f99a895893bed351df
2019-07-27Use ArgsManager::NETWORK_ONLY flagHennadii Stepanov
2019-07-27scripted-diff: Use ArgsManager::DEBUG_ONLY flagHennadii Stepanov
-BEGIN VERIFY SCRIPT- sed -i 's/unsigned int flags, const bool debug_only,/unsigned int flags,/' src/util/system.h src/util/system.cpp sed -i 's/ArgsManager::NONE, debug_only/flags, false/' src/util/system.cpp sed -i 's/arg.second.m_debug_only/(arg.second.m_flags \& ArgsManager::DEBUG_ONLY)/' src/util/system.cpp sed -i 's/ArgsManager::ALLOW_ANY, true, OptionsCategory::/ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src) sed -i 's/ArgsManager::ALLOW_ANY, false, OptionsCategory::/ArgsManager::ALLOW_ANY, OptionsCategory::/' $(git grep --files-with-matches 'AddArg(' src) -END VERIFY SCRIPT-
2019-07-27scripted-diff: Use Flags enum in AddArg()Hennadii Stepanov
-BEGIN VERIFY SCRIPT- sed -i 's/const bool debug_only,/unsigned int flags, &/' src/util/system.h src/util/system.cpp sed -i -E 's/(true|false), OptionsCategory::/ArgsManager::ALLOW_ANY, &/' $(git grep --files-with-matches 'AddArg(' src) -END VERIFY SCRIPT-
2019-07-24Fix datadir handling in bitcoin-cliHennadii Stepanov
This prevents premature tries to access or create the default datadir. This is useful when the -datadir option is specified and the default datadir is unreachable.
2019-07-24Refactor out translation.hHennadii Stepanov
This is a prerequisite for introducing bilingual error messages. Note: #includes are arranged by clang-format-diff.py script.
2019-07-05rpc: migrate JSONRPCRequest functionality into request.cppKarl-Johan Alm
2019-06-13Replace remaining fprintf with tfm::format manuallyMarcoFalke
2019-06-13scripted-diff: Replace fprintf with tfm::formatMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/fprintf\(std(err|out), /tfm::format(std::c\1, /g' $(git grep -l 'fprintf(' -- ':(exclude)src/crypto' ':(exclude)src/leveldb' ':(exclude)src/univalue' ':(exclude)src/secp256k1') -END VERIFY SCRIPT- fixup! scripted-diff: Replace fprintf with tfm::format
2019-03-11Merge #15564: cli: remove duplicate wallet fields from -getinfoMarcoFalke
3f6568d66b cli: remove duplicate wallet fields from -getinfo (fanquake) Pull request description: `walletversion` and `balance` are both included below. Tree-SHA512: cd9fe9739a2f492c8f7c0407b43a6fa95187f7e5318f05e080bac112f9f4333d2e9b84c505d098f8d66fa79439007d1c0b22e5a87d70bf5ea53ab647ee4c2046
2019-03-09cli: remove duplicate wallet fields from -getinfofanquake
2019-03-09cli: replace testnet with chain and return network name as per BIP70.fanquake
2019-02-06util: Add SetupHelpOptions()MarcoFalke
2018-12-07Merge #14480: refactor: Drop boost::this_thread::interruption_point and ↵Wladimir J. van der Laan
boost::thread_interrupted in main thread b7df96f4565064bcb7cbbf7e2507e03bdcf339f0 refactor: Drop boost::this_thread::interruption_point and boost::thread_interrupted in main thread (Chun Kuan Lee) Pull request description: This PR drops useless `boost::this_thread::interruption_point` and `boost::thread_interrupted` catch. They are only executed in main thread. Tree-SHA512: a980d098c1a8238e4f0da9493731d7e69b9ca8e010103f442722d0d4cce471cc40a1fafd5f05535ad0e18899b6cf7563ee20e4025f7c7bc15182a0058c028922
2018-11-23Merge #14448: doc: Clarify rpcwallet flag url changeWladimir J. van der Laan
0c69ff61719e9bc4938a9675a36b4170dfca4e6c clarify rpcwallet flag url change (Jordan Baczuk) Pull request description: This adds clarification to the bitcoin-cli -rpcwallet flag in the help command. This will benefit users who want to utilize this feature without the cli, for example curl. It isn't readily apparent that this changes the url used in the RPC call. Tree-SHA512: 6fc759f193f0a918884aab8ba4dc77ed9e89ee3840feeff737a754be758750590f5bd44b40f4810c3b82601e125e62e10360af45cb8e9d95be206ebeb9120ebf
2018-11-04scripted-diff: Move util files to separate directory.Jim Posen
-BEGIN VERIFY SCRIPT- mkdir -p src/util git mv src/util.h src/util/system.h git mv src/util.cpp src/util/system.cpp git mv src/utilmemory.h src/util/memory.h git mv src/utilmoneystr.h src/util/moneystr.h git mv src/utilmoneystr.cpp src/util/moneystr.cpp git mv src/utilstrencodings.h src/util/strencodings.h git mv src/utilstrencodings.cpp src/util/strencodings.cpp git mv src/utiltime.h src/util/time.h git mv src/utiltime.cpp src/util/time.cpp sed -i 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h sed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h sed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h sed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h sed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h sed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am sed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am sed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am sed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am sed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am sed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh sed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh sed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh sed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh sed -i 's/src\\utilstrencodings\.cpp/src\\util\\strencodings\.cpp/' build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj -END VERIFY SCRIPT-
2018-10-15refactor: Drop boost::this_thread::interruption_point and ↵Chun Kuan Lee
boost::thread_interrupted in main thread
2018-10-09clarify rpcwallet flag url changeJordan Baczuk
2018-09-30utils: Convert Windows args to utf-8 stringChun Kuan Lee
2018-09-19init: Remove deprecated args from hidden argsMarcoFalke
2018-09-10don't translate command line optionsMichael Polzer
2018-09-04Merge #14013: [doc] Add new regtest ports in man following #10825 ports ↵Wladimir J. van der Laan
reattributions e8c4a1e36969d2ef816d9dfaaee979a8cf6bfffe Add new regtest ports in doc following #10825 ports reattributions (Antoine Riard) Pull request description: Following #10825, regtest ports for p2p connections and JSON-RPC connections have been remapped from 18333 and 18332 to 18444 and 18443. This change is not documented in the wiki or nowhere else and it's puzzling to guess why your regtest JSON-rpc connections all failed even if you're following the docs. Tree-SHA512: e2a1b9b4059060d9ed0900c1554e124ed69ae3e4648474880795128e77c7324d68aba52e4acda2f47390a9c3d36629b777e3b8c0eb10f0e08a2b120c4119dff3
2018-08-24util: Replace boost::signals2 with std::functionMarcoFalke
2018-08-23Add new regtest ports in doc following #10825 ports reattributionsAntoine Riard
Add checkmempool and checkblockindex regtest true in doc
2018-08-13Merge #13905: docs: fixed bitcoin-cli -help output for help2manMarcoFalke
869193f5a6 docs: fixed bitcoin-cli -help output for help2man (Hennadii Stepanov) Pull request description: Currently `bitcon-cli -help` output forces help2man to produce `.TP` and `.IP` commands instead of a single `.IP` command for `-stdinrpcpass` option. Removing an extra space fixes this issue. This pull request is rebased from #13879 Tree-SHA512: 1c5b25ed2ef7b7de42bc6210165bdbabe63f045699487f2db4790e0d3176f6493dfd3e8e19f4ddc38b551539465d7b41aea570f20dccbc0609f00fdfee1b5180
2018-08-13docs: fixed bitcoin-cli -help output for help2manHennadii Stepanov
The `help2man` parses a string containing two spaces between words with an issue: it gives out `.TP` and `.IP` commands instead of a single `.IP` command. Removing an extra space fixes this issue. Currently the `-help` output for the `-stdin` option looks without any issue due to eliminating of two spaces between words by a `FormatParagraph` call for this particular case. For consistency and preventing from future regressions extra spaces have been removed from the both lines. The redundant `strprintf` call has been removed aswell.
2018-08-08Merge #13780: 0.17: Pre-branch maintenanceWladimir J. van der Laan
3fc20632a3ad30809356a58d2cf0ea4a4ad4cec3 qt: Set BLOCK_CHAIN_SIZE = 220 (DrahtBot) 2b6a2f4a28792f2fe9dc1be843b1ff1ecae35e8a Regenerate manpages (DrahtBot) eb7daf4d600eeb631427c018a984a77a34aca66e Update copyright headers to 2018 (DrahtBot) Pull request description: Some trivial maintenance to avoid having to do it again after the 0.17 branch off. (The scripts to do this are in `./contrib/`) Tree-SHA512: 16b2af45e0351b1c691c5311d48025dc6828079e98c2aa2e600dc5910ee8aa01858ca6c356538150dc46fe14c8819ed8ec8e4ec9a0f682b9950dd41bc50518fa
2018-08-04[docs] Reformat -help output for help2manTim Ruffing
This commit slightly changes the format of the "Usage" strings in CLI `-help` messages to meet the expection of the help2man tool, which we use to generate man pages. On the way, we remove a few calls to `strprintf()`, which became superficial after commit 32fbfda.
2018-07-27Update copyright headers to 2018DrahtBot
2018-07-20Fix bitcoin-cli --versionBen Woosley
By declaring the relevant option. Note contrib/devtools/gen-manpages.sh relies on this version information.
2018-06-04cli: Ignore libevent warningsCory Fields
2018-05-30Give an error and exit if there are unknown parametersAndrew Chow
If an unknown option is given via either the command line args or the conf file, throw an error and exit Update tests for ArgsManager knowing args Ignore unknown options in the config file for bitcoin-cli Fix tests and bitcoin-cli to match actual options used
2018-05-30Stop translating command line optionsWladimir J. van der Laan
Many options are extremely technical, and refer internals, making it difficult to translate usefully. This came up in discussion of e.g. #10949. If a message is not understood by translators (which are typically end-users, not developers) they'll either translate it literally, making it harder to understand instead of easier, with the added drawback of the user no longer being able to google it. Also the translation was only working for bitcoin-qt as with the console programs, there is no translation backend. So it was injecting never-used translation messages for bitcoin-cli, -tx. For these reasons, stop translating options help completely. This should not affect the output **in any way** except for bitcoin-qt when a non-English language is configured in the locale. This implements #10962.
2018-05-09Make gArgs aware of the argumentsAndrew Chow
gArgs knows what the available arguments are and their help. Getting the help message is moved to gArgs and HelpMessage() is removed
2018-05-09Merge #10267: New -includeconf argument for including external configuration ↵Wladimir J. van der Laan
files 25b7ab9 doc: Add release notes for -includeconf (Karl-Johan Alm) 0f0badd test: Test includeconf parameter. (Karl-Johan Alm) 629ff8c -includeconf=<path> support in config handler, for including external configuration files (Karl-Johan Alm) Pull request description: Fixes: #10071. Done: - adds `-includeconf=<path>`, where `<path>` is relative to `datadir` or to the path of the file being read, if in a file - protects against circular includes - updates help docs ~~~Thoughts:~~~ - ~~~I am not sure how to test this in a neat manner. Feedback on this would be nice. Will dig/think though.~~~ Tree-SHA512: cb31f1b2f69fbc0890d264948eb2e501ac05cf12f5e06a5942f9c1539eb15ea8dc3cae817f4073aecb2fcc21d0386747f14f89d990772003a76e2a6d25642553
2018-05-03Make it clear which functions that are intended to be translation unit localpracticalswift
Do not share functions that are meant to be translation unit local with other translation units. Use internal linkage for those consistently.
2018-04-26-includeconf=<path> support in config handler, for including external ↵Karl-Johan Alm
configuration files
2018-04-06Move ChainNameFromCommandLine into ArgsManager and rename to GetChainNameAnthony Towns
2018-04-05Merge #12859: Bugfix: Include <memory> for std::unique_ptrWladimir J. van der Laan
a5bca13 Bugfix: Include <memory> for std::unique_ptr (Luke Dashjr) Pull request description: Not sure why all these includes were missing, but it's breaking builds for some users: https://bugs.gentoo.org/show_bug.cgi?id=652142 (Added to all files with a reference to `std::unique_ptr`) Tree-SHA512: 8a2c67513ca07b9bb52c34e8a20b15e56f8af2530310d9ee9b0a69694dd05e02e7a3683f14101a2685d457672b56addec591a0bb83900a0eb8e2a43d43200509
2018-04-02[moveonly] Extract HelpRequested to dry up the help options testingBen Woosley
This ensures consistency across interfaces and makes the version handling more clear.
2018-04-02Bugfix: Include <memory> for std::unique_ptrLuke Dashjr
2018-03-09bitcoin-cli: Provide a better error message when bitcoind is not runningpracticalswift
Before this patch: ``` $ bitcoin-cli -testnet echo 'hello world' error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (/root/.bitcoin/bitcoin.conf) ``` After this patch: ``` $ bitcoin-cli -testnet echo 'hello world' error: Could not connect to the server 127.0.0.1:18332 Make sure the bitcoind server is running and that you are connecting to the correct RPC port. ```
2018-03-03Create new wallet databases as directories rather than filesRussell Yanofsky
This change should make it easier for users to make complete backups of wallets because they can now just back up the specified `-wallet=<path>` path directly, instead of having to back up the specified path as well as the transaction log directory (for incompletely flushed wallets). Another advantage of this change is that if two wallets are located in the same directory, they will now use their own BerkeleyDB environments instead using a shared environment. Using a shared environment makes it difficult to manage and back up wallets separately because transaction log files will contain a mix of data from all wallets in the environment.
2018-03-03Allow wallet files not in -walletdir directoryRussell Yanofsky
Remove restriction that -wallet filenames can only refer to files in the -walletdir directory.
2018-02-06Merge #12050: [trivial] Implements a virtual destructor on the ↵Wladimir J. van der Laan
BaseRequestHandler class. bdb3231 Implements a virtual destructor on the BaseRequestHandler class. (251) Pull request description: Granted that there is no undefined behavior in the current implementation, this PR implements a virtual destructor on the BaseRequestHandler class to protect against undefined behavior in the event that an object of a potential future derived BaseRequestHandler class with a destructor is destroyed through a pointer to this base class. This PR also fixes "_warning: delete called on 'BaseRequestHandler' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]_" warnings in environments where the project is built with the `-Wsystem-headers` flag; or environments where the `-Wdelete-non-virtual-dtor` diagnostics flag fires from system headers. Tree-SHA512: 3c3b0797a8dbce8d8c5b244709e8bca41c4e28d5ba554a974bf7fc9128413e1098c457a00e51b21154ce6c11ce5da3071626e71d593b2550d0020bc589406eed
2018-02-05Clarify help messages for path args to mention datadir prefixJames O'Beirne
Change `-conf`'s and others' help messages to indicate that relative path values will be prefixed by the datadir path. This behavior is confusing when attempting to specify a configuration file in the current directory with `-conf=bitcoin.conf`, but loading the `bitcoin.conf` file in ~/.bitcoin datadir.
2018-02-01Properly alphabetize output of CLI --help option.murrayn
2018-01-03Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa