1

I need to perform rpc requests per wallet. Here is my url

http://127.0.0.1:18332/wallet/another_wallet/wallet.dat

but I get error Requested wallet does not exist or is not loaded

I run daemon with this command

bitcoind -daemon -rpcuser=myrpc01 -rpcpassword=password01 -testnet -datadir=/media/ax/6f6ceb40-fbbc-4959-b2b2-dbb1ae9ce24a/bitcoin/testnet3

So what the wallet path I should set for correct load?

1
  • The loadwallet is (perhaps surprisingly) not a wallet RPC. It can be sent to the normal non-wallet-specific URL. Once loaded, the wallet-specific URL can be used to interact with it. Does that help you? – Pieter Wuille Apr 28 at 15:08
2

If you are trying to load a wallet, then you do not need to be using a wallet specific endpoint. loadwallet is not actually a wallet RPC so it does not need the wallet specific endpoint.

If you are trying to access a wallet that has already been loaded, then you have the wrong endpoint. The endpoint does not include the wallet.dat file. Bitcoin Core gives wallets names based on the directory that contains the wallet.dat file, and when it creates wallets, it puts them in directories of the name that was provided. The wallet RPC endpoints work similarly - they use just the wallet name. So the URL to access a particular wallet should actually be

http://127.0.0.1/18332/wallet/another_wallet

Note that this URL does not have a trailing slash (/). If you have a trailing slash, then Bitcoin Core will incorrectly determine the wallet name to be another_wallet/ where it is actually another_wallet.

13
  • I loaded this wallet /media/alex/6f6ceb40-fbbc-4959-b2b2-dbb1ae9ce24a/bitcoin/testnet3/wallets/default_another_wallet/, then I try this url http://127.0.0.1/18332/wallet/default_another_wallet but says Requested wallet does not exist or is not loaded – Oleksandr IY Apr 30 at 16:49
  • You can use the listwallets command to see the wallets that are currently loaded. That will tell you what Bitcoin Core thinks the wallet name is. – Andrew Chow Apr 30 at 17:00
  • here is [1] => /media/alex/6f6ceb40-fbbc-4959-b2b2-dbb1ae9ce24a/bitcoin/testnet3/wallets/default_another_wallet/ – Oleksandr IY Apr 30 at 17:03
  • I tried different path combination, bitcoin/testnet3/wallets/default_another_wallet, testnet3/wallets/default_another_wallet .... and so on, every time can't find – Oleksandr IY Apr 30 at 17:05
  • When you load the wallet, instead of providing the full path to the wallet, just give the name default_another_wallet. The wallet is in the default walletdir for the datadir you have specified. There is no need to give the full path. Otherwise, Bitcoin Core is considering the wallet name to be the full path, i.e. /media/alex/6f6ceb40-fbbc-4959-b2b2-dbb1ae9ce24a/bitcoin/testnet3/wallets/default_another_wallet/. – Andrew Chow Apr 30 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.