Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: usagi on July 09, 2011, 12:23:15 AM



Title: connection problems
Post by: usagi on July 09, 2011, 12:23:15 AM
connection problems


Title: Re: Remote bitcoind connection problems
Post by: drawoc on July 09, 2011, 03:54:41 AM
If you haven't already, you need to whitelist external addresses, for example:
Code:
rpcallowip=192.168.1.100
This whitelists the IP 192.168.1.100. Note that you're also allowed to use wildcard characters.

(If you've done this already, sorry - you weren't too clear in the OP. If this isn't helpful, you need to post more details - Which options, in specific have you tried in bitcoin.conf? Have you configured the PHP libraries right? Are you doing this between computers on the same network or across the internet?)


Title: Re: Remote bitcoind connection problems
Post by: Xenland on July 09, 2011, 05:33:37 AM
If you haven't already, you need to whitelist external addresses, for example:
Code:
rpcallowip=192.168.1.100
This whitelists the IP 192.168.1.100. Note that you're also allowed to use wildcard characters.

(If you've done this already, sorry - you weren't too clear in the OP. If this isn't helpful, you need to post more details - Which options, in specific have you tried in bitcoin.conf? Have you configured the PHP libraries right? Are you doing this between computers on the same network or across the internet?)

Well, I've whitelisted the IPs in question, set server=1, everything else I can think of. But but but but but, what's this about PHP libraries? I uploaded phpRPCClient.php and Bitcoin.php and have been trying those.. Are you saying I actually have to install a system library too? Well, I didn't install any libraries. What do I need to do? "sudo apt-get php-json"?

Thanks for any advice.

-


this may sound wierd but I had the same problem I don't know exactly what fixed it becuase I double-triple-checked all the credentials but try commenting out server=1
It worked for me on top of 1000 other things I did, but really thats the only thing I could pin point it down too


Title: Re: Remote bitcoind connection problems
Post by: drawoc on July 09, 2011, 04:03:09 PM
Well, I've whitelisted the IPs in question, set server=1, everything else I can think of. But but but but but, what's this about PHP libraries? I uploaded phpRPCClient.php and Bitcoin.php and have been trying those.. Are you saying I actually have to install a system library too? Well, I didn't install any libraries. What do I need to do? "sudo apt-get php-json"?

No, I just meant to check that you're passing the right username, password, IP, and port to your JSON library.

You could try Xenland's suggestion, if you're running bitcoind, you don't need the sever flag (I have no idea why that might be a problem).

For reference, this is my full bitcoin.conf, and it lets me connect from other computers on the network:
Code:
rpcpassword=hi
rpcuser=hi
testnet=1
rpcallowip=192.168.1.*
(You don't want the testnet flag set.)

From the computer you're running the php on, you can try running:
Code:
telnet 192.168.1.2 8332
Replacing 192.168.1.2 with your IP, and 8332 with your port if you changed it.
If it gives you a connect error, your bitcoind is configured wrong, or you have the wrong port/ip address.
If it just sits there waiting for input, you're having a username/password issue.


Title: Re: Remote bitcoind connection problems
Post by: drawoc on July 09, 2011, 05:12:15 PM
The fact that it gives you "403 Forbidden" means that you can successfully connect to your bitcoind from that location. I would make sure that you're passing your username and password in your php file correctly.

If you need it, there's an example using the JSON-RPC PHP library here: https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29#PHP (https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29#PHP)

The difference between doing telnet 127.0.0.1 and telnet <IP Address> is simply that when you connect remotely, it requires you to enter your username and password (The error is because you didn't, and you probably don't want to with telnet). The fact that the server is talking to you means it's configured properly, so the error is on the PHP end.