1

OK, I recently posted trying to get help connecting to BITCOIND using Ubuntu or Windows 7.

In Ubuntu (Virtual Machine under Win7 64bit) 12.04 Desktop LTS I have the following written in my BITCOIN.CONF file located in $HOME/.bitcoin :

server=1
rpcuser=hello1
rpcpassword=12345
rpcallowip=*

I run BITCOIND with following command:

./bitcoind --server --rpcuser=hello1 --rpcpassword=12345

But when I try and connect with the Ruby script (see https://bitcointalk.org/index.php?topic=85495.msg3773215#msg3773215 ) it gives an error saying it can't connect.

Likewise, under Windows 7 I attempt the same procedure and using NIRSOFT cports app I see Bitcoin daemon is only opened under port 8333, not 833*2* as one would expect if RPC connection was active.

I've opened TCP/UDP port 8332-8333 in port forwarding of router.

What on Earth am I doing wrong here? Why can't I connect to Bitcoin daemon via RPC?

==> BONUS QUESTION: I'm quite new to Ubuntu; how do you check open TCP ports at terminal in Ubuntu? (equivalent of netstat in windows)

1
  • Bonus question: Find another forum, please, where you'll likely hear lsof -i.
    – user6049
    Mar 9, 2014 at 22:33

3 Answers 3

1

I am not familiar about how to run it on windows but for Ubuntu 12.04 I can help you out first you should remove garbage from the conf file which should be located under ~/.bitcoin folder with the name bitcoin.conf with just following text :

server=1
daemon=1
rpcuser=whatever
rpcpassword=whatever

^^ is sufficient

now to make bitcoind to reply RPC calls you should have jsonRPCClient files in your computer I am not familiar with ruby but still https://github.com/Textalk/json-rpc-client-ruby this link can give you an idea on how to do it. I hope this will help you achieve what you are looking for. And the bonus answer on linux you can use netstat -ntpl to have detailed view on which program is using which port

1

Netstat(1) will give you open ports (in this case listening TCP ports): netstat -lnt.

To make sure you know which port your bitcoind daemon is using, start it with paramter -rpcport. In your example, use exactly -rpcport=8332, then use the same port when connecting to it.

2
  • port 8332 NOT OPEN. Can anyone PLEASE help me here? Where is it going wrong?!?! Dec 9, 2013 at 12:07
  • Try with just rpcuser, rpcpassword and server. Don't specify rpcallowip (it will default to 127.0.0.1). Dec 9, 2013 at 17:24
1

QT's RPC API is set to listen by default to TCP port 8332.

Take out everything from your bitcoin.conf and leave only: rpcuser=hello1 rpcpassword=12345

Since you have specified the rpcuser and rpcpassword parameters in the bitcoin.conf file you don't need to explicitly specify them in the bitcoind initialization command (you will need to send them from your client, once the daemon is up and running).

In a Command Prompt, run: bitcoind.exe -daemon -debugnet -printtoconsole and then open a new Command Prompt and type: netstat -a, once the RPC API is listening for connections you should see this: TCP 127.0.0.1:8332 myHostName:0 LISTENING

As a note, rpcallowip=* puts your server at risk so I would highly recommend you stop using it immediately.

Your Answer

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

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