I'm trying to figure out how to query specific wallets.
snippet of my config datadir=/data wallet=/data/wallets/test1/ wallet=/data/wallets/test2/
view of the wallets
user@container:/data# ls /data/wallets/test1/
database db.log wallet.dat
user@container:/data# ls /data/wallets/test2/
database db.log wallet.dat
user@container:/data# bitcoin-cli -conf=bitcoin.conf listwallets
[
"/data/wallets/test1/",
"/data/wallets/test2/"
]
no errors or issues via cli. the wallets are empty as expected as they were just created for testing
user@container:/data# bitcoin-cli -conf=bitcoin.conf -rpcwallet=/data/wallets/test1/ listunspent
[
]
when I try an rpc curl request on it, I get the following error message
curl -X POST --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listunspent", "params": [6, 9999999, [] , true, { "minimumAmount": 0.005 } ] }' -H 'Content-Type: application/json' 'https:/mynodeaddress.com/wallet/data/wallets/test2
{"result":null,"error":{"code":-18,"message":"Requested wallet does not exist or is not loaded"},"id":"curltest"}
Note this works if I place the wallet in /data/test1. the curl request will be successful if my config was wallet=test1 user@container:/data# ls /data/test1/ database db.log wallet.dat
curl -X POST --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listunspent", "params": [6, 9999999, [] , true, { "minimumAmount": 0.005 } ] }' -H 'Content-Type: application/json' 'https:/mynodeaddress.com/wallet/test2
it will return success fully return albeit an empty response similar to bitcoin-cli
My question is, is it possible to have the wallet file in any directory within my datadir and still be able run rpc query against it using curl.