<p>By default cardano-wallet listens on loopback ip only - 127.0.0.1, to listen on server external ip, you need to add <code>--listen-address</code> parameter</p>
<p>So at the end command should be:</p>
<pre><code>cardano-wallet serve \
  --listen-address 0.0.0.0 \
  --mainnet \
  --node-socket ~/cardano/db/node.socket \
  --database ~/cardano/db
  --port 8090
</code></pre>
<p>Or put dropleat real ip instead of 0.0.0.0 if it doesn't works.</p>
<p>Keep in mind that this is very, very dangerous to keep your wallet open to whole world especially on mainnet, so use this with caution and please use digitalocean FW and allow only your own IPs.</p>

CC BY-SA 4.0
2021-12-28T02:33:42.370Z
I'm worried I may have a fundamental misunderstanding of this whole thing. I wanted to make it open to the whole world, so I can create wallets for people via this service. (specifically, I wanted to make an iOS app that among other things can generate a wallet and give people their 12-15 word passphrase and let them enter/change a password)
Jeffrey Berthiaume
CC BY-SA 4.0
2021-12-29T09:35:56.513Z
@JeffreyBerthiaume, yes, never do that. The generation of the wallet needs to stay in the application itself, having a hosted service to do this is an extremely bad idea.
Marek Mahut - StakeNuts
CC BY-SA 4.0
2021-12-27T21:19:19.477Z
2021-12-27T21:27:53.157Z
2021-12-27T21:27:53.157Z
os11k
<p>I'm no networking wiz (working on it) - but I just played around with the above:</p>
<p>I got the same error when I used my public IP address. However, when I use the loopback address (127.0.0.1) it seems to work for me.</p>
<p>Try running: <code>http://127.0.0.1:8090/v2/network/information</code> in chrome and see if that works.</p>
<p>If anyone knows why the public IP doesn't work but the loopback does, please explain why! :)</p>

CC BY-SA 4.0
2021-12-27T19:50:15.460Z
I'm not running this locally - this is on a Digital Ocean droplet, kind of like having a mini server running.
Jeffrey Berthiaume
CC BY-SA 4.0
2021-12-27T19:56:07.790Z
Ah I see. Then it won't be so simple - my naive and non-technical answer would be that you'd have to configure your droplet firewall to open port 8090 so that you could access it from the outside. Security is a concern here, but digital ocean has cloud-firewall options that make it relatively easy to allow connections to/from specific addresses (your home/office). I will work on this myself because it's piqued my curiosity; I'll get back here when I learn more.
zhekson
CC BY-SA 4.0
2021-12-27T20:46:01.390Z
FYI, I created and applied a firewall specifically letting traffic in from the node port as well as the wallet port. Still nothing on either.
Jeffrey Berthiaume
CC BY-SA 4.0
2021-12-27T19:45:33.417Z
2021-12-27T19:45:33.417Z
zhekson
<p>Using a DigitalOcean Ubuntu droplet, I have:</p>
<ul>
<li><p>successfully installed cardano-node according to:
<a href="https://developers.cardano.org/docs/get-started/installing-cardano-node/" rel="nofollow noreferrer">https://developers.cardano.org/docs/get-started/installing-cardano-node/</a></p>
<p>cardano-cli 1.32.1 - linux-x86_64 - ghc-8.10
git rev 4f65fb9a27aa7e3a1873ab4211e412af780a3648</p>
</li>
<li><p>successful installed cardano-wallet according to:
<a href="https://developers.cardano.org/docs/get-started/installing-cardano-wallet" rel="nofollow noreferrer">https://developers.cardano.org/docs/get-started/installing-cardano-wallet</a></p>
<p>v2021-12-15 (git revision: 760140e238a5fbca61d1b286d7a80ece058dc729)</p>
</li>
<li><p>(in order to download/calculate the latest hashes) run</p>
</li>
</ul>
<pre><code>nohup cardano-node run
    --topology ~/cardano/mainnet/mainnet-topology.json
    --database-path ~/cardano/db
    --socket-path ~/cardano/db/node.socket
    --host-addr &lt;my_ip&gt;
    --port &lt;port-number&gt;
    --config ~/cardano/mainnet/mainnet-config.json &amp; exit
</code></pre>
<ul>
<li>And then asked the wallet to serve the http interface:</li>
</ul>
<pre><code>cardano-wallet serve \
  --mainnet \
  --node-socket ~/cardano/db/node.socket \
  --database ~/cardano/db
  --port 8090
</code></pre>
<p>However, when using Chrome to go to <code>http://&lt;my_ip&gt;:8090/v2/network/information</code> or <code>http://&lt;my_ip&gt;:8090/v2</code>, I only get:</p>
<pre><code>This site can’t be reached
&lt;my_ip&gt; refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
</code></pre>
<p>Now, when I run <code>cardano-cli query tip --mainnet</code> I am only at epoch 293 (and as time of this question we are at 310.</p>
<p>Do I need to wait till I get to 310 for the http api to work? Is there anything else that is needed to get this connected?</p>

<wallet><cardano-cli><api>
How do I get the http endpoint to work for cardano-wallet?
# How do I get the http endpoint to work for cardano-wallet?

(Asked by: username_0 on 2021-12-27)

Using a DigitalOcean Ubuntu droplet, I have:

successfully installed cardano-node according to:
https://developers.cardano.org/docs/get-started/installing-cardano-node/
cardano-cli 1.32.1 - linux-x86_64 - ghc-8.10
git rev 4f65fb9a27aa7e3a1873ab4211e412af780a3648

successful installed cardano-wallet according to:
https://developers.cardano.org/docs/get-started/installing-cardano-wallet
v2021-12-15 (git revision: 760140e238a5fbca61d1b286d7a80ece058dc729)

(in order to download/calculate the latest hashes) run


nohup cardano-node run
    --topology ~/cardano/mainnet/mainnet-topology.json
    --database-path ~/cardano/db
    --socket-path ~/cardano/db/node.socket
    --host-addr 
    --port 
    --config ~/cardano/mainnet/mainnet-config.json & exit


And then asked the wallet to serve the http interface:

cardano-wallet serve \
  --mainnet \
  --node-socket ~/cardano/db/node.socket \
  --database ~/cardano/db
  --port 8090

However, when using Chrome to go to http://:8090/v2/network/information or http://:8090/v2, I only get:
This site can’t be reached
 refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

Now, when I run cardano-cli query tip --mainnet I am only at epoch 293 (and as time of this question we are at 310.
Do I need to wait till I get to 310 for the http api to work? Is there anything else that is needed to get this connected?

**Tags:** wallet, cardano-cli, api

---

## 2 answers

### Answer by username_1 on 2021-12-27. Score: 3 | Accepted answer

By default cardano-wallet listens on loopback ip only - 127.0.0.1, to listen on server external ip, you need to add --listen-address parameter
So at the end command should be:
cardano-wallet serve \
  --listen-address 0.0.0.0 \
  --mainnet \
  --node-socket ~/cardano/db/node.socket \
  --database ~/cardano/db
  --port 8090

Or put dropleat real ip instead of 0.0.0.0 if it doesn't works.
Keep in mind that this is very, very dangerous to keep your wallet open to whole world especially on mainnet, so use this with caution and please use digitalocean FW and allow only your own IPs.

> **Comments:**
> **username_0**: I'm worried I may have a fundamental misunderstanding of this whole thing. I wanted to make it open to the whole world, so I can create wallets for people via this service. (specifically, I wanted to make an iOS app that among other things can generate a wallet and give people their 12-15 word passphrase and let them enter/change a password)  
> **username_2**: @JeffreyBerthiaume, yes, never do that. The generation of the wallet needs to stay in the application itself, having a hosted service to do this is an extremely bad idea.  

---

### Answer by username_3 on 2021-12-27. Score: 0

I'm no networking wiz (working on it) - but I just played around with the above:

I got the same error when I used my public IP address. However, when I use the loopback address (127.0.0.1) it seems to work for me.

Try running: `http://127.0.0.1:8090/v2/network/information` in chrome and see if that works.

If anyone knows why the public IP doesn't work but the loopback does, please explain why! :)

> **Comments:**
> **username_0**: I'm not running this locally - this is on a Digital Ocean droplet, kind of like having a mini server running.  
> **username_3**: Ah I see. Then it won't be so simple - my naive and non-technical answer would be that you'd have to configure your droplet firewall to open port 8090 so that you could access it from the outside. Security is a concern here, but digital ocean has cloud-firewall options that make it relatively easy to allow connections to/from specific addresses (your home/office). I will work on this myself because it's piqued my curiosity; I'll get back here when I learn more.  
> **username_0**: FYI, I created and applied a firewall specifically letting traffic in from the node port as well as the wallet port. Still nothing on either.  

---

