Skip to content

Instantly share code, notes, and snippets.

@buzztiaan
Last active February 11, 2018 02:28
Show Gist options
  • Save buzztiaan/fce50252924c38df1e066d39df935165 to your computer and use it in GitHub Desktop.
Save buzztiaan/fce50252924c38df1e066d39df935165 to your computer and use it in GitHub Desktop.
some bitcoin handy things
# import all privkeys
cat FILEWITHALLPRIVKEYS | xargs -I {} ./bitcoin-cli importprivkey {} "" false
# find all addresses in wallet
./bgold-cli listaddressgroupings | grep \"G | cut -b 8- | cut -b -34 > addresses
# import addresses you have (dno why this was needed)
cat addresses | xargs -I {} ./bgold-cli importaddress {} "" false
# greg's 'throw blocks around' oneliner
for hh in {1..495866} ; do echo submitblock > /tmp/block ; ../../bitcoin/src/bitcoin-cli \
-rpcport=12314 getblock `../../bitcoin/src/bitcoin-cli -rpcport=12314 getblockhash $hh` \
false >> /tmp/block ; ./bitcoindiamond-cli -datadir=/home/gmaxwell/storage/.bcd/ \
-stdin < /tmp/block ; echo $hh ; done
# math for mining estimates
hashTime=difficulty * (pow(2.0, 32) / (hashRatepersecond))
blocksPerDay = (24.0 * 3600.0)/hashTime
coinsPerDay = coinsPerBlock*blocksPerDay
# update bans
#!/bin/bash
cd ~/
rm banlist.cli.txt
wget https://people.xiph.org/~greg/banlist.cli.txt
chmod +x banlist.cli.txt
./banlist.cli.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment