A website and sync script for prunednode.today.
- download and install latest bitcoin core from bitcoincore.org
- copy bitcoin.conf to your
~/.bitcoinfolder (create if not present) - it is set up to useprune=550flag. - start
bitcoind --daemonand wait for full sync - install
nginxand copy content of thehtmlfolder to/var/www/html/ - create the first snapshot (see below)
- adjust
index.html- update the author, url to
Add the following lines to the server block of nginx, so latest.zip and latest.signed.txt redirect to the latest snapshot:
server{
# ...
rewrite ^/latest.zip$ /snapshot221003.zip redirect;
rewrite ^/latest.signed.txt$ /snapshot221003.signed.txt redirect;
# ...
}
You will need to update it every time you create a new snapshot and reload nginx (nginx -s reload)
- Run
zipit.shscript, it will:- stop bitcoind and wait for 1 minute
- copy bitcoin files to a separate folder
- start bitcoind again to continue syncing
- zip the content of the folder to a
snapshot<date>.zip - create a
snapshot<date>.txtwith sha256 of the file - move it to the
/var/www/html/folder
- Sign the
snapshot<date>.txtwith your pgp key usinggpg --output snapshot<date>.signed.txt --clearsign snapshot<date>.txtand place it next to the snapshot zip file - Update:
- nginx config file to use new snapshot for redirects
/var/www/html/latest.txtso it contains the name of the latest snapshot zip file/var/www/html/index.htmlso it has correct date in the description
It is not necessary to run the node on the same machine where the snapshots are hosted, you can always create a snapshot on another machine and rsync files to the host.