Hi there,
I have a small problem with my server bitcoind, when i taping example : bitcoin-cli getbalance i have that error :
error: couldn't connect to server: unknown (code -1)
(make sure server is running and you are connecting to the correct RPC port)
But the port its open, how i can resolve that ?
System : Ubuntu Server
Bitcoin.conf :
prune=550
rpcport=8332
maxconnections=125
maxuploadtarget=0
rpcuser=USERHIDDEN
rpcpassword=PASSWORDHIDDEN
daemon=1
keypool=100
#Edit : Bad English
Thank
A couple of things...
Use your RPC connect username and password in the command.
bitcoin-cli -rpcuser=userhidden -rpcpassword=passwordhidden -rpcport=8332
Check your firewall rules:
or
For debugging, you can try turning off your firewall
, dont forget to turn it back on.
If it was blocked locally, you can add a rule:
sudo ufw allow from (source ip) to (RPC IP) port 8332 proto tcp
example: sudo ufw allow from 192.168.1.1 to 192.168.1.1 port 8332 proto tcp
Good luck