mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
Merge bitcoin/bitcoin#30302: doc: clarify loadwallet path loading for wallets
ca6aa0b9be
doc: loadwallet loads from relative walletdir (am-sq) Pull request description: ## Why this change? https://github.com/bitcoin/bitcoin/issues/30269 describes a need for documentation improvement with the `loadwallet` RPC. Namely, [some users have found](https://bitcoin.stackexchange.com/questions/123331/how-do-you-load-a-regtest-wallet) the usage description confusing when it comes to loading wallets that are not in the normal case of being in the default wallet directory. The default wallet directory, depending on the machine OS, has the base directory defined here:9c5cdf07f3/src/common/args.cpp (L699)
which is then appended with `/wallets`. So for example, for MacOS, it would be `~/Library/Application Support/Bitcoin/wallets`. ## The changes implemented 1. Change the help text to indicate that the filename (or directory) passed in to `loadwallet` is relative to the base wallet directory 2. Adds additional examples to the help page showing how to fetch a wallet within a subdirectory of the base data directory for wallets, or from an absolute path ACKs for top commit: achow101: ACKca6aa0b9be
maflcko: lgtm ACKca6aa0b9be
rkrux: ACKca6aa0b9be
jonatack: ACKca6aa0b9be
Tree-SHA512: 123ae118c79ee1843ed65861e7a008658a53e47d4d14f2b7612561bba1b1dbdb6744f9aaac1587aac231c62d0c1804de848a6d732f1382788b437d9fe6474012
This commit is contained in:
commit
77bf99012a
1 changed files with 10 additions and 3 deletions
|
@ -220,7 +220,7 @@ static RPCHelpMan loadwallet()
|
|||
"\nNote that all wallet command-line options used when starting bitcoind will be"
|
||||
"\napplied to the new wallet.\n",
|
||||
{
|
||||
{"filename", RPCArg::Type::STR, RPCArg::Optional::NO, "The wallet directory or .dat file."},
|
||||
{"filename", RPCArg::Type::STR, RPCArg::Optional::NO, "The path to the directory of the wallet to be loaded, either absolute or relative to the \"wallets\" directory. The \"wallets\" directory is set by the -walletdir option and defaults to the \"wallets\" folder within the data directory."},
|
||||
{"load_on_startup", RPCArg::Type::BOOL, RPCArg::Optional::OMITTED, "Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged."},
|
||||
},
|
||||
RPCResult{
|
||||
|
@ -234,8 +234,15 @@ static RPCHelpMan loadwallet()
|
|||
}
|
||||
},
|
||||
RPCExamples{
|
||||
HelpExampleCli("loadwallet", "\"test.dat\"")
|
||||
+ HelpExampleRpc("loadwallet", "\"test.dat\"")
|
||||
"\nLoad wallet from the wallet dir:\n"
|
||||
+ HelpExampleCli("loadwallet", "\"walletname\"")
|
||||
+ HelpExampleRpc("loadwallet", "\"walletname\"")
|
||||
+ "\nLoad wallet using absolute path (Unix):\n"
|
||||
+ HelpExampleCli("loadwallet", "\"/path/to/walletname/\"")
|
||||
+ HelpExampleRpc("loadwallet", "\"/path/to/walletname/\"")
|
||||
+ "\nLoad wallet using absolute path (Windows):\n"
|
||||
+ HelpExampleCli("loadwallet", "\"DriveLetter:\\path\\to\\walletname\\\"")
|
||||
+ HelpExampleRpc("loadwallet", "\"DriveLetter:\\path\\to\\walletname\\\"")
|
||||
},
|
||||
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue