Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: johny1976 on September 07, 2013, 01:07:11 AM



Title: Bitcoin json-RPC suddenly stopped working
Post by: johny1976 on September 07, 2013, 01:07:11 AM
I have this PHP class for communicate with Litecoin client: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

Class name is jsonRCPClient. In PHP $wallet = new jsonRPCClient('http://login:password@localhost:9332');

It worked. I changed nothing. It stopped work suddenly. I don't understand.

Can anybody explain me where could be a problem? Thank you...

I'm really crying now.


Title: Re: Bitcoin json-RPC suddenly stopped working
Post by: grue on September 07, 2013, 03:12:16 AM
Are you trying to get this to work with bitcoin, or litecoin daemon? The two have slightly different API because of updates. Also, it would be helpful if you could describe the error you are having.


Title: Re: Bitcoin json-RPC suddenly stopped working
Post by: johny1976 on September 07, 2013, 05:31:05 AM
Are you trying to get this to work with bitcoin, or litecoin daemon? The two have slightly different API because of updates. Also, it would be helpful if you could describe the error you are having.

I'm trying to access Litecoin daemon.

if I call:
Code:
$wallet = new jsonRCPCClient('http://login:pass@localhost:9332');
echo $wallet->getbalance();

it works perfectly.

But I can't call:
Code:
$wallet = new jsonRCPCClient('http://login:pass@localhost:9332');
$txid = $wallet->sendtoaddress('LTCaddress');

It returns error:

PHP Fatal error:  Uncaught exception 'Exception' with message 'Unable to connect to http://username:password@localhost:9332' in /var/www/inc/jsonRPCClient.php


Title: Re: Bitcoin json-RPC suddenly stopped working
Post by: grue on September 07, 2013, 01:22:12 PM
Your call for sendtoaddress looks like it's missing a parameter. Are you sure you're calling it correctly?

Also I moved your topic because litecoin related discussions belong in alt-coins


Title: Re: Bitcoin json-RPC suddenly stopped working
Post by: johny1976 on September 07, 2013, 05:55:11 PM
Your call for sendtoaddress looks like it's missing a parameter. Are you sure you're calling it correctly?

Also I moved your topic because litecoin related discussions belong in alt-coins

Yes, I'm calling it correctly. Sorry, I forgot to write it here. So my function is:

Code:
$txid=sendtoaddress('LTCaddress',0.5);

It just not working :/


Title: Re: Bitcoin json-RPC suddenly stopped working
Post by: coinotron on September 07, 2013, 06:36:12 PM
How many concurrent RPC calls do you send to litecoin client?
I have serious issues with litecoin 0.8.3.7 not accepting more than 4 concurrent RPC. This bug is present also in bitcoin.


Title: Re: Bitcoin json-RPC suddenly stopped working
Post by: johny1976 on September 07, 2013, 07:25:35 PM
How many concurrent RPC calls do you send to litecoin client?
I have serious issues with litecoin 0.8.3.7 not accepting more than 4 concurrent RPC. This bug is present also in bitcoin.

2. But it's working now, I just didn't have LTCs in wallet :D Thanks


Title: Re: Bitcoin json-RPC suddenly stopped working
Post by: Petr1fied on September 07, 2013, 08:18:27 PM
I find it's better to use getbalance(account, confirms) and sendfrom(account, address, value) as sendtoaddress doesn't specify a particular account and the accounts can potentially end up with negative balances.


Title: Re: Bitcoin json-RPC suddenly stopped working
Post by: johny1976 on September 07, 2013, 08:23:10 PM
Thank you,

we alredy repaired the bug...

It is for project 10LTC.com, you can check that out guys ! ;)