MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / SetupCliArgs

Function SetupCliArgs

src/bitcoin-cli.cpp:37–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35static const int CONTINUE_EXECUTION=-1;
36
37static void SetupCliArgs()
38{
39 const auto defaultBaseParams = CreateBaseChainParams(CBaseChainParams::MAIN);
40 const auto testnetBaseParams = CreateBaseChainParams(CBaseChainParams::TESTNET);
41
42 gArgs.AddArg("-?", "This help message", false, OptionsCategory::OPTIONS);
43 gArgs.AddArg("-version", "Print version and exit", false, OptionsCategory::OPTIONS);
44 gArgs.AddArg("-conf=<file>", strprintf("Specify configuration file. Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), false, OptionsCategory::OPTIONS);
45 gArgs.AddArg("-datadir=<dir>", "Specify data directory", false, OptionsCategory::OPTIONS);
46 gArgs.AddArg("-getinfo", "Get general information from the remote server. Note that unlike server-side RPC calls, the results of -getinfo is the result of multiple non-atomic requests. Some entries in the result may represent results from different states (e.g. wallet balance may be as of a different block from the chain state reported)", false, OptionsCategory::OPTIONS);
47 SetupChainParamsBaseOptions();
48 gArgs.AddArg("-named", strprintf("Pass named instead of positional arguments (default: %s)", DEFAULT_NAMED), false, OptionsCategory::OPTIONS);
49 gArgs.AddArg("-rpcclienttimeout=<n>", strprintf("Timeout in seconds during HTTP requests, or 0 for no timeout. (default: %d)", DEFAULT_HTTP_CLIENT_TIMEOUT), false, OptionsCategory::OPTIONS);
50 gArgs.AddArg("-rpcconnect=<ip>", strprintf("Send commands to node running on <ip> (default: %s)", DEFAULT_RPCCONNECT), false, OptionsCategory::OPTIONS);
51 gArgs.AddArg("-rpccookiefile=<loc>", _("Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)"), false, OptionsCategory::OPTIONS);
52 gArgs.AddArg("-rpcpassword=<pw>", "Password for JSON-RPC connections", false, OptionsCategory::OPTIONS);
53 gArgs.AddArg("-rpcport=<port>", strprintf("Connect to JSON-RPC on <port> (default: %u or testnet: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort()), false, OptionsCategory::OPTIONS);
54 gArgs.AddArg("-rpcuser=<user>", "Username for JSON-RPC connections", false, OptionsCategory::OPTIONS);
55 gArgs.AddArg("-rpcwait", "Wait for RPC server to start", false, OptionsCategory::OPTIONS);
56 gArgs.AddArg("-rpcwallet=<walletname>", "Send RPC for non-default wallet on RPC server (needs to exactly match corresponding -wallet option passed to bgoldd)", false, OptionsCategory::OPTIONS);
57 gArgs.AddArg("-stdin", "Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases). When combined with -stdinrpcpass, the first line from standard input is used for the RPC password.", false, OptionsCategory::OPTIONS);
58 gArgs.AddArg("-stdinrpcpass", "Read RPC password from standard input as a single line. When combined with -stdin, the first line from standard input is used for the RPC password.", false, OptionsCategory::OPTIONS);
59 gArgs.AddArg("-convertaddrtobtg=<bitcoin_address>", "Convert a Bitcoin address to Bitcoin Gold address format.", false, OptionsCategory::OPTIONS);
60 gArgs.AddArg("-convertaddrtobtc=<bitcoin_gold_address>", "Convert a Bitcoin Gold address back to Bitcoin address format.", false, OptionsCategory::OPTIONS);
61
62 // Hidden
63 gArgs.AddArg("-h", "", false, OptionsCategory::HIDDEN);
64 gArgs.AddArg("-help", "", false, OptionsCategory::HIDDEN);
65}
66
67/** libevent event log callback */
68static void libevent_log_cb(int severity, const char *msg)

Callers 1

AppInitRPCFunction · 0.85

Calls 5

CreateBaseChainParamsFunction · 0.85
_Function · 0.85
AddArgMethod · 0.80
RPCPortMethod · 0.80

Tested by

no test coverage detected