Author

Topic: [0.1 BTC Bounty] Fix My JSONRPC Bitcoind-PHP Issues (Read 1773 times)

hero member
Activity: 504
Merit: 500
sucker got hacked and screwed --Toad
rpcallowip=*
works at all?

In the later version of bitcoind I do believe this is something like:

Code:
::/0

No. It doesn't work.

Anyway, I've figured out a fix/workaround. Since I can connect locally, I am hosting a webserver on the VPS as an API to connect to bitcoind. From my site, I can POST/GET to the API and perform operations thus.
hero member
Activity: 574
Merit: 500
rpcallowip=*
works at all?
hero member
Activity: 504
Merit: 500
sucker got hacked and screwed --Toad
Nope. Neither of you guys' solutions works. Thanks for your time, though.
hero member
Activity: 686
Merit: 502
Also, for the reason of testing... remove

Quote
rpcallowip=IP.OF.WEB.SERVER

also IP of webserver will need to be loopback usually, so 127.0.0.1 in most cases. Not the public facing IP.
What do you mean?

Explain it to a dummy Smiley

--snip--

try to connect this way :

$btc = new jsonRPCClient(http://username:password@host:8332);

instead of
$btc = new jsonRPCClient("http://username:password@host:8332/");

tell me if it changes something Smiley

Will try.

Try,

Code:
server=1
daemon=1
listen=1
rpcuser=username
rpcpassword=password
rpcport=8332

If that works, Try

Code:
server=1
daemon=1
listen=1
rpcuser=username
rpcpassword=password
rpcallowip=127.0.0.1
rpcport=8332
hero member
Activity: 504
Merit: 500
sucker got hacked and screwed --Toad
Also, for the reason of testing... remove

Quote
rpcallowip=IP.OF.WEB.SERVER

also IP of webserver will need to be loopback usually, so 127.0.0.1 in most cases. Not the public facing IP.
What do you mean?

Explain it to a dummy Smiley

--snip--

try to connect this way :

$btc = new jsonRPCClient(http://username:password@host:8332);

instead of
$btc = new jsonRPCClient("http://username:password@host:8332/");

tell me if it changes something Smiley

Will try.
hero member
Activity: 686
Merit: 502
I notice its listening on IP6 only, Should be IP4 and IP6.

for the reason of testing... remove

Quote
rpcallowip=IP.OF.WEB.SERVER

IP of webserver will need to be loopback usually, so 127.0.0.1 in most cases. Not the public facing IP.

legendary
Activity: 2464
Merit: 3158
Hullo!

I've had some problems getting a PHP script using jsonRPCClient to connect to a running bitcoind daemon on another, external server. My bitcoin.conf currently looks like this:

Code:
server=1
daemon=1
listen=1
rpcuser=username
rpcpassword=password
rpcallowip=IP.OF.WEB.SERVER
rpcport=8332

The PHP script is something like this:

Code:

require 'jsonRPCClient.php';

$btc = new jsonRPCClient("http://username:password@host:8332/");
print_r($btc->getinfo());

?>


Debug shows error occurs when jsonRPCClient tries to connect to the server. Either a "Connection timed out." or "Connection refused." error.

Bounty goes to the first person to give me a working solution to this problem.

Solutions I've Tried

Open all ports on netstat. Nope. All open. VPS hoster is not blocking any ports their side.

Is it listening? Yup, it is, so this shouldn't be a problem.

Code:
netstat -nlp | grep 8332
tcp6       0      0 :::8332                 :::*                    LISTEN      19482/bitcoind



try to connect this way :

$btc = new jsonRPCClient(http://username:password@host:8332);

instead of
$btc = new jsonRPCClient("http://username:password@host:8332/");

tell me if it changes something Smiley
hero member
Activity: 504
Merit: 500
sucker got hacked and screwed --Toad
Hullo!

I've had some problems getting a PHP script using jsonRPCClient to connect to a running bitcoind daemon on another, external server. My bitcoin.conf currently looks like this:

Code:
server=1
daemon=1
listen=1
rpcuser=username
rpcpassword=password
rpcallowip=IP.OF.WEB.SERVER
rpcport=8332

The PHP script is something like this:

Code:

require 'jsonRPCClient.php';

$btc = new jsonRPCClient("http://username:password@host:8332/");
print_r($btc->getinfo());

?>


Debug shows error occurs when jsonRPCClient tries to connect to the server. Either a "Connection timed out." or "Connection refused." error.

Bounty goes to the first person to give me a working solution to this problem.

Solutions I've Tried

Open all ports on netstat. Nope. All open. VPS hoster is not blocking any ports their side.

Is it listening? Yup, it is, so this shouldn't be a problem.

Code:
netstat -nlp | grep 8332
tcp6       0      0 :::8332                 :::*                    LISTEN      19482/bitcoind

Jump to: