5 #if defined(HAVE_CONFIG_H)
6 #include <config/bitcoin-config.h>
26 argsman.
AddArg(
"-datadir=<dir>",
"Specify data directory",
28 argsman.
AddArg(
"-wallet=<wallet-name>",
"Specify wallet name",
31 argsman.
AddArg(
"-debug=<category>",
32 "Output debugging information (default: 0).",
36 "Send trace/debug info to console (default: 1 when no -debug "
37 "is true, 0 otherwise).",
45 "Attempt to recover private keys from a corrupt wallet",
51 std::string error_message;
53 tfm::format(std::cerr,
"Error parsing command line arguments: %s\n",
59 strprintf(
"%s bitcoin-wallet version", PACKAGE_NAME) +
" " +
61 "bitcoin-wallet is an offline tool for creating and interacting "
62 "with " PACKAGE_NAME
" wallet files.\n" +
63 "By default bitcoin-wallet will act on wallets in the default "
64 "mainnet wallet directory in the datadir.\n" +
65 "To change the target wallet, use the -datadir, -wallet and "
66 "-testnet/-regtest arguments.\n\n" +
67 "Usage:\n" +
" bitcoin-wallet [options] <command>\n\n" +
80 "Error: Specified data directory \"%s\" does not exist.\n",
91 int main(
int argc,
char *argv[]) {
93 util::WinCmdLineArgs winArgs;
94 std::tie(argc, argv) = winArgs.get();
102 }
catch (
const std::exception &e) {
110 std::string method{};
111 for (
int i = 1; i < argc; ++i) {
113 if (!method.empty()) {
115 "Error: two methods provided (%s and %s). Only one "
116 "method should be provided.\n",
124 if (method.empty()) {
126 "No method provided. Run `bitcoin-wallet -help` for "
135 "Wallet name must be provided when creating a new wallet.\n");
int main(int argc, char *argv[])
const std::function< std::string(const char *)> G_TRANSLATION_FUN
Translate string to current locale using Qt.
static bool WalletAppInit(int argc, char *argv[])
static void SetupWalletToolArgs(ArgsManager &argsman)
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
void SetupChainParamsBaseOptions(ArgsManager &argsman)
Set the arguments for chainparams.
bool ParseParameters(int argc, const char *const argv[], std::string &error)
std::string GetHelpMessage() const
Get the help string.
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
void AddArg(const std::string &name, const std::string &help, unsigned int flags, const OptionsCategory &cat)
Add argument.
std::string GetChainName() const
Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.
Users of this module must hold an ECCVerifyHandle.
std::string FormatFullVersion()
static std::unique_ptr< ECCVerifyHandle > globalVerifyHandle
void SetupCurrencyUnitOptions(ArgsManager &argsman)
void ECC_Start()
Initialize the elliptic curve support.
void ECC_Stop()
Deinitialize the elliptic curve support.
BCLog::Logger & LogInstance()
void RandomInit()
Initialize global RNG state and log any CPU features that are used.
bool HelpRequested(const ArgsManager &args)
void SetupHelpOptions(ArgsManager &args)
Add help options to the args manager.
bool CheckDataDirOption()
void PrintExceptionContinue(const std::exception *pex, const char *pszThread)
bool IsSwitchChar(char c)