Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: zirf45 on July 01, 2018, 06:46:29 PM



Title: Can't connect to my node
Post by: zirf45 on July 01, 2018, 06:46:29 PM
Hi all,

I can't connect to my node using bitcoin-cli. The node seems to be reachable from the outside since I get more than eight connections, so I think I've correctly forwarded the posts on my router. Also, https://bitnodes.earn.com/nodes/31.6.41.78-8333/ says my node is online and reachable. I can not connect through the local LAN IP and also not through the  public internet IP.
I can only find standard bitcoin entries in the bitcoind log file.


Server:
Bitcoin Client Software and Version Number: Bitcoin Core 0.16.1
Operating System: Linux / Ubuntu Server 18.04 LTS
Hardware: https://www.asrock.com/mb/Intel/Q1900-ITX/

ufw is inactive

bitcoin.conf:
Code:
server=1
daemon=1
txindex=1
disablewallet=1

# Connection settings
rpcuser=***
rpcpassword=***
rcpallowip=*
zmqpubrawblock=tcp[Suspicious link removed]cuted on the server directly:
[b][i]bitcoin-cli -getinfo[/i][/b]
[code]{
  "version": 160100,
  "protocolversion": 70015,
  "walletversion": null,
  "balance": null,
  "blocks": 530069,
  "timeoffset": 0,
  "connections": 13,
  "proxy": "",
  "difficulty": 5077499034879.017,
  "testnet": false,
  "keypoololdest": null,
  "keypoolsize": null,
  "paytxfee": null,
  "relayfee": 0.00001000,
  "warnings": ""
}


Following commands are executed from my client computer:
Bitcoin Client Software and Version Number: Bitcoin Core 0.16.1
Operating System: Linux / Arch

Try to connect using the LAN IP of the server computer:
bitcoin-cli -rpcconnect=192.168.1.80 -rpcport=8332 -rpcuser=*** -rpcpassword=*** -getinfo
Code:
error: couldn't connect to server: unknown (code -1)
(make sure server is running and you are connecting to the correct RPC port)
I get the same error as above when trying to connect via public internet IP

connect using a bogus LAN IP, I get a different error:
bitcoin-cli -rpcconnect=192.168.1.84 -rpcport=8332 -rpcuser=*** -rpcpassword=*** -getinfo
Code:
error: couldn't connect to server: EOF reached (code 1)
(make sure server is running and you are connecting to the correct RPC port)

Any idea? Thanks!
[/code]


Title: Re: Can't connect to my node
Post by: achow101 on July 01, 2018, 06:55:41 PM
The RPC port is different from the network port. Make sure that you are forwarding the RPC port which is 8332 by default.

Additionally, you need to make sure that the correct IP address(es) are set for rpcallowip.

Lastly, run bitcoind with -debug=rpc and your debug.log file may contain some additional information about why you are unable to connect.


Title: Re: Can't connect to my node
Post by: A-Bolt on July 01, 2018, 07:27:17 PM
bitcoin.conf:
Code:
server=1
daemon=1
txindex=1
disablewallet=1

# Connection settings
rpcuser=***
rpcpassword=***
rcpallowip=*

Wrong:
rcpallowip=*

Correct:
rpcallowip=192.168.1.0/24


Title: Re: Can't connect to my node
Post by: zirf45 on July 01, 2018, 07:37:23 PM
Thank you both so much!

rpcallowip=192.168.1.0/24 <== Did the trick!