nochowderforyou/clams — pull request #69 by dooglus (2014-11-26 12:45:43+00:00)
Title: track digging and staking totals

Example:

$ clamd getblockhash 222222
50d2a1977aef7cdc549962306238fd9de3249852ae4a966d578cf557f38ac111

$ clamd getblock 50d2a1977aef7cdc549962306238fd9de3249852ae4a966d578cf557f38ac111 | grep -e supply -e height
"height" : 222222,
"moneysupply" : 14892274.13048927,
"digsupply" : 90336.01434010,
"stakesupply" : 117872.72641731,
"activesupply" : 208208.74075741,

$ clamd getinfo | grep -e supply -e blocks
"blocks" : 225563,
"moneysupply" : 14895615.13048927,
"digsupply" : 101135.80805040,
"stakesupply" : 121213.72641731,
"activesupply" : 222349.53446771,

This won't work until the blockchain is rescanned, and we don't have a -reindex command line option for some reason.

The best way I found of doing it is to dump a bootstrap.dat, delete the blockindex, and restart:

cd ~/.clam/
clamd dumpbootstrap ~/.clam $(clamd getblockcount)
clamd stop
/bin/rm -fr debug.log database/ db.log txleveldb
clamd

but really we should get a -reindex command before merging this.