Bitcoin Core RPC cURL - importdescriptors failing on loaded wallet
Bitcoin Core RPC cURL - importdescriptors failing on loaded wallet
Loading saved threads...
Joe · External communityPost link
External question — Bitcoin Stack Exchange
Author: Joe
Original post: https://bitcoin.stackexchange.com/questions/118993
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I am running the following request to load a wallet.
curl --location 'user:[email removed]:8332/wallet/test_multisig"' \
--header 'Content-Type: text/plain' \
--data '{
"jsonrpc": "2.0",
"method":"loadwallet",
"params": ["test_multisig"],
"id": "test_multisig_wallet_load"
}'
It returns...
{"result":null,"error":{"code":-35,"message":"Wallet \"test_multisig\" is already loaded."},"id":"test_multisig_wallet_load"}
However I then run this exact request, and receive an error as if the wallet is not loaded.
curl --location 'user:[email removed]:8332/wallet/test_multisig"' \
--header 'Content-Type: text/plain' \
--data '{
"jsonrpc": "2.0",
"method":"importdescriptors",
"params":{
"requests":[{
"desc":"pkh(cSQPHDBwXGjVzWRqAHm6zfvQhaTuj1f2bFH58h55ghbjtFwvmeXR)",
"active": false,
"range": 20,
"next_index": 0,
"timestamp": "now",
"internal": false,
"label": "test_multisig_wallet"
}]
}
}'
Error...
{"result":null,"error":{"code":-18,"message":"Requested wallet does not exist or is not loaded"},"id":null}
How can I import descriptors into a wallet so the wallet has a sequence of addresses?
Quote
Report
vincenzopalazzo · External communityPost link
External answer — Bitcoin Stack Exchange
Author: vincenzopalazzo
Original post: https://bitcoin.stackexchange.com/a/119277
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I feel your pain, I do think that these APIs need some more love at the level of usability. I am planning to spend some time on it because I had some problems too.
But before calling it a bug, we need to try to check if the workflow is the correct one.
Step 1: Create a wallet;
Step 1.1: Check if the wallet exists, if yes load it (in the URL you do not need to specify the
/wallet/<name_wallet>
)
Step 2: import your descriptors (you should work)
From the error that you gave, and from my experience I think
your wallet is not loaded, maybe because you are using the wrong URL (and here the question is why core is not failing?)
Keep us posted!
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External answer — Bitcoin Stack Exchange Author: vincenzopalazzo Source score (net votes, not local likes): 0 Original post: https://bitcoin.stackexchange.com/a/119277 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I feel your pain, I do think that these APIs need some more love at the level of usability. I am planning to spend some time on it because I had some problems too. But before calling it a bug, we need to try to check if the workflow is the correct one. Step 1: Create a wallet; Step 1.1: Check if the wallet exists, if yes load it (in the URL you do not need to specify the /wallet/<name_wallet> ) Step 2: import your descriptors (you should work) From the error that you gave, and from my experience I think your wallet is not loaded, maybe because you are using the wrong URL (and here the question is why core is not failing?) Keep us posted!
Checking account access…