Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: lachesis on June 07, 2010, 04:05:18 PM



Title: Performance Counter Patch and RPC extensions
Post by: lachesis on June 07, 2010, 04:05:18 PM
After an IRC session, I modified laszlo's bitcoin performance patch to be slightly faster and cleaner. I also added two rpc calls: listgenerated which just lists the strings from the UI of any generated blocks (nice for headless bitcoin mining servers) and gethps which returns the performance count in RPC. I also added gethps to the end of getinfo. Finally, I fixed GCC's issue with optimizations and htons in net.h.

I've mentioned all of these patches elsewhere, but laszlo suggested that I compile them into one patch and post it. Here's that patch:
http://www.alloscomp.com/bitcoin/bitcoin-svn-80-combined-2010-06-07.patch
http://www.alloscomp.com/bitcoin/bitcoin-svn-81-combined-2010-06-11.patch
^ Updated for r81.
Check out http://www.alloscomp.com/bitcoin. The latest version is there.

Enjoy!


Title: Re: Performance Counter Patch and RPC extensions
Post by: lachesis on June 10, 2010, 02:34:57 PM
Here's a little python program I wrote that checks to see if you have a bitcoin balance and, if so, sends it to a stored address. I use it with a cron job on my headless Bitcoin generating box to keep my main wallet fed with coins.

Code:
#!/usr/bin/python
import subprocess,sys
MyBCAddress = 'PUT YOUR BITCOIN ADDRESS HERE'

p = subprocess.Popen(['bitcoin','getbalance'],stdout=subprocess.PIPE)
out,err = p.communicate()

out = out.strip()

try:
    bal = float(out)
except ValueError:
    sys.exit(1)

if bal > 0.01:
    print "We have a balance of {0:.2f}BC. Sending...".format(bal)
    p = subprocess.Popen(['bitcoin','sendtoaddress',MyBCAddress,str(bal)],stdout=subprocess.PIPE)
    out,err = p.communicate()
    print out
else:
    print "No coins here."


Title: Re: Performance Counter Patch and RPC extensions
Post by: llama on August 04, 2010, 12:21:38 AM
Nice work ;)  You don't love it till you miss it.