Bitcoin Forum
December 07, 2016, 12:51:11 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Request: Set the destination pubkey for bitcoind generation  (Read 1269 times)
darkskiez
Newbie
*
Offline Offline

Activity: 10


View Profile
July 15, 2010, 07:19:57 PM
 #1


I'd like to run some bitcoin daemons unattended, and have them generate the blocks but with a predefined public key, rather than a fresh one, so i don't have to check them manually / transfer coins manually.

I have made do for the moment with a cron job that attempts to send 50 every hour Smiley

1481115071
Hero Member
*
Offline Offline

Posts: 1481115071

View Profile Personal Message (Offline)

Ignore
1481115071
Reply with quote  #2

1481115071
Report to moderator
1481115071
Hero Member
*
Offline Offline

Posts: 1481115071

View Profile Personal Message (Offline)

Ignore
1481115071
Reply with quote  #2

1481115071
Report to moderator
1481115071
Hero Member
*
Offline Offline

Posts: 1481115071

View Profile Personal Message (Offline)

Ignore
1481115071
Reply with quote  #2

1481115071
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
laszlo
Full Member
***
Offline Offline

Activity: 199


View Profile
July 15, 2010, 07:36:17 PM
 #2

The JSON-RPC interface can be used to query the balance and send it. Try something similar to this.. this will also start bitcoind if it's not running already.  You can run this every few hours from cron.

Code:
#!/bin/bash

NICE=/bin/nice
BITCOIN=/home/solar/bitcoin/bitcoind

ADDR=1XPTgDRhN8RFnzniWCddobD9iKZatrvH4
NODE=192.75.207.66

date

${BITCOIN} getbalance 2>&1 | while read balance;
do
  if [ "${balance}" == "0.000000000000000" ];
  then
    echo "zero balance";
  elif [ "${balance}" == "error: couldn't connect to server" ];
  then
    echo "server not running, starting...";
    ${NICE} -n 19 ${BITCOIN} -daemon -addnode=${NODE}
  else
    echo "sending ${balance} BTC to ${ADDR}"
    ${BITCOIN} sendtoaddress ${ADDR} ${balance};
  fi
done

BC: 157fRrqAKrDyGHr1Bx3yDxeMv8Rh45aUet
lachesis
Full Member
***
Offline Offline

Activity: 210


View Profile
July 15, 2010, 08:03:49 PM
 #3

That's not a terrible idea, though. A better low level interface to the generation and transaction spec would be nice.

Bitcoin Calculator | Scallion | GPG Key | WoT Rating | 1QGacAtYA7E8V3BAiM7sgvLg7PZHk5WnYc
laszlo
Full Member
***
Offline Offline

Activity: 199


View Profile
July 15, 2010, 09:49:06 PM
 #4

To extend on this you can connect to the remote host and request a new key before you send, as right now that reuses the same address over and over.

To connect to the remote server and get an address you could set up pubkey auth with ssh and do something like this : ssh solar@eclipse.heliacal.net bitcoin/bitcoind getnewaddress

BC: 157fRrqAKrDyGHr1Bx3yDxeMv8Rh45aUet
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!