Take the 2-minute tour ×
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It's 100% free, no registration required.

I have been trying to connect to a remote bitcoind -daemon running server. I can access it with the curl command explained at the end of the page here (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)) by putting in the correct port number, but when I try to call from a remote host, I get a:

curl: (7) couldn't connect to host

error

I checked with netstat and it looks like bitcoind is listening on the port (otherwise I wouldn't be able to do rpc locally), and accepting all incoming IP addresses.

My bitcoin.config file also allows for all IP addresses and rpc (no ssl, although if anyone has a detailed decscription of how ).

I also made sure that I opened up a TCP port.

Here's the curl command I'm using:

curl --user <user> --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' <ip address:port>

Does anyone know what else might be wrong?

share|improve this question
add comment

2 Answers

Bitcoin disallows rpc requests from IP addresses other than 127.0.0.1 Try adding

rpcallowip=<your ip addres>

to your bitcoin configuration file.

More info

share|improve this answer
    
Already did that, still not working...I have it set to rpcallowip=* –  ZenBalance Feb 20 '13 at 5:57
    
@ZenBalance Hmmm. Can you post your curl command? –  Nick ODell Feb 20 '13 at 6:34
    
curl --user <user> --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' <ip address:port> –  ZenBalance Feb 20 '13 at 7:39
add comment
up vote 1 down vote accepted

Answer: It ends up that the firewall setting for the network were set in such a way that they were blocking the connection even though the port was open on the computer.

For those who also run into this problem:

-If you curl the server and the connection is instantly refused, then you need to open up the port in your ip tables.

-If your curl hangs like mine above and/or returns a curl: (7) error like above (and you have verified that both the rpc curl from the localhost of the bitcoind server is working and another port on the bitcoind server can be pinged remotely) then you probably have either computer firewall or network firewall settings blocking your port.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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