aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
AgeCommit message (Collapse)Author
2021-12-30scripted-diff: Bump copyright headersHennadii Stepanov
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT- Commits of previous years: * 2020: fa0074e2d82928016a43ca408717154a1c70a4db * 2019: aaaaad6ac95b402fe18d019d67897ced6b316ee0
2021-11-11cli: hoist networks class data members to a constantJon Atack
2021-11-11cli: add cjdns network to -addrinfo and -netinfoJon Atack
2021-10-25scripted-diff: disable unimplemented ArgsManager BOOL/INT/STRING flagsRussell Yanofsky
This commit does not change behavior in any way. See previous commit for complete rationale, but these flags are being disabled because they aren't implemented and will otherwise break backwards compatibility when they are implemented. -BEGIN VERIFY SCRIPT- sed -i 's:\(ALLOW_.*\) \(//!< unimplemented\):// \1\2:' src/util/system.h sed -i '/DISALLOW_NEGATION.*scripted-diff/d' src/util/system.cpp git grep -l 'ArgsManager::ALLOW_\(INT\|STRING\)' | xargs sed -i 's/ArgsManager::ALLOW_\(INT\|STRING\)/ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION/g' git grep -l 'ALLOW_BOOL' -- ':!src/util/system.h' | xargs sed -i 's/ALLOW_BOOL/ALLOW_ANY/g' -END VERIFY SCRIPT-
2021-10-20netinfo: print peer counts for all reachable networksJon Atack
instead of only for networks we have peer connections to. Users reported the previous behavior caused confusion, as no column was printed when a network was reachable but no peers were connected. Users expected a column to be printed with 0 peers. This commit aligns behavior with that expectation.
2021-10-05refactor: Block unsafe fs::path std::string conversion callsRussell Yanofsky
There is no change in behavior. This just helps prepare for the transition from boost::filesystem to std::filesystem by avoiding calls to methods which will be unsafe after the transaction to std::filesystem to due lack of a boost::filesystem::path::imbue equivalent and inability to set a predictable locale. Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Co-authored-by: Kiminuo <kiminuo@protonmail.com> Co-authored-by: MarcoFalke <falke.marco@gmail.com>
2021-09-27scripted-diff: Rename overloaded int GetArg to GetIntArgRussell Yanofsky
Improve readability of code, simplify future scripted diff cleanup PRs, and be more consistent with naming for GetBoolArg. This will also be useful for replacing runtime settings type checking with compile time checking. -BEGIN VERIFY SCRIPT- git grep -l GetArg | xargs sed -i 's/GetArg(\([^)]*\( [0-9]\+\|-1\|port\|BaseParams().RPCPort()\|Params().GetDefaultPort()\|_TIMEOUT\|Height\|_WORKQUEUE\|_THREADS\|_CONNECTIONS\|LIMIT\|SigOp\|Bytes\|_VERSION\|_AGE\|_CHECKS\|Checks() ? 1 : 0\|_BANTIME\|Cache\|BLOCKS\|LEVEL\|Weight\|Version\|BUFFER\|TARGET\|WEIGHT\|TXN\|TRANSACTIONS\|ADJUSTMENT\|i64\|Size\|nDefault\|_EXPIRY\|HEIGHT\|SIZE\|SNDHWM\|_TIME_MS\)\))/GetIntArg(\1)/g' -END VERIFY SCRIPT- Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2021-09-20cli: Display all proxies in -getinfoklementtan
2021-09-16Merge bitcoin/bitcoin#22544: cli -addrinfo: drop torv2; torv3 becomes onion ↵W. J. van der Laan
per GetNetworkName() 49d503aefa74f11e5d93432987fa3775ed82c979 doc: update -addrinfo in release-notes.md and tor.md (Jon Atack) 75ea9ecf11bfeb120c58dc6c62539021a94ef97c cli -addrinfo: drop torv2, torv3 becomes onion per GetNetworkName() (Jon Atack) Pull request description: #22050 removed torv2 support from 22.0. For 23.0 and subsequent releases, we can probably remove torv2 from -addrinfo. before ``` "addresses_known": { "ipv4": 58305, "ipv6": 5138, "torv2": 0, "torv3": 5441, "i2p": 14, "total": 68898 } ``` after ``` "addresses_known": { "ipv4": 58305, "ipv6": 5138, "onion": 5441, "i2p": 14, "total": 68898 } ``` Per the naming of `netbase.{h, cpp}::GetNetworkName()`, torv3 becomes onion, which is what is printed in the output of getpeerinfo, getnetworkinfo and getnodeaddresses. ACKs for top commit: practicalswift: cr ACK 49d503aefa74f11e5d93432987fa3775ed82c979 Zero-1729: tACK 49d503aefa74f11e5d93432987fa3775ed82c979 🧉 klementtan: Code review and tested ACK 49d503aefa74f11e5d93432987fa3775ed82c979 Tree-SHA512: bca52520d8b12c26f1c329d661b9e22c567954ed2af7d2a16d7669eae1a221eada20944f8b2f4e78e31a7190d5f3d3fbfd37509e5edf2d9a3747a0a8f4e375bb
2021-09-09util: remove libevent <= 2.0.18 back-compat codefanquake
Now that we require libevent >=2.0.21, remove backwards compatibility code for older versions.
2021-09-05netinfo: clarify client and server versions in headerJon Atack
2021-09-02Merge bitcoin/bitcoin#22501: netinfo: display addr_{processed, rate_limited, ↵W. J. van der Laan
relay_enabled} and relaytxes data 218862a01848f69d54380c780bb5eae6dfdb1416 Display peers in -netinfo that we don't relay addresses to (Jon Atack) 3834e23b251ed7b4a47bbb981faba65b97ecbba0 Display peers in -netinfo that request we not relay transactions (Jon Atack) 0a9ee3a2c787e97213a0456b0d6253c549b71e09 Simplify a few conditionals in -netinfo (Jon Atack) 5eeea8e2575a36587e70743af3bd7c2d87b8cf36 Add addr_processed and addr_rate_limited stats to -netinfo (Jon Atack) Pull request description: Update CLI -netinfo to display the getpeerinfo `addr_processed`, `addr_rate_limited`, `addr_relay_enabled` and `relaytxes` data with auto-adjusting column widths. ``` $ ./src/bitcoin-cli -netinfo help txn Time since last novel transaction received from the peer and accepted into our mempool, in minutes "*" - the peer requested we not relay transactions to it (relaytxes is false) addrp Total number of addresses processed, excluding those dropped due to rate limiting "." - we do not relay addresses to this peer (addr_relay_enabled is false) addrl Total number of addresses dropped due to rate limiting ``` ![Screenshot from 2021-08-22 14-31-40](https://user-images.githubusercontent.com/2415484/130355514-f6fd4f21-79d6-463b-9791-de01ebef20b1.png) ACKs for top commit: 0xB10C: Code review and tested ACK 218862a01848f69d54380c780bb5eae6dfdb1416 Zero-1729: re-tACK 218862a01848f69d54380c780bb5eae6dfdb1416 vasild: ACK 218862a01848f69d54380c780bb5eae6dfdb1416 jarolrod: tACK 218862a01848f69d54380c780bb5eae6dfdb1416 Tree-SHA512: bb9da4bdd71859b234f6e4c2c46257a57ef0d0e0b363d2b8fded128bcaa28132f64a0a4651c622e1de1e3b7c05c7587a4369e9e79799895884fda9745c63409d
2021-08-24Fix typo in bitcoin-cli.cppKiminuo
2021-08-13Display peers in -netinfo that we don't relay addresses toJon Atack
i.e. peers where getpeerinfo#addr_relay_enabled is false
2021-08-13Display peers in -netinfo that request we not relay transactionsJon Atack
i.e. peers where getpeerinfo#relaytxes is false
2021-08-10Simplify a few conditionals in -netinfoJon Atack
2021-08-10Add addr_processed and addr_rate_limited stats to -netinfoJon Atack
2021-08-03cli: Add progress bar for -getinfoklementtan
Co-authored-by: jonatack <jon@atack.com>
2021-07-25cli -addrinfo: drop torv2, torv3 becomes onion per GetNetworkName()Jon Atack
2021-07-21cli: Implement human readable -getinfo.Klement Tan
2021-06-23cli: Avoid truncating -rpcwaittimeoutMarcoFalke
2021-06-03rpc: Prefix rpcwaittimeout error with details on its natureChristian Decker
As proposed by @laanwj the error message is now prefixed with the "timeout on transient error:" prefix, to explain why the error is suddenly considered terminal.
2021-06-03rpc: Add a `-rpcwaittimeout` parameter to limit time spent waitingChristian Decker
Adds a new numeric `-rpcwaittimeout` that can be used to limit the time we spend waiting on the RPC server to appear. This is used by downstream projects to provide a bit of slack when `bitcoind`s RPC interface is not available right away.
2021-05-31scripted-diff: rename GetSystemTimeInSeconds to GetTimeSecondsfanquake
-BEGIN VERIFY SCRIPT- sed -i -e 's/GetSystemTimeInSeconds/GetTimeSeconds/g' $(git grep -l GetSystemTimeInSeconds src) -END VERIFY SCRIPT-
2021-04-20cli: use C++17 std::array class template argument deduction (CTAD)Jon Atack
Credit to João Barbosa (promag) for the suggestions. Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
2021-04-12addrinfo: raise helpfully on server error or incompatible server versionJon Atack
2021-04-09cli: add -addrinfo commandJon Atack
2021-04-09cli: create AddrinfoRequestHandler classJon Atack
2021-03-19Merge #18335: bitcoin-cli: print useful error if bitcoind rpc work queue ↵MarcoFalke
exceeded 8dd5946c0b7aa8f3976b14a5de4ce84b80a9c32a add functional test (Larry Ruane) b5a80fa7e487c37b7ac0e3874a2fabade41b9ca8 util: Handle HTTP_SERVICE_UNAVAILABLE in bitcoin-cli (Hennadii Stepanov) Pull request description: If `bitcoind` is processing 16 RPC requests, attempting to submit another request using `bitcoin-cli` produces this less-than-helpful error message: `error: couldn't parse reply from server`. This PR changes the error to: `error: server response: Work queue depth exceeded`. ACKs for top commit: fjahr: tACK 8dd5946c0b7aa8f3976b14a5de4ce84b80a9c32a luke-jr: utACK 8dd5946c0b7aa8f3976b14a5de4ce84b80a9c32a (no changes since previous utACK) hebasto: re-ACK 8dd5946c0b7aa8f3976b14a5de4ce84b80a9c32a, only suggested changes since my [previous](https://github.com/bitcoin/bitcoin/pull/18335#pullrequestreview-460621350) review. darosior: ACK 8dd5946c0b7aa8f3976b14a5de4ce84b80a9c32a Tree-SHA512: 33e25f6ff05d9b56fae2bdb68b132557bb8e995f5438ac4fbbc53c304c5152a98aa43c43600c31d8a6a2830cbd48bf8ec7d89dce50190b29ec00a43830126913
2021-03-19Merge #21328: net, refactor: pass uint16 CService::port as uint16MarcoFalke
52dd40a9febec1f4e70d777821b6764830bdec61 test: add missing netaddress include headers (Jon Atack) 6f09c0f6b57ac01a473c587a3e51e9d477866bb0 util: add missing braces and apply clang format to SplitHostPort() (Jon Atack) 2875a764f7d8b1503c7bdb2f262964f7a0cb5fc3 util: add ParseUInt16(), use it in SplitHostPort() (Jon Atack) 6423c8175fad3163c10ffdb49e0df48e4e4931f1 p2p, refactor: pass and use uint16_t CService::port as uint16_t (Jon Atack) Pull request description: As noticed during review today in https://github.com/bitcoin/bitcoin/pull/20685#discussion_r584873708 of the upcoming I2P network support, `CService::port` is `uint16_t` but is passed around the codebase and into the ctors as `int`, which causes uneeded conversions and casts. We can avoid these (including in the incoming I2P code without further changes to it) by using ports with the correct type. The remaining conversions are pushed out to the user input boundaries where they can be range-checked and raise with user feedback in the next patch. ACKs for top commit: practicalswift: cr ACK 52dd40a9febec1f4e70d777821b6764830bdec61: patch looks correct MarcoFalke: cr ACK 52dd40a9febec1f4e70d777821b6764830bdec61 vasild: ACK 52dd40a9febec1f4e70d777821b6764830bdec61 Tree-SHA512: 203c1cab3189a206c55ecada77b9548b810281cdc533252b8e3330ae0606b467731c75f730ce9deb07cbaab66facf97e1ffd2051084ff9077cba6750366b0432
2021-03-16p2p, refactor: pass and use uint16_t CService::port as uint16_tJon Atack
2021-03-17refactor: post Optional<> removal cleanupsfanquake
2021-03-15scripted-diff: remove Optional & nulloptfanquake
-BEGIN VERIFY SCRIPT- git rm src/optional.h sed -i -e 's/Optional</std::optional</g' $(git grep -l 'Optional<' src) sed -i -e 's/{nullopt}/{std::nullopt}/g' $(git grep -l 'nullopt' src) sed -i -e 's/ nullopt;/ std::nullopt;/g' $(git grep -l 'nullopt' src) sed -i -e 's/ nullopt)/ std::nullopt)/g' $(git grep -l 'nullopt' src) sed -i -e 's/(nullopt)/(std::nullopt)/g' $(git grep -l 'nullopt' src) sed -i -e 's/ nullopt,/ std::nullopt,/g' $(git grep -l 'nullopt' src) sed -i -e 's/? nullopt :/? std::nullopt :/g' $(git grep -l 'nullopt' src) sed -i -e 's/: nullopt}/: std::nullopt}/g' $(git grep -l 'nullopt' src) sed -i -e '/optional.h \\/d' src/Makefile.am sed -i -e '/#include <optional.h>/d' src/test/fuzz/autofile.cpp src/test/fuzz/buffered_file.cpp src/test/fuzz/node_eviction.cpp sed -i -e 's/#include <optional.h>/#include <optional>/g' $(git grep -l '#include <optional.h>' src) -END VERIFY SCRIPT-
2021-02-17cli: update -netinfo help doc following the merge of 882ce251Jon Atack
2021-02-17cli: small -netinfo simplification and performance improvementJon Atack
that removes code and particularly this code from the loop of all peers: `m_is_i2p_on |= (network_id == NET_I2P);`
2021-02-17cli: improve -netinfo invalid argument error messageJon Atack
2021-02-17cli: warn in help that -netinfo is not intended to be a stable APIJon Atack
2021-02-17cli: enable -netinfo help to run without a remote serverJon Atack
2021-02-15cli: Treat high detail levels as the maximum in -netinfoWladimir J. van der Laan
I somehow often type `-netinfo 5` which gets treated as `-netinfo 0`, after this change it's `-netinfo 4` which seems more convenient behavior.
2021-02-03netinfo: display only outbound block relay countsJon Atack
2021-02-03netinfo: add i2p networkJon Atack
the i2p peer counts column is displayed iff the node is connected to at least one i2p peer, so this doesn't add clutter for users who are not running an i2p service
2021-02-03netinfo: add bip152 high-bandwidth to/from fieldsJon Atack
2021-02-03netinfo: display manual peers countJon Atack
2021-02-03netinfo: update to use peer connection typesJon Atack
2021-02-02netinfo: add ConnectionTypeForNetinfo member helper functionJon Atack
2021-01-29refactor: remove boost::thread_group usagefanquake
2021-01-29Merge #21029: bitcoin-cli: Correct docs (no "generatenewaddress" exists)fanquake
71430aec4304f71f8a11e6f0fea486e41fe3a9e3 bitcoin-cli: Correct docs (no "generatenewaddress" exists) (Luke Dashjr) Pull request description: ACKs for top commit: jonatack: ACK 71430aec4304f71f8a11e6f0fea486e41fe3a9e3 Tree-SHA512: 45ee7a51080598141fac4446563bdf99a59bfaa0ee00d9e092511087a968e8535d9208683ed589be1c975531be6d0319d33720f1f0dc1c3635c7d5ea6d726a41
2021-01-29bitcoin-cli: Correct docs (no "generatenewaddress" exists)Luke Dashjr
2021-01-05netinfo: add user help documentationJon Atack
and drop no longer needed sort description header to save screen space
2020-10-25cli -netinfo: print oversized/extreme ping times as "-"Jon Atack