Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

jonasbits commented Aug 24, 2014

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
You can’t perform that action at this time.