Wallet management now that accounts are deprecated?

1

I'm building a website which will allow every user to make deposits and transact with Bitcoin, how will I be able to get the balance of a specific wallet. I currently know these commands:

$bitcoin->createwallet("wallet_name");

But to get the wallet info of that specific wallet is confusing for me, according to the documentation the getwalletinfo RPC takes no parameters. So my question is how do you get wallet information of a specific wallet?

frogman578

Posted 2019-07-27T11:38:52.297

Reputation: 23

Answers

2

If you are using more than one wallet, the wallet is selected by sending the RPC requests to <host:port>/wallet/<wallet_name>.

Raghav Sood

Posted 2019-07-27T11:38:52.297

Reputation: 10 897

how would that look in PHP?frogman578 2019-07-27T12:00:34.370

1I don't do PHP, but it should just be a matter of update the URL you are sending the request to so that it includes the wallet path.Raghav Sood 2019-07-27T13:14:16.727

I tried to run this in command line: bitcoin-cli getwalletinfo "home/username/bitcoin/wallets/testwallet" which returns an error codefrogman578 2019-07-28T21:20:15.630

Just for clarification, my OS is linuxfrogman578 2019-07-28T21:20:31.733

If you are using bitcoin-cli, you need to set the -rpcwallet=&lt;wallet_name&gt; parameter - the url based selection is for applications using the RPC interface directlyRaghav Sood 2019-07-28T21:28:33.870

so if i were to use it via my application i'd still have to have that in the bitcoin.conf?frogman578 2019-07-28T21:36:26.450

The bitcoin folder and their wallets aren't located within the server directoryfrogman578 2019-07-28T21:37:29.957

again how do I do it in the url when my bitcoin sevrer isn't located within my web server?frogman578 2019-07-29T18:53:55.253