Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: w40ut on October 22, 2015, 05:49:01 PM



Title: Configuring a dice website.
Post by: w40ut on October 22, 2015, 05:49:01 PM
Hello,

I have a dice website script, and it uses RPC json in order to get wallet details, make automatic payments, etc.

But when i put my wallet (blockchain and bitcoin-qt) details, it won't connect to the wallet.
But when i put "localhost" as a host it connects. How is that possible?

Regards.


Title: Re: Configuring a dice website.
Post by: achow101 on October 22, 2015, 07:23:42 PM
But when i put my wallet (blockchain and bitcoin-qt) details, it won't connect to the wallet.
What do you mean by wallet deatils?

But when i put "localhost" as a host it connects. How is that possible?
It needs to connect to the server over the network, and to connect to the local computer, its hostname is localhost. What was it before you changed it?


Title: Re: Configuring a dice website.
Post by: w40ut on October 22, 2015, 07:26:51 PM
But when i put my wallet (blockchain and bitcoin-qt) details, it won't connect to the wallet.
What do you mean by wallet deatils?

But when i put "localhost" as a host it connects. How is that possible?
It needs to connect to the server over the network, and to connect to the local computer, its hostname is localhost. What was it before you changed it?

The wallet details are:

rpchost=
rpcuser=
rpcpassword
rpcport=

But the host on blockchain isn't localhost. But when i run the script with xampp (locally) and put localhost (running bitcoin-qt) localhost as a rpchost works fine. But when i run the script over the internet (on some test website) and i put rpc.blockchain.info or my IP (from bitcoin-qt) it doesn't work...

I'm kind of "noob" with this.. i only code in C.


Thanks for the answer.
Regards.


Title: Re: Configuring a dice website.
Post by: achow101 on October 22, 2015, 07:39:26 PM
But when i put my wallet (blockchain and bitcoin-qt) details, it won't connect to the wallet.
What do you mean by wallet deatils?

But when i put "localhost" as a host it connects. How is that possible?
It needs to connect to the server over the network, and to connect to the local computer, its hostname is localhost. What was it before you changed it?

The wallet details are:

rpchost=
rpcuser=
rpcpassword
rpcport=

But the host on blockchain isn't localhost. But when i run the script with xampp (locally) and put localhost (running bitcoin-qt) localhost as a rpchost works fine. But when i run the script over the internet (on some test website) and i put rpc.blockchain.info or my IP (from bitcoin-qt) it doesn't work...

I'm kind of "noob" with this.. i only code in C.


Thanks for the answer.
Regards.
rpc.blockchain.info won't work unless you put in the details for their rpc server. What is probably happening is that your firewall is blocking the rpc requests. You need to open up the rpcport you specified (probably 8332) in both the firewalls on server with the bitcoind and on your router.

However, this is highly not recommended. You should have the bitcoind on the server that you are hosting the site on, or at least on the same local network. If you don't then that means that anyone may be able to access the rpc server and access the wallet. It would open it up to the internet and thus open it to attack.


Title: Re: Configuring a dice website.
Post by: w40ut on October 22, 2015, 07:41:17 PM
Oh.. now i got it.

Many thanks.

Regards.