<p><code>getwalletinfo</code> does not take parameters.</p>

<p>It sounds like what you are looking for is how to send <code>getwalletinfo</code> to a certain wallet loaded into Bitcoin Core. The way to do this is to use that wallet's API endpoint. The endpoint is <code>/wallet/&lt;name&gt;</code> where <code>&lt;name&gt;</code> is the name of the wallet you are trying to send commands to.</p>

<p>So the full URL that you need to send your RPC requests to is <code>http://&lt;ip&gt;:&lt;port&gt;/wallet/&lt;name&gt;</code> where <code>&lt;ip&gt;</code> is the IP address that Bitcoin Core is listening on (probably <code>127.0.0.1</code>), <code>&lt;port&gt;</code> is the port the RPC interface is bound to (probably <code>8333</code>), and <code>&lt;name&gt;</code> is the name of the wallet.</p>

CC BY-SA 4.0
2019-08-01T21:42:50.400Z
so that would be `$bitcoin->getwalletinfo("http://127.0.0.1:8333/wallet/testwallet");`?
frogman578
CC BY-SA 4.0
2019-08-01T21:44:04.573Z
To 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
CC BY-SA 4.0
2019-08-01T22:17:50.110Z
No, that is sending the URL as a parameter as `getwalletinfo`. As I said, `getwalletinfo` does not take parameters. You need to change `$bitcoin` to send RPC requests to `http://127.0.0.1:8333/wallet/testwallet` rather than `http://127.0.0.1:8333/`
Ava Chow
CC BY-SA 4.0
2019-08-01T22:32:30.620Z
So those changes take place in the `bitcoin.conf` file? 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
CC BY-SA 4.0
2019-08-01T23:33:08.557Z
No, 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.
Ava Chow
CC BY-SA 4.0
2019-08-02T05:51:55.070Z
Oh now I get it, it's probably about the third party class which contains the URL, thanks!
frogman578
CC BY-SA 4.0
2019-08-03T22:32:43.510Z
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 a `print_r($user_bitcoin->error());` which returned `1`
frogman578
CC BY-SA 4.0
2019-08-01T21:37:33.783Z
2019-08-01T21:37:33.783Z
Ava Chow
<p>I can't seem to get a firm grasp of how to use the <code>getwalletinfo</code> RPC in the cmd line as well as in PHP code, The documentation says <code>getwalletinfo</code> 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 <code>getwalletinfo</code> RPC in PHP to get information of a specific wallet?</p>

<bitcoind><json-rpc><php>
how do I use the getwalletinfo RPC?
frogman578
# how do I use the getwalletinfo RPC?

(Asked by: username_0 on 2019-08-01)

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?

**Tags:** bitcoind, json-rpc, php


---

## 1 answers

### Answer by username_1 on 2019-08-01. Score: 1

`getwalletinfo` does not take parameters.

It sounds like what you are looking for is how to send `getwalletinfo` to a certain wallet loaded into Bitcoin Core. The way to do this is to use that wallet's API endpoint. The endpoint is `/wallet/<name>` where `<name>` is the name of the wallet you are trying to send commands to.

So the full URL that you need to send your RPC requests to is `http://<ip>:<port>/wallet/<name>` where `<ip>` is the IP address that Bitcoin Core is listening on (probably `127.0.0.1`), `<port>` is the port the RPC interface is bound to (probably `8333`), and `<name>` is the name of the wallet.

> **Comments:**
> **username_0**: so that would be `$bitcoin->getwalletinfo("http://127.0.0.1:8333/wallet/testwallet");`?  
> **username_0**: To 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!  
> **username_1**: No, that is sending the URL as a parameter as `getwalletinfo`. As I said, `getwalletinfo` does not take parameters. You need to change `$bitcoin` to send RPC requests to `http://127.0.0.1:8333/wallet/testwallet` rather than `http://127.0.0.1:8333/`  
> **username_0**: So those changes take place in the `bitcoin.conf` file? 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!  
> **username_1**: No, 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.  
> **username_0**: Oh now I get it, it's probably about the third party class which contains the URL, thanks!  
> **username_0**: 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 a `print_r($user_bitcoin->error());` which returned `1`  

---

