MultiversX Tracker is Live!

How to reference different wallets with curl JSONRPC requests Bitcoin core

Bitcoin Stack Exchange

Bitcoin News / Bitcoin Stack Exchange 175 Views

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)


Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments