bitcoinlib icon indicating copy to clipboard operation
bitcoinlib copied to clipboard

Various 'Wallet' RPC Calls Require URL with '/wallet/<wallet-name>' appended

Open apleroy opened this issue 3 years ago • 1 comments

I'm new to Bitcoin/Blockchain so please forgive me if I'm missing something obvious here...

And thank you so much for your fantastic C#/.NET library and samples.

I am going through the sample program in the DemoClient and am having trouble with many of the RPC commands that are categorized as Wallet RPC methods.

For example, calling CoinService.GetBalance(); throws an error like outlined here: https://stackoverflow.com/questions/64324893/wallet-file-not-specified-must-request-wallet-rpc-through-wallet-filename-ur

I can replicate this using Postman locally getting the same error message: "Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path)."

To work around and fix this, I made some local changes to update the RpcConnector > MakeRequest() method to add the appended url. So the final call looks something like this (I'm using RegTest and Bitcoin Core v22.0):

POST MyRpcUserName:MyRpcPw@localhost:18332/wallet/RegTestWallet2
Body: {"jsonrpc":"1.0","id":"rpc","method":"getbalance", "params":[]}

This same pattern applies for Wallet methods such as: getbalance gettransaction listreceivedbyaddress

I'm hoping to confirm that this is a known issue or perhaps a change in Bitcoin Core that requires updates on the client library? Happy to help add a PR for some extension methods if this is helpful. Thanks again

apleroy avatar Feb 09 '22 05:02 apleroy

Seems like this lib is dead? Not worth using it ?

leandrobattochio avatar Jul 29 '23 03:07 leandrobattochio