5

I have read a similar post which had no answer at this location. I am trying to use bitcoin-cli from a host that different from the host that runs bitcoind. I also would be happy with being able to use curl to issue rpc requests. I have had much success with getting bitcoind and bitcoin-cli to communicate within the same host, but activating the rpc port for external communication has proven to be beyond difficult if not impossible, and I am seeking your help.

I have started bitcoind with the following configuration file:

server=1
rpcuser=jared
rpcpassword=1234
rpcport=8332
rpcallow=192.168.*.*
gen=0
prune=600

(Note, the password will be changed after the system is working)

I have confirmed that the system is functioning on the local machine using bitcoin-cli to get the following:

{
    "version" : 110200,
    "protocolversion" : 70002,
    "blocks" : 183745,
    "timeoffset" : -1,
    "connections" : 8,
    "proxy" : "",
    "difficulty" : 1583177.84744401,
    "testnet" : false,
    "paytxfee" : 0.00000000,
    "relayfee" : 0.00005000,
    "errors" : ""
}

And from another host on the network, I have used nmap to scan the ports to display:

Starting Nmap 6.47 ( http://nmap.org ) at 2015-12-19 15:20 PST
Nmap scan report for c161.attlocal.net (192.168.1.68)
Host is up (0.0014s latency).
Not shown: 997 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
8333/tcp open  unknown

In the question referenced above, the user was able to cause the rpc port to open by removing the rpcallow lines from his configuration file. He commented them out, and the problem fixed itself. I have also tried this and not had any luck.

I also have tried using rpcallow of '192.168.1.*', '192.168.0.0/16', '192.168.1.0/24' and once tried using rpcbind, which appears to be related to an older version of bitcoind as it is no longer listed in the man pages for bitcoin.conf.

My system is running the following OS:

Distributor ID: Ubuntu
Description:    Ubuntu 15.10
Release:    15.10
Codename:   wily

Any and all help is appreciated! Kind regards, and thank you.

  • The wildcard syntax is not supported anymore, you need to use 192.168.0.0/16. What does netstat -antlp | grep 8332 say? – Nick ODell Dec 20 '15 at 0:25
  • @NickODell, please add your comment as an answer so I can give you credit for solving my problem. The RPC port does not display as an open port on nmap even still, but it is clear the bitcoin-cli application is communicating with the primary host. – Jared Clemence Dec 20 '15 at 1:31
5

Two thoughts:

  1. The wildcard syntax is not supported anymore. Instead of 192.168.*.*, use 192.168.0.0/16. Instead of 192.168.1.*, use 192.168.1.0/24.

  2. As an additional debugging step, try running netstat -antlp | grep 8332. If that produces output like the following, that means that it is bound to the port.

    tcp        0      0 0.0.0.0:8332             0.0.0.0:*               LISTEN 
    
  • Thanks. After netstatit turns out my bitcoin node listen at port 18332, not 8332. – Ozgur Jan 9 '18 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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