aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
| * Bugfix: Include <memory> for std::unique_ptrLuke Dashjr2018-04-021-0/+1
| |
* | [moveonly] Extract HelpRequested to dry up the help options testingBen Woosley2018-04-021-1/+1
| | | | | | | | This ensures consistency across interfaces and makes the version handling more clear.
* | bitcoin-cli: Provide a better error message when bitcoind is not runningpracticalswift2018-03-091-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ```
* | Create new wallet databases as directories rather than filesRussell Yanofsky2018-03-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Allow wallet files not in -walletdir directoryRussell Yanofsky2018-03-031-1/+1
| | | | | | | | | | Remove restriction that -wallet filenames can only refer to files in the -walletdir directory.
* | Merge #12050: [trivial] Implements a virtual destructor on the ↵Wladimir J. van der Laan2018-02-061-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Implements a virtual destructor on the BaseRequestHandler class.2512017-12-291-0/+1
| | | | | | | | | | | | | | | | | | Implements a virtual destructor on the BaseRequestHandler class to protect against undefined behavior in the event that a derived BaseRequestHandler class has a destructor and an object of such derived class is destroyed through a pointer to its base class.
* | | Clarify help messages for path args to mention datadir prefixJames O'Beirne2018-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Properly alphabetize output of CLI --help option.murrayn2018-02-011-5/+5
| |/ |/|
* | Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
|/
* cli: Reject arguments to -getinfoWladimir J. van der Laan2017-11-171-0/+3
| | | | | | | | | | | | Currently it's possible to accidentally type e.g. bitcoin-cli -getinfo getbalance and get an answer which can be confusing; the trialing arguments are just ignored. To avoid this, throw an error if the user provides arguments to `-getinfo`.
* scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
* rpc: Handle `getinfo` locally in bitcoin-cli w/ `-getinfo`Wladimir J. van der Laan2017-09-271-14/+105
| | | | | | | | | | | | | | | | | | | This adds the infrastructure `BaseRequestHandler` class that takes care of converting bitcoin-cli arguments into a JSON-RPC request object, and converting the reply into a JSON object that can be shown as result. This is subsequently used to handle the `-getinfo` option, which sends a JSON-RPC batch request to the RPC server with `["getnetworkinfo", "getblockchaininfo", "getwalletinfo"]`, and after reply combines the result into what looks like a `getinfo` result. There have been some requests for a client-side `getinfo` and this is my PoC of how to do it. If this is considered a good idea some of the logic could be moved up to rpcclient.cpp and used in the GUI console as well. Extra-Author: Andrew Chow <[email protected]>
* Fix style in -stdin and -stdinrpcpass handlingJoão Barbosa2017-09-071-3/+6
|
* Add option -stdinrpcpass to allow RPC password to be read from standard inputJoe Harvell2017-08-231-3/+10
|
* scripted-diff: stop using the gArgs wrappersMarko Bencun2017-08-141-16/+16
| | | | | | | | They were temporary additions to ease the transition. -BEGIN VERIFY SCRIPT- find src/ -name "*.cpp" ! -wholename "src/util.h" ! -wholename "src/util.cpp" | xargs perl -i -pe 's/(?<!\.)(ParseParameters|ReadConfigFile|IsArgSet|(Soft|Force)?(Get|Set)(|Bool|)Arg(s)?)\(/gArgs.\1(/g' -END VERIFY SCRIPT-
* scripted-diff: Use the C++11 keyword nullptr to denote the pointer literal ↵practicalswift2017-08-071-6/+6
| | | | | | | | | | | | | instead of the macro NULL -BEGIN VERIFY SCRIPT- sed -i 's/\<NULL\>/nullptr/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h src/qt/*/*.cpp src/qt/*/*.h src/wallet/*/*.cpp src/wallet/*/*.h src/support/allocators/*.h sed -i 's/Prefer nullptr, otherwise SAFECOOKIE./Prefer NULL, otherwise SAFECOOKIE./g' src/torcontrol.cpp sed -i 's/tor: Using nullptr authentication/tor: Using NULL authentication/g' src/torcontrol.cpp sed -i 's/METHODS=nullptr/METHODS=NULL/g' src/test/torcontrol_tests.cpp src/torcontrol.cpp sed -i 's/nullptr certificates/NULL certificates/g' src/qt/paymentserver.cpp sed -i 's/"nullptr"/"NULL"/g' src/torcontrol.cpp src/test/torcontrol_tests.cpp -END VERIFY SCRIPT-
* Fix misleading "Method not found" multiwallet errorsRussell Yanofsky2017-07-261-0/+4
| | | | | | | | Raise RPC_WALLET_NOT_SPECIFIED instead of RPC_METHOD_NOT_FOUND when a required wallet filename was not specified in an RPC call. Also raise more specific RPC_WALLET_NOT_FOUND error instead of RPC_INVALID_PARAMETER in case an invalid wallet was specified, for consistency.
* Rename -usewallet to -rpcwalletAlex Morcos2017-07-191-2/+2
|
* Add wallet endpoint support to bitcoin-cli (-usewallet)Jonas Schnelli2017-07-171-1/+15
|
* Remove duplicate includepracticalswift2017-07-161-1/+0
|
* [utils] allow square brackets for ipv6 addresses in bitcoin-cliJohn Newbery2017-07-131-2/+9
| | | | | -rpcconnect can now accept ipv6 addresses with and without square brackets.
* Chainparams: Use a regular factory for creating chainparamsJorge Timón2017-05-031-1/+3
|
* Replace uses of boost::filesystem with fsWladimir J. van der Laan2017-04-031-1/+1
| | | | | | | | | Step two in abstracting away boost::filesystem. To repeat this, simply run: ``` git ls-files \*.cpp \*.h | xargs sed -i 's/boost::filesystem/fs/g' ```
* Replace includes of boost/filesystem.h with fs.hWladimir J. van der Laan2017-04-031-1/+1
| | | | This is step one in abstracting the use of boost::filesystem.
* Docs: add details to -rpcclienttimeout docIan Kelling2017-03-021-1/+1
|
* rpc: Named argument support for bitcoin-cliWladimir J. van der Laan2017-01-101-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage e.g.: $ src/bitcoin-cli -testnet -named echo arg0="dfdf" [ "dfdf" ] Argument conversion also works, for arguments thus flagged in the table in `src/rpc/client.cpp`. $ src/bitcoin-cli -testnet -named echojson arg0="[1,2,3]" [ [ 1, 2, 3 ] ] Unknown parameter (detected server-side): $ src/bitcoin-cli -testnet -named getinfo arg0="dfdf" error code: -8 error message: Unknown named parameter arg0
* Merge #9387: [Refactor] RAII of libevent stuff using unique ptrs with deletersWladimir J. van der Laan2017-01-051-20/+12
|\ | | | | | | | | | | | | 05a55a6 Added EVENT_CFLAGS to test makefile to explicitly include libevent headers. (Karl-Johan Alm) 280a559 Added some simple tests for the RAII-style events. (Karl-Johan Alm) 7f7f102 Switched bitcoin-cli.cpp to use RAII unique pointers with deleters. (Karl-Johan Alm) e5534d2 Added std::unique_ptr<> wrappers with deleters for libevent modules. (Karl-Johan Alm)
| * Switched bitcoin-cli.cpp to use RAII unique pointers with deleters.Karl-Johan Alm2016-12-201-20/+12
| |
* | Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | | | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* | Un-expose mapArgs from utils.hMatt Corallo2016-12-241-3/+3
| |
* | Introduce (and use) an IsArgSet accessor methodMatt Corallo2016-12-231-2/+2
| |
* | Remove arguments to ParseConfigFileMatt Corallo2016-12-231-1/+1
|/
* bitcoin-cli: Make error message less confusingWladimir J. van der Laan2016-12-021-1/+1
| | | | | | | | | | | | | | | | | | Sorry for the churn on this, but the current message (introduced in #9073) isn't acceptable: $ src/bitcoin-cli getinfo rpc: couldn't connect to server (make sure server is running and you are connecting to the correct RPC port: -1 unknown) Putting the error code after the words "RPC port" made me wonder whether there was a port configuration issue. This changes it to: $ src/bitcoin-cli getinfo error: couldn't connect to server: unknown (code -1) (make sure server is running and you are connecting to the correct RPC port)
* Removed using namespace std from bitcoin-cli/-tx and added std:: in ↵Karl-Johan Alm2016-11-251-16/+14
| | | | appropriate places.
* Merge #9067: Fix exit codesWladimir J. van der Laan2016-11-081-9/+19
|\ | | | | | | | | 4441018 Every main()/exit() should return/use one of EXIT_ codes instead of magic numbers (UdjinM6) bd0de13 Fix exit codes: - `--help`, `--version` etc should exit with `0` i.e. no error ("not enough args" case should still trigger an error) - error reading config file should exit with `1` (UdjinM6)
| * Fix exit codes:UdjinM62016-11-041-9/+19
| | | | | | | | | | | | | | - `--help`, `--version` etc should exit with `0` i.e. no error ("not enough args" case should still trigger an error) - error reading config file should exit with `1` Slightly refactor AppInitRPC/AppInitRawTx to return standard exit codes (EXIT_FAILURE/EXIT_SUCCESS) or CONTINUE_EXECUTION (-1)
* | Add common failure cases for rpc server connection failureinstagibbs2016-11-031-1/+1
|/
* rpc: Change JSONRPCRequest to JSONRPCRequestObjWladimir J. van der Laan2016-10-191-1/+1
| | | | This is more consistent with `JSONRPCReplyObj`.
* Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgsJorge Timón2016-10-011-2/+2
|
* bitcoin-cli: More detailed error reportingWladimir J. van der Laan2016-09-211-3/+39
| | | | | Register a evhttp error handler to get a more detailed error message if the HTTP request fails.
* bitcoin-cli.cpp: Use symbolic constant for exit codePuru2016-05-021-1/+1
|
* rpc: Input-from-stdin mode for bitcoin-cliWladimir J. van der Laan2016-02-241-9/+12
| | | | | | | | | | | | Implements #7442 by adding an option `-stdin` which reads additional arguments from stdin, one per line. For example ```bash echo -e "mysecretcode\n120" | src/bitcoin-cli -stdin walletpassphrase echo -e "walletpassphrase\nmysecretcode\n120" | src/bitcoin-cli -stdin ```
* Merge branch 'master' into single_prodnameLuke Dashjr2016-02-031-7/+8
|\
| * move rpc* to rpc/Daniel Cousens2016-01-211-2/+2
| |
| * Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
| |
| * Constrain rpcport default values to a single location in codeLuke Dashjr2015-12-011-1/+1
| |
| * Constrain constant values to a single location in codeLuke Dashjr2015-11-281-3/+4
| |
* | Unify package name to as few places as possible without major changesLuke Dashjr2015-12-141-2/+6
|/
* constify missing catch casesPhilip Kaufmann2015-10-271-1/+1
| | | | - ensure all missing catch cases are constant where possible