Created
September 17, 2020 09:18
-
-
Save jsarenik/b4cef9c671db7ed550e274f4af95a0f9 to your computer and use it in GitHub Desktop.
Script that makes torrent files for bitcoin blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BLD=$HOME/.bitcoin/blocks | |
OUT=$HOME/bitcoin-torrent-out | |
WH=$HOME/bitcoin-torrent | |
procdir() { | |
test -n "$1" || return 1 | |
newdir=${part} | |
ls $* >/dev/null 2>&1 \ | |
&& { | |
mkdir "$WH/${part}" && ln $* "$WH/${part}" | |
} | |
} | |
rm -rf $WH | |
mkdir $WH | |
cd $BLD | |
# the three 999 creates bunches of 15 GB, 9999 bunches of ~1.5 GB | |
for part in $(seq -w 0 999) | |
do | |
echo $part | |
procdir ???$part* || break | |
done | |
cd $WH | |
ls -t | sed 1q | xargs rm -rf | |
test -d $OUT || mkdir $OUT | |
for archive in * | |
do | |
FN=$OUT/bitcoin-torrent-$archive.torrent | |
test -r $FN && continue | |
echo "Writing $FN..." | |
ln -s $archive blocks | |
# ctorrent -t -u udp://tracker.leechers-paradise.org:6969/announce -s $FN blocks | |
# -u udp://tracker.opentrackr.org:1337/announce \ | |
#mktorrent -o bitcoin-torrent-$archive.torrent -a udp://tracker.openbittorrent.com:80 -a udp://tracker.leechers-paradise.org:6969 -a udp://tracker.coppersurfer.tk:6969 -a udp://tracker.opentrackr.org:1337 -a udp://explodie.org:6969 -a udp://tracker.empire-js.us:1337 -a wss://tracker.btorrent.xyz blocks | |
#mktorrent -o $FN -a http://a.bublina.eu.org:8000/announce -a udp://a.bublina.eu.org:8000 -a ws://a.bublina.eu.org:8000 blocks | |
#transmission-create -o $FN -t http://a.bublina.eu.org:8000/announce -t udp://a.bublina.eu.org:8000 -t ws://a.bublina.eu.org:8000 -c "blk$archive* and rev$archive* files" blocks | |
webtorrent create -o $FN -a http://a.bublina.eu.org:8000/announce -a udp://a.bublina.eu.org:8000 -a ws://a.bublina.eu.org:8000 --verbose blocks | |
rm blocks | |
done | |
mkdir $WH/index | |
ln $BLD/index/* $WH/index | |
du -hs $WH/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment