Bitcoin Forum
April 24, 2024, 04:59:13 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: [1 BTC BOUNTY] A way to use sendmany  (Read 5126 times)
SgtSpike (OP)
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
June 30, 2011, 07:46:19 AM
 #1

I just want to send BTC to a list of addresses I have.  Really, it's a simple request, and I thought it would have a simple answer, but I can find no simple answer.

bitcoin-php does not have the sendmany function in its library, and I have been unable to successfully add it.  I just don't know enough about json formatting and how to go back and forth between the two.

So, I will pay 1 BTC for a script, preferably in php, but acceptable in python or curl as well, that will allow me to quickly and easily send BTC to a list of addresses and amounts.
1713934753
Hero Member
*
Offline Offline

Posts: 1713934753

View Profile Personal Message (Offline)

Ignore
1713934753
Reply with quote  #2

1713934753
Report to moderator
1713934753
Hero Member
*
Offline Offline

Posts: 1713934753

View Profile Personal Message (Offline)

Ignore
1713934753
Reply with quote  #2

1713934753
Report to moderator
"With e-currency based on cryptographic proof, without the need to trust a third party middleman, money can be secure and transactions effortless." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713934753
Hero Member
*
Offline Offline

Posts: 1713934753

View Profile Personal Message (Offline)

Ignore
1713934753
Reply with quote  #2

1713934753
Report to moderator
1713934753
Hero Member
*
Offline Offline

Posts: 1713934753

View Profile Personal Message (Offline)

Ignore
1713934753
Reply with quote  #2

1713934753
Report to moderator
1713934753
Hero Member
*
Offline Offline

Posts: 1713934753

View Profile Personal Message (Offline)

Ignore
1713934753
Reply with quote  #2

1713934753
Report to moderator
jav
Sr. Member
****
Offline Offline

Activity: 249
Merit: 251


View Profile
June 30, 2011, 08:36:49 AM
 #2

Here is a solution in Python: I usually use the excellent Bitcoin Python Library "authproxy.py" by Jeff Garzik. Here is a version with a few improvements I added: http://pastebin.com/RZNMCGRe . Save this as authproxy.py .

Then you can use this code to use sendmany:

Code:
from authproxy import AuthServiceProxy, JSONRPCException

RPC_URL = "http://rpcuser:rpcpassword@127.0.0.1:8332"

bitcoind = AuthServiceProxy(RPC_URL)

try:
    recipients = { '14Z1mazY4HfysZyMaKudFr63EwHqQT2njz': 50.0
                 , '147dRpRoYQxpf5WGnz7dipCcavtANRRfjt': 50.0
                 }
    bitcoind.sendmany("", recipients)
except JSONRPCException as e:
    print "Error: %s" % e.error['message']

You can try out the above code on an empty wallet. You should get an "account has insufficient funds" error.

If this code is to your satisfaction, I humbly request the bounty to go to this address: 1fYHRKUXnFfj7ZhjwMMNqddjcnkGtq4wA . :-)

Hive, a beautiful wallet with an app platform for Mac OS X, Android and Mobile Web. Translators wanted! iOS and OS X devs see BitcoinKit. Tweets @hivewallet. Donations appreciated at 1HLRg9C1GsfEVH555hgcjzDeas14jen2Cn.
codler
Full Member
***
Offline Offline

Activity: 191
Merit: 100



View Profile
June 30, 2011, 12:27:18 PM
 #3

Isn't it just do like this?

Code:
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>";

SgtSpike (OP)
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
June 30, 2011, 03:44:54 PM
 #4

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!
codler
Full Member
***
Offline Offline

Activity: 191
Merit: 100



View Profile
June 30, 2011, 04:02:29 PM
 #5

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.

SgtSpike (OP)
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
June 30, 2011, 04:16:49 PM
 #6

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.
Sure thing:  http://www.nostate.com/3962/bitcoin-php-a-php-library-for-bitcoin/
error
Hero Member
*****
Offline Offline

Activity: 588
Merit: 500



View Profile
June 30, 2011, 05:14:14 PM
 #7

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!

He's just using jsonRPCclient directly, which should work.

3KzNGwzRZ6SimWuFAgh4TnXzHpruHMZmV8
SgtSpike (OP)
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
June 30, 2011, 05:37:27 PM
 #8

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!

He's just using jsonRPCclient directly, which should work.
Sheesh, is it really that simple?  Well I hope to try it soon.  That would be great if it worked that cleanly.

Does anyone know if there is a practical maximum to the number of addresses I can put in a sendmany request?  I've read a couple of posts about bitcoind locking up around 30 addresses or so, but I'm not sure if that was just an initial bug, or if it still exists and I shouldn't try to send to more than that at the same time.
codler
Full Member
***
Offline Offline

Activity: 191
Merit: 100



View Profile
June 30, 2011, 05:49:06 PM
 #9

Add this method in BitcoinClient class, I haven't tested but it should be like this.

Code:
  /**
   * 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);
  }

SgtSpike (OP)
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
June 30, 2011, 05:51:11 PM
 #10

Provided codler's or jav's solution works for me, the bounty has been claimed.  If they both work, I will pay them each half of the bounty, since they are both good solutions.
SgtSpike (OP)
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
July 01, 2011, 05:26:39 AM
 #11

Here is a solution in Python: I usually use the excellent Bitcoin Python Library "authproxy.py" by Jeff Garzik. Here is a version with a few improvements I added: http://pastebin.com/RZNMCGRe . Save this as authproxy.py .

Then you can use this code to use sendmany:

Code:
from authproxy import AuthServiceProxy, JSONRPCException

RPC_URL = "http://rpcuser:rpcpassword@127.0.0.1:8332"

bitcoind = AuthServiceProxy(RPC_URL)

try:
    recipients = { '14Z1mazY4HfysZyMaKudFr63EwHqQT2njz': 50.0
                 , '147dRpRoYQxpf5WGnz7dipCcavtANRRfjt': 50.0
                 }
    bitcoind.sendmany("", recipients)
except JSONRPCException as e:
    print "Error: %s" % e.error['message']

You can try out the above code on an empty wallet. You should get an "account has insufficient funds" error.

If this code is to your satisfaction, I humbly request the bounty to go to this address: 1fYHRKUXnFfj7ZhjwMMNqddjcnkGtq4wA . :-)

Ok, you'll have to forgive me, because I know very little about python except for how to open one from the command line.  Tongue  What do I do with the library file?
SgtSpike (OP)
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
July 01, 2011, 05:49:47 AM
 #12

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.

Code:
( ! ) 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)
codler
Full Member
***
Offline Offline

Activity: 191
Merit: 100



View Profile
July 01, 2011, 08:35:13 AM
 #13

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.

Code:
( ! ) 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.

Code:
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?

SgtSpike (OP)
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
July 01, 2011, 08:42:24 AM
 #14

Sorry - I was excited to have working code, and promptly forgot to send you coins after posting that message.  Just sent them now.  Tongue
codler
Full Member
***
Offline Offline

Activity: 191
Merit: 100



View Profile
July 01, 2011, 08:54:21 AM
 #15

Sorry - I was excited to have working code, and promptly forgot to send you coins after posting that message.  Just sent them now.  Tongue

np, I see you sent now, Thanks!

Do the latest patch work?

SgtSpike (OP)
Legendary
*
Offline Offline

Activity: 1400
Merit: 1005



View Profile
July 01, 2011, 09:00:46 AM
 #16

I haven't had the opportunity to try it yet - in the middle of some operations.  But I'll let you know if it does!
jav
Sr. Member
****
Offline Offline

Activity: 249
Merit: 251


View Profile
July 01, 2011, 09:44:31 AM
 #17

Ok, you'll have to forgive me, because I know very little about python except for how to open one from the command line.  Tongue  What do I do with the library file?

Just put both files in the same directory (so authproxy.py and let's say sendmany.py which has the code that I listed) and then run:
python sendmany.py

Hive, a beautiful wallet with an app platform for Mac OS X, Android and Mobile Web. Translators wanted! iOS and OS X devs see BitcoinKit. Tweets @hivewallet. Donations appreciated at 1HLRg9C1GsfEVH555hgcjzDeas14jen2Cn.
brendio
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500



View Profile
July 10, 2011, 02:16:22 PM
 #18

Thanks jav, token tip sent your way.

I do have a question though. Why could I not get sendmany to work from the Windows command line?

I tried many variations of the following command, formatted according to Gavin's original patch, but each time get an error message, "type mismatch".

Quote
bitcoind.exe sendmany "" '{"1BrendiovuqgHwxTq9QWRGvMHTkp3YSnKF":0.0001,"1TipMEDeqWT1VUmmhH3rmkVrkA4KYRk2C":0.0001}'

I also discovered that with jav methods, I had insufficient funds in my "" account as it had a negative balance. I got around that by creating another account and transferring a heap across to my "", putting it in the black and the newly made account majorly in the red.

jav
Sr. Member
****
Offline Offline

Activity: 249
Merit: 251


View Profile
July 10, 2011, 03:38:35 PM
 #19

Thanks jav, token tip sent your way.

I do have a question though. Why could I not get sendmany to work from the Windows command line?

Quote
bitcoind.exe sendmany "" '{"1BrendiovuqgHwxTq9QWRGvMHTkp3YSnKF":0.0001,"1TipMEDeqWT1VUmmhH3rmkVrkA4KYRk2C":0.0001}'

I never tried this on Windows. Maybe the ' character is interpreted differently there? Have you tried something like this instead?

bitcoind.exe sendmany "" "{\"1BrendiovuqgHwxTq9QWRGvMHTkp3YSnKF\":0.0001,\"1TipMEDeqWT1VUmmhH3rmkVrkA4KYRk2C\":0.0001}"

I also discovered that with jav methods, I had insufficient funds in my "" account as it had a negative balance. I got around that by creating another account and transferring a heap across to my "", putting it in the black and the newly made account majorly in the red.

Not sure how you ended up in this situation in the first place, but I don't think this is specific to the method I described.

Hive, a beautiful wallet with an app platform for Mac OS X, Android and Mobile Web. Translators wanted! iOS and OS X devs see BitcoinKit. Tweets @hivewallet. Donations appreciated at 1HLRg9C1GsfEVH555hgcjzDeas14jen2Cn.
brendio
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500



View Profile
July 11, 2011, 12:34:45 AM
 #20


Quote
bitcoind.exe sendmany "" '{"1BrendiovuqgHwxTq9QWRGvMHTkp3YSnKF":0.0001,"1TipMEDeqWT1VUmmhH3rmkVrkA4KYRk2C":0.0001}'

I never tried this on Windows. Maybe the ' character is interpreted differently there? Have you tried something like this instead?

bitcoind.exe sendmany "" "{\"1BrendiovuqgHwxTq9QWRGvMHTkp3YSnKF\":0.0001,\"1TipMEDeqWT1VUmmhH3rmkVrkA4KYRk2C\":0.0001}"
Genius. Yep, that worked. Just tipped myself Smiley

I also discovered that with jav methods, I had insufficient funds in my "" account as it had a negative balance. I got around that by creating another account and transferring a heap across to my "", putting it in the black and the newly made account majorly in the red.

Not sure how you ended up in this situation in the first place, but I don't think this is specific to the method I described.
I think it has to do with naming my receiving addresses in the client, so they all had positive balances, but then when it sends, it sends from the "" account. I don't think there is a way to send from a particular account in the client.

Agree this is off topic. Just thought it interesting that the sendmany command (and possibly other command line commands) won't put an account into negative territory, whereas the GUI client will.

Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!