Thanks! Very pleasant to deal with, prompt communication, and the code worked flawlessly. Highly recommended. Now I just have to play through the first seven games before I can start on this one I agree, I bought one too. thanks Current-C!
|
|
|
Sorry - I was excited to have working code, and promptly forgot to send you coins after posting that message. Just sent them now. np, I see you sent now, Thanks! Do the latest patch work?
|
|
|
Codler, your first example worked perfectly, thank you! Well, I haven't yet confirmed the receipt of the coins, but it gave me a transaction ID in return, so I am assuming it worked. The integration with bitcoin-php failed though - below are the errors. I'll go ahead and send you your half of the reward since the first solution works, but I would love to have it working and integrated with the existing bitcoin-php package, since that's what my site is built around. So, if you don't mind, take a look at the errors and let me know what you see. If jav replies in a reasonable amount of time with a quick how-to on using his script, he'll get the other half of the bounty. Otherwise, I'll pass that half along to you as well. ( ! ) Notice: Undefined offset: 0 in C:\wamp\www\includes\jsonrpc.php on line 1498 Call Stack # Time Memory Function Location 1 0.0033 368824 {main}( ) ..\sendmany.php:0 2 0.0708 2095928 BitcoinClient->sendmany( ) ..\sendmany.php:19 3 0.0709 2096048 BitcoinClient->query( ) ..\bitcoin.php:750 4 0.0710 2098736 xmlrpc_client->send( ) ..\bitcoin.php:378 5 0.0710 2098768 xmlrpc_client->sendPayloadHTTP10( ) ..\xmlrpc.php:1223 6 0.0710 2098768 jsonrpcmsg->createPayload( ) ..\xmlrpc.php:1244 7 0.0712 2099040 serialize_jsonrpcval( ) ..\jsonrpc.php:953
( ! ) Warning: reset() expects parameter 1 to be array, null given in C:\wamp\www\includes\jsonrpc.php on line 1443 Call Stack # Time Memory Function Location 1 0.0033 368824 {main}( ) ..\sendmany.php:0 2 0.0708 2095928 BitcoinClient->sendmany( ) ..\sendmany.php:19 3 0.0709 2096048 BitcoinClient->query( ) ..\bitcoin.php:750 4 0.0710 2098736 xmlrpc_client->send( ) ..\bitcoin.php:378 5 0.0710 2098768 xmlrpc_client->sendPayloadHTTP10( ) ..\xmlrpc.php:1223 6 0.0710 2098768 jsonrpcmsg->createPayload( ) ..\xmlrpc.php:1244 7 0.0712 2099040 serialize_jsonrpcval( ) ..\jsonrpc.php:953 8 0.0717 2099712 serialize_jsonrpcval( ) ..\jsonrpc.php:1498 9 0.0717 2100056 reset ( ) ..\jsonrpc.php:1443
( ! ) Warning: Variable passed to each() is not an array or object in C:\wamp\www\includes\jsonrpc.php on line 1444 Call Stack # Time Memory Function Location 1 0.0033 368824 {main}( ) ..\sendmany.php:0 2 0.0708 2095928 BitcoinClient->sendmany( ) ..\sendmany.php:19 3 0.0709 2096048 BitcoinClient->query( ) ..\bitcoin.php:750 4 0.0710 2098736 xmlrpc_client->send( ) ..\bitcoin.php:378 5 0.0710 2098768 xmlrpc_client->sendPayloadHTTP10( ) ..\xmlrpc.php:1223 6 0.0710 2098768 jsonrpcmsg->createPayload( ) ..\xmlrpc.php:1244 7 0.0712 2099040 serialize_jsonrpcval( ) ..\jsonrpc.php:953 8 0.0717 2099712 serialize_jsonrpcval( ) ..\jsonrpc.php:1498 9 0.0719 2100056 each ( ) ..\jsonrpc.php:1444
( ! ) Notice: Undefined offset: 1 in C:\wamp\www\includes\jsonrpc.php on line 1498 Call Stack # Time Memory Function Location 1 0.0033 368824 {main}( ) ..\sendmany.php:0 2 0.0708 2095928 BitcoinClient->sendmany( ) ..\sendmany.php:19 3 0.0709 2096048 BitcoinClient->query( ) ..\bitcoin.php:750 4 0.0710 2098736 xmlrpc_client->send( ) ..\bitcoin.php:378 5 0.0710 2098768 xmlrpc_client->sendPayloadHTTP10( ) ..\xmlrpc.php:1223 6 0.0710 2098768 jsonrpcmsg->createPayload( ) ..\xmlrpc.php:1244 7 0.0712 2099040 serialize_jsonrpcval( ) ..\jsonrpc.php:953
( ! ) Warning: reset() expects parameter 1 to be array, null given in C:\wamp\www\includes\jsonrpc.php on line 1443 Call Stack # Time Memory Function Location 1 0.0033 368824 {main}( ) ..\sendmany.php:0 2 0.0708 2095928 BitcoinClient->sendmany( ) ..\sendmany.php:19 3 0.0709 2096048 BitcoinClient->query( ) ..\bitcoin.php:750 4 0.0710 2098736 xmlrpc_client->send( ) ..\bitcoin.php:378 5 0.0710 2098768 xmlrpc_client->sendPayloadHTTP10( ) ..\xmlrpc.php:1223 6 0.0710 2098768 jsonrpcmsg->createPayload( ) ..\xmlrpc.php:1244 7 0.0712 2099040 serialize_jsonrpcval( ) ..\jsonrpc.php:953 8 0.0721 2099888 serialize_jsonrpcval( ) ..\jsonrpc.php:1498 9 0.0722 2100144 reset ( ) ..\jsonrpc.php:1443
( ! ) Warning: Variable passed to each() is not an array or object in C:\wamp\www\includes\jsonrpc.php on line 1444 Call Stack # Time Memory Function Location 1 0.0033 368824 {main}( ) ..\sendmany.php:0 2 0.0708 2095928 BitcoinClient->sendmany( ) ..\sendmany.php:19 3 0.0709 2096048 BitcoinClient->query( ) ..\bitcoin.php:750 4 0.0710 2098736 xmlrpc_client->send( ) ..\bitcoin.php:378 5 0.0710 2098768 xmlrpc_client->sendPayloadHTTP10( ) ..\xmlrpc.php:1223 6 0.0710 2098768 jsonrpcmsg->createPayload( ) ..\xmlrpc.php:1244 7 0.0712 2099040 serialize_jsonrpcval( ) ..\jsonrpc.php:953 8 0.0721 2099888 serialize_jsonrpcval( ) ..\jsonrpc.php:1498 9 0.0723 2100144 each ( ) ..\jsonrpc.php:1444 Caught exception: Didn't receive 200 OK from remote server. (HTTP/1.1 500 Internal Server Error) Add this code to this line. https://github.com/mikegogulski/bitcoin-php/blob/5d425e1de01b2e6b0e08e897a39c5f973ea7ce3e/src/includes/jsonrpc.inc#L1491 Remember ADD not replace. if (array_keys($val) !== range(0, count($val) - 1)) { foreach($val as $key2 => $val2) { $rs .= ',"'.json_encode_entities($key2, null, $charset_encoding).'":'; $rs .= serialize_jsonrpcval($val2, $charset_encoding); } $rs = '{' . substr($rs, 1) . '}'; break; } I have not received any coins yet. What address did you send to?
|
|
|
Add this method in BitcoinClient class, I haven't tested but it should be like this. /** * Returns Transaction id (txid) * * @param string $fromAccount Account to send from * @param array $sendTo Key=address Value=amount * @param integer $minconf * @param string $comment * @return string Hexadecimal transaction ID on success. * @throws BitcoinClientException * @since 0.3.21 * @author codler<github> */ public function sendmany($fromAccount, $sendTo, $minconf = 1, $comment=NULL) { if (!$fromAccount || empty($fromAccount)) throw new BitcoinClientException("sendmany requires an account"); if (!is_numeric($minconf) || $minconf < 0) throw new BitcoinClientException('sendmany requires a numeric minconf >= 0'); if (!$comment) return $this->query("sendmany", $fromAccount, $sendTo, $minconf); return $this->query("sendmany", $fromAccount, $sendTo, $minconf, $comment); }
|
|
|
Thanks jav. I can't give that a try right at the moment (will have to wait about 12 hours before I get home and can try it), but hopefully that will work. If it does, I'll send you your 1 BTC.
Codler, I wish, but there is no sendmany function built in to bitcoin-php. The project was abandoned a couple of months back because the dev didn't have time to update it, and that was before sendmany was built in as an rpc command.
Unless, you have some php files I don't have... in which case, let me know where you got them!
I don't know what bitcoin-php is. Could you link bitcoin-php? Maybe I can implement it.
|
|
|
Selling google plus invites for 0.1BTC
send to 19H9hk9LgALN41msp67LYysLLyYN23q7Y4 and PM me your email
|
|
|
Selling google plus invites for 0.1BTC
send to 19H9hk9LgALN41msp67LYysLLyYN23q7Y4 and PM me your email
|
|
|
Selling google plus invites for 0.1BTC
send to 19H9hk9LgALN41msp67LYysLLyYN23q7Y4 and PM me your email
|
|
|
Selling google plus invites for 0.1BTC
send to 19H9hk9LgALN41msp67LYysLLyYN23q7Y4 and PM me your email, you need to have a google profile.
|
|
|
Isn't it just do like this? require_once 'jsonRPCClient.php'; $bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/'); $fromAccount = ""; // {address:amount,...} $sendTo = array( '1NRo5XtmfDWfwiN2fY9A7kj9rs1rx3jJok' => 1, '19u9uMbEdCRTyrLszCEiJCAzNJURUTaS4T' => 1, );
echo "<pre>\n"; echo "txid: ".$bitcoin->sendmany($fromAccount, $sendTo)."\n"; echo "</pre>";
|
|
|
You can get fee bitcoins from the following sites : https://freebitcoins.appspot.com/ (free 0.001 BTC or something atm) http://www.freebitcoins.org/1771 (you have to complete offers to get rewarded, or just refer friends, not every country is supported atm though - this is a ref link, you don't have to sue it) occasionally you'll see contests here on the forum, or generous donations by people to get some starter coins where do the bitcoins come from freebitcoins?
|
|
|
THIS OFFER IS NOW CLOSED. (but feel free to keep making free short links ) An ability to edit your shortlink to another address would be a very welcomed feature. thanks for the suggestion. that would require members to remember a password, and possibly input an email address for password reset, making the whole website a whole lot more complicated. it was designed just to be simple input address+username and you're done if you really need to change your address, send me a PM here and i'll do it manually on a case-by-case basis... or just think up a new username that you like and create a new short link. If you change, I suggest it that it will say on the page a date and that it have changed, in case it was someone else who wanted to change so the creator knows.
|
|
|
1NRo5XtmfDWfwiN2fY9A7kj9rs1rx3jJok
Thanks
|
|
|
Den e ju inte på svenska
|
|
|
|