Skip to content

Instantly share code, notes, and snippets.

@jonasbits
Created October 20, 2013 22:58
Show Gist options
  • Save jonasbits/7076395 to your computer and use it in GitHub Desktop.
Save jonasbits/7076395 to your computer and use it in GitHub Desktop.
bitcoin-qt bash script to make bootstrap.dat of all the blocks, and check that the client is shutdown, if that matters
#! /bin/bash
echo $PWD
if ps aux | grep -q "[b]itcoin" ; then
echo "bitcoin is running, shut it down before running this script again"
ps aux | grep "[b]itcoin"
exit
fi
for i in blk*.dat
do
sec="$(date +%S)"
echo $i ">>" "bootstrap.dat" $sec
cat $i >> bootstrap.dat
done
@jonasbits
Copy link
Author

as pointed out on IRC, this script does not create a exact duplica of the torrent data of jgarzik. This is because of stale blocks (not included because they waste space), zero-padding (block files are preallocated). The script does work and you can use the file it create, but its not a deterministic copy, meaning its unique to your client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment