0

I am simply trying to run bitcoin-cli getinfo on the same machine that my bitcoin node is running on (with bitcoind -daemon)

my bitcoin.conf file is as follows:

server='1'
rpcuser='username'
rpcpassword='password'
rpcport='8332'

The error message I receive is:

error: Could not connect to the server 127.0.0.1:0

This error is confusing me in two ways. First, my home network uses an Xfinity gateway (combined router/modem), and the local ip addresses look like 10.0.0.xx, not 127.x.x.x. Second, why is the error suggesting that it tried to connect on port 0? I have specified in bitcoin.conf that the rpc port is 8332. In this current state I can run a node, but I cannot make any rpc calls, rendering it useless for my purposes. Any advice on how to fix this issue?

1 Answer 1

1
  • Bitcoin.conf does not use quotes in its definition of options. Your lines need to resemble server=1 rather than server='1'. Your port number being zero is an artifact of this, which will not work as you need root permissions to bind to ports below 1024, which bitcoind does not and should not have.

  • 127.0.0.1 is the loopback address used when you're connecting to yourself, rather than a normal routable IP address. For safety's sake the RPC port is not by default enabled to bind to routable IP addresses, such as your 10.0.0.0/24 range. By default, it will only bind to 127.0.0.1 and subsequently only be accessible on the host it is running on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.