forex.pm forex forum binary options trade - Binance - Сryptocurrency exchanges - How to reference different wallets with curl JSONRPC requests Bitcoin core
  • Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

How to reference different wallets with curl JSONRPC requests Bitcoin core

Started by Bitcoin, May 18, 2022, 06:18 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bitcoin

How to reference different wallets with curl JSONRPC requests Bitcoin core

I have a headless Bitcoin core 0.17.1 running on Debian 10, and have created a second wallet "johns-wallet".


I'd like to get the walletinfo (or any wallet request) of that specific wallet via curl, not the cli.


The Bitcoin core API reference doesn't offer an example of how to target different wallets when not using the CLI (and neither did my Google search).


I've tried:


curl --user johnsmith --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getwalletinfo", "params": [] }' -H 'content-type: text/plain;' bitcoind:18332/wallets/johns-wallet/

and also


curl --user johnsmith --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getwalletinfo", "params": ["/wallets/johns-wallet/"] }' -H 'content-type: text/plain;' bitcoind:18332

And also variations on the path itself to the wallet - none of them return a result, let alone an error.


Running without trying to specify a wallet returns:


{"result":null,"error":{"code":-19,"message":"Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path)."},"id":"curltest"}

(In case it matters, the Bitcoind is running in a docker container, with a named volume)


Source: How to reference different wallets with curl JSONRPC requests Bitcoin core