Title: [1 BTC BOUNTY] Did the JSON-RPC commands change? Post by: SgtSpike on November 18, 2012, 01:02:43 AM Just curious - did the JSON commands change between version 0.3 and 0.7? I tried using sendmany with the same code I used on 0.3, but it doesn't work in 0.7. I haven't rolled back to 0.3 to try it again (is there a legitimate place to download 0.3 from still?), but I haven't changed any of the code since the last time I used it on 0.3 either.
" Warning: fopen(http://...@127.0.0.1:8332/) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\wamp\www\includes\jsonRPCClient.php on line 132" Offering 1 BTC bounty to whomever solves my problem here. Title: Re: Did the JSON-RPC commands change? Post by: jgarzik on November 18, 2012, 01:38:02 AM Just curious - did the JSON commands change between version 0.3 and 0.7? I tried using sendmany with the same code I used on 0.3, but it doesn't work in 0.7. I haven't rolled back to 0.3 to try it again (is there a legitimate place to download 0.3 from still?), but I haven't changed any of the code since the last time I used it on 0.3 either. " Warning: fopen(http://...@127.0.0.1:8332/) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\wamp\www\includes\jsonRPCClient.php on line 132" 'sendmany' should be unchanged, AFAIK. Want to post a debug.log snippet? Title: Re: Did the JSON-RPC commands change? Post by: SgtSpike on November 18, 2012, 02:06:50 AM Just curious - did the JSON commands change between version 0.3 and 0.7? I tried using sendmany with the same code I used on 0.3, but it doesn't work in 0.7. I haven't rolled back to 0.3 to try it again (is there a legitimate place to download 0.3 from still?), but I haven't changed any of the code since the last time I used it on 0.3 either. " Warning: fopen(http://...@127.0.0.1:8332/) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in C:\wamp\www\includes\jsonRPCClient.php on line 132" 'sendmany' should be unchanged, AFAIK. Want to post a debug.log snippet? Title: Re: Did the JSON-RPC commands change? Post by: SgtSpike on November 19, 2012, 06:54:36 AM I found this much...
Code: ... Neither of the x.x.x.x was my local or external IP, and the code I am attempting to run is being executed on the local machine with the bitcoin client on it. EDIT: Now offering a 1 BTC bounty for whoever comes up with a solution to my problem. Title: Re: [1 BTC BOUNTY] Did the JSON-RPC commands change? Post by: SgtSpike on November 19, 2012, 07:27:10 AM It seems your php can't connect to your bitcoind, make sure you have set the correct allowip in the bitcoin.conf. Also if your using a shared hosting server for the php, fopen could be blocked, at that time I can sell you a curl version of JSONclient that I wrote. That's what I am gathering. I can't figure out why though, because the getinfo command I send right before the sendmany command works just fine. The HTTP server running the PHP code and the bitcoind server run on the same local machine. Nothing is hosted outside of my house in this situation - it's all local.I caught this exception as well: Code: Caught exception: Unable to connect to http://secret:mypassword@127.0.0.1:8332/ So why can it connect with the secret:password combo to utilize the getinfo() command but not use the same connection to do sendmany? EDIT: Here's the relevant code for the connection and getinfo (which, again, is working fine). Code: $bitcoin = new jsonRPCClient('http://secret:mypassword@127.0.0.1:8332/'); Title: Re: [1 BTC BOUNTY] Did the JSON-RPC commands change? Post by: SgtSpike on November 19, 2012, 07:37:44 AM It seems your php can't connect to your bitcoind, make sure you have set the correct allowip in the bitcoin.conf. Also if your using a shared hosting server for the php, fopen could be blocked, at that time I can sell you a curl version of JSONclient that I wrote. That's what I am gathering. I can't figure out why though, because the getinfo command I send right before the sendmany command works just fine. The HTTP server running the PHP code and the bitcoind server run on the same local machine. Nothing is hosted outside of my house in this situation - it's all local.I caught this exception as well: Code: Caught exception: Unable to connect to http://secret:mypassword@127.0.0.1:8332/ So why can it connect with the secret:password combo to utilize the getinfo() command but not use the same connection to do sendmany? EDIT: Here's the relevant code for the connection and getinfo (which, again, is working fine). Code: $bitcoin = new jsonRPCClient('http://secret:mypassword@127.0.0.1:8332/'); I got it you updated to 0.7.1 you probably encrypted your wallet, so you have to unlock it then use the sendmany command then lock it again. Title: Re: [1 BTC BOUNTY] Did the JSON-RPC commands change? Post by: SgtSpike on November 19, 2012, 07:50:47 AM it sounds like an fopen issue, try this version it is the cURL version I wrote, it works the same exact way as jsonRPCClient just uses curl instead of fopen Hmmm... I don't really know json, or jsonRPC at all. I use a bitcoin.php and jsonRPCClient.php file to run my code though. Json greatly confuses me for some reason.http://pastebin.com/UfrgfpAi Can you give an example of how to use your code if I have an array of addresses and amounts? Here's the array: Code: Array ( [18TKNbSLTrd3a2W8mtoH5uNzFhWRWNcuHU] => 0.00000800 [1JTZHBdrDnFaVvuV43sd2oiwDmzUPfa3Ws] => 0.00000100 ) 1 Not sure what the 1 at the end is... didn't notice that before. Could that potentially be causing problems? I just did a print_r of the array to get that output. Title: Re: [1 BTC BOUNTY] Did the JSON-RPC commands change? Post by: SgtSpike on November 19, 2012, 07:58:57 AM All you have to do is replace the file named "jsonRPCClient.php" with mine and use it the same way you been using it. Ok, I'll give that a try.Are you passing an account? Code: $client->sendmany("", array("18TKNbSLTrd3a2W8mtoH5uNzFhWRWNcuHU" => 0.00000800,"1JTZHBdrDnFaVvuV43sd2oiwDmzUPfa3Ws" => 0.00000100)); Account is blank. "", as you have written. Title: Re: [1 BTC BOUNTY] Did the JSON-RPC commands change? Post by: SgtSpike on November 19, 2012, 08:00:43 AM Code: Fatal error: Call to undefined function curl_init() in C:\wamp\www\includes\jsonRPCClient.php on line 126 Title: Re: [1 BTC BOUNTY] Did the JSON-RPC commands change? Post by: SgtSpike on November 19, 2012, 08:10:01 AM Code: Fatal error: Call to undefined function curl_init() in C:\wamp\www\includes\jsonRPCClient.php on line 126 that means curl isn't in your php build, switch back to the fopen version Title: Re: [1 BTC BOUNTY] Did the JSON-RPC commands change? Post by: SgtSpike on November 19, 2012, 08:15:32 AM Ok, so I figured I'd post the entire code from the php page I am using (sanitized). Basically, it finds bitcoin sends in the forum of [btcaddress, amount] out of the text pasted in the text area and creates a sendmany array with all of them found.
Following the first code block is the getinfo() output. Code: <? Output of getinfo(): Code: Array Title: Re: [1 BTC BOUNTY] Did the JSON-RPC commands change? Post by: SgtSpike on November 19, 2012, 08:32:11 AM The only thing I can think of is to wrap the amount in the method floatval(); GENIUS! Ok, not really, but you did think of something to try that I did not! ;)Where do I send the 1 BTC? EDIT: I'll send to your donation address since it's convenient. Title: Re: [1 BTC BOUNTY] Did the JSON-RPC commands change? Post by: ingrownpocket on November 19, 2012, 09:01:11 AM Damn... Too late...
I had the same problem. |