Bitcoin ABC 0.26.3
P2P Digital Currency
|
#include <chainparamsbase.h>
#include <clientversion.h>
#include <common/args.h>
#include <common/system.h>
#include <currencyunit.h>
#include <rpc/client.h>
#include <rpc/mining.h>
#include <rpc/protocol.h>
#include <rpc/request.h>
#include <support/events.h>
#include <tinyformat.h>
#include <util/exception.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <util/time.h>
#include <util/translation.h>
#include <event2/buffer.h>
#include <event2/keyvalq_struct.h>
#include <compat/stdin.h>
#include <univalue.h>
#include <algorithm>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <functional>
#include <memory>
#include <string>
#include <tuple>
Go to the source code of this file.
Classes | |
class | CConnectionFailed |
struct | HTTPReply |
Reply structure for request_done to fill in. More... | |
class | BaseRequestHandler |
Class that handles the conversion from a command-line to a JSON-RPC request, as well as converting back to a JSON object that can be shown as result. More... | |
class | GetinfoRequestHandler |
Process getinfo requests. More... | |
class | NetinfoRequestHandler |
Process netinfo requests. More... | |
struct | NetinfoRequestHandler::Peer |
class | GenerateToAddressRequestHandler |
Process RPC generatetoaddress request. More... | |
class | DefaultRequestHandler |
Process default single requests. More... | |
Macros | |
#define | EVENT_LOG_ERR _EVENT_LOG_ERR |
Typedefs | |
using | CliClock = std::chrono::system_clock |
Functions | |
static void | SetupCliArgs (ArgsManager &argsman) |
static void | libevent_log_cb (int severity, const char *msg) |
libevent event log callback | |
static int | AppInitRPC (int argc, char *argv[]) |
static std::string | http_errorstring (int code) |
static void | http_request_done (struct evhttp_request *req, void *ctx) |
static void | http_error_cb (enum evhttp_request_error err, void *ctx) |
static UniValue | CallRPC (BaseRequestHandler *rh, const std::string &strMethod, const std::vector< std::string > &args, const std::optional< std::string > &rpcwallet={}) |
static UniValue | ConnectAndCallRPC (BaseRequestHandler *rh, const std::string &strMethod, const std::vector< std::string > &args, const std::optional< std::string > &rpcwallet={}) |
ConnectAndCallRPC wraps CallRPC with -rpcwait and an exception handler. | |
static void | ParseResult (const UniValue &result, std::string &strPrint) |
Parse UniValue result to update the message to print to std::cout. | |
static void | ParseError (const UniValue &error, std::string &strPrint, int &nRet) |
Parse UniValue error to update the message to print to std::cerr and the code to return. | |
static void | GetWalletBalances (UniValue &result) |
GetWalletBalances calls listwallets; if more than one wallet is loaded, it then fetches mine.trusted balances for each loaded wallet and pushes them to result . | |
static UniValue | GetNewAddress () |
Call RPC getnewaddress. | |
static void | SetGenerateToAddressArgs (const std::string &address, std::vector< std::string > &args) |
Check bounds and set up args for RPC generatetoaddress params: nblocks, address, maxtries. | |
static int | CommandLineRPC (int argc, char *argv[]) |
int | main (int argc, char *argv[]) |
Variables | |
const std::function< std::string(const char *)> | G_TRANSLATION_FUN = nullptr |
Translate string to current locale using Qt. | |
static const char | DEFAULT_RPCCONNECT [] = "127.0.0.1" |
static const int | DEFAULT_HTTP_CLIENT_TIMEOUT = 900 |
static const bool | DEFAULT_NAMED = false |
static const int | CONTINUE_EXECUTION = -1 |
static const std::string | DEFAULT_NBLOCKS = "1" |
Default number of blocks to generate for RPC generatetoaddress. | |
#define EVENT_LOG_ERR _EVENT_LOG_ERR |
Definition at line 45 of file bitcoin-cli.cpp.
Definition at line 198 of file bitcoin-cli.cpp.
|
static |
Definition at line 712 of file bitcoin-cli.cpp.
Definition at line 1000 of file bitcoin-cli.cpp.
|
static |
ConnectAndCallRPC wraps CallRPC with -rpcwait and an exception handler.
[in] | rh | Pointer to RequestHandler. |
[in] | strMethod | Reference to const string method to forward to CallRPC. |
[in] | rpcwallet | Reference to const optional string wallet name to forward to CallRPC. |
a | CConnectionFailed std::runtime_error if connection failed or RPC server still in warmup. |
Definition at line 870 of file bitcoin-cli.cpp.
Call RPC getnewaddress.
Definition at line 968 of file bitcoin-cli.cpp.
GetWalletBalances calls listwallets; if more than one wallet is loaded, it then fetches mine.trusted balances for each loaded wallet and pushes them to result
.
result | Reference to UniValue object the wallet names and balances are pushed to. |
Definition at line 940 of file bitcoin-cli.cpp.
|
static |
|
static |
If req is nullptr, it means an error occurred while connecting: the error code will have been passed to http_error_cb.
Definition at line 286 of file bitcoin-cli.cpp.
libevent event log callback
Definition at line 168 of file bitcoin-cli.cpp.
Parse UniValue error to update the message to print to std::cerr and the code to return.
Definition at line 910 of file bitcoin-cli.cpp.
Parse UniValue result to update the message to print to std::cout.
Definition at line 899 of file bitcoin-cli.cpp.
|
static |
Check bounds and set up args for RPC generatetoaddress params: nblocks, address, maxtries.
[in] | address | Reference to const string address to insert into the args. |
args | Reference to vector of string args to modify. |
Definition at line 984 of file bitcoin-cli.cpp.
|
static |
Definition at line 56 of file bitcoin-cli.cpp.
|
static |
Definition at line 52 of file bitcoin-cli.cpp.
|
static |
Definition at line 50 of file bitcoin-cli.cpp.
Definition at line 51 of file bitcoin-cli.cpp.
|
static |
Default number of blocks to generate for RPC generatetoaddress.
Definition at line 54 of file bitcoin-cli.cpp.
|
static |
Definition at line 49 of file bitcoin-cli.cpp.
const std::function<std::string(const char *)> G_TRANSLATION_FUN = nullptr |
Translate string to current locale using Qt.
Translate a message to the native language of the user.
Definition at line 47 of file bitcoin-cli.cpp.