Thursday, September 26, 2024

bitcoind – Cannot connect with Bitcoin RPC on DigitalOcean server

I’m operating bitcoind on a DigitalOcean droplet with public IP deal with e.g. 1.1.1.1.

I wish to connect with it through RPC from one other DigitalOcean droplet with public IP deal with e.g. 2.2.2.2.

Each Droplets are operating Ubuntu Linux 18.04.

~/.bitcoin/bitcoin.conf on 1.1.1.1:

datadir=/mnt/vol1
disablewallet=1
rpcbind=1.1.1.1
rpcuser=x
rpcpassword=x
rpcallowip=2.2.2.2/32
server=1

netstat -ln | grep 8332 on 1.1.1.1 yields:

tcp        0      0 127.0.0.1:8332          0.0.0.0:*               LISTEN
tcp6       0      0 ::1:8332                :::*                    LISTEN

RPC instructions on 1.1.1.1 equivalent to ./bitcoin-cli -rpcuser=x -rpcpassword=x -rpcconnect=localhost -rpcport=8332 getnetworkinfo return usually.

Nonetheless, on machine 2.2.2.2, after I run ./bitcoin-cli -rpcuser=x -rpcpassword=x -rpcconnect=1.1.1.1 -rpcport=8332 getnetworkinfo I get:

error: Couldn't connect with the server 1.1.1.1:8332

Make sure that the bitcoind server is operating and that you're connecting to the proper RPC port.

Machine 1.1.1.1 has firewall guidelines in DigitalOcean as follows:

Sort        Protocol        Port Vary      Sources
SSH         TCP             22              2.2.2.2/32
Customized      TCP             8332            2.2.2.2/32

Word that SSH into 1.1.1.1 from 2.2.2.2 is working simply advantageous.

sudo iptables -L on 1.1.1.1 provides:

Chain INPUT (coverage ACCEPT)
goal     prot decide supply               vacation spot

Chain FORWARD (coverage ACCEPT)
goal     prot decide supply               vacation spot

Chain OUTPUT (coverage ACCEPT)
goal     prot decide supply               vacation spot   

Is there something clearly improper in my configuration or setup?

Working curl -v 1.1.1.1:8332 on 2.2.2.2 instantly returns with:

* Rebuilt URL to: 1.1.1.1:8332/
*   Attempting 1.1.1.1...
* connect with 1.1.1.1 port 8332 failed: Connection refused
* Failed to hook up with 1.1.1.1 port 8332: Connection refused
* Closing connection 0
curl: (7) Failed to hook up with 1.1.1.1 port 8332: Connection refused

which from what I’ve learn probably signifies a firewall difficulty.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles