1
I can't seem to get a firm grasp of how to use the getwalletinfo RPC in the cmd line as well as in PHP code, The documentation says getwalletinfo doesn't take any parameters, but I've seen ways to send specific requests to the daemon this RPC. So, my question is, how do I use the getwalletinfo RPC in PHP to get information of a specific wallet?
so that would be
$bitcoin->getwalletinfo("http://127.0.0.1:8333/wallet/testwallet");? – frogman578 – 2019-08-01T21:42:50.400To be more specific, this is supposed to be automated, a new wallet is created for every user on my website. The way I see it, now that accounts are gone, wallets are the only thing to use! – frogman578 – 2019-08-01T21:44:04.573
No, that is sending the URL as a parameter as
getwalletinfo. As I said,getwalletinfodoes not take parameters. You need to change$bitcointo send RPC requests tohttp://127.0.0.1:8333/wallet/testwalletrather thanhttp://127.0.0.1:8333/– Andrew Chow – 2019-08-01T22:17:50.110So those changes take place in the
bitcoin.conffile? Is the <ip><:port> the default URL? I can't think of anything else than parameters to use when automating the selection of wallets, this confuses me! – frogman578 – 2019-08-01T22:32:30.620No, they are not options to Bitcoin Core. They are something that you need to configure your RPC client to use. It's just like how for REST APIs you need to send requests to a certain URL. You need to do the same thing here; RPC is just a HTTP server where you send requests to a URL. This is something that you need to change in your PHP code. You need to look at the code for the RPC client in PHP and figure out how to set the URL it sends to. – Andrew Chow – 2019-08-01T23:33:08.557
Oh now I get it, it's probably about the third party class which contains the URL, thanks! – frogman578 – 2019-08-02T05:51:55.070
Ok, I now understand what I need to do, I updated the Bitcoin connection initializer to this:
$user_bitcoin = new Bitcoin('user', 'password', 'HTTP', 'localhost', '8332', '127.0.0.1:8332/wallet/');, it then didn't return true. I did aprint_r($user_bitcoin->error());which returned1– frogman578 – 2019-08-03T22:32:43.510