erigon-pulse/cmd/downloader/recompress.sh
ledgerwatch 156da607e7
More compact representation of huffman trees in the seg files (#3875)
* More compact representation of huffman trees in the seg files

* Update to latest erigon-lib

* recompress

* recompress

* recompress

* uncompress: buf fix

* Update to latest erigon-lib

* Revert default sync mode

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
2022-04-13 16:29:44 +01:00

22 lines
490 B
Bash
Executable File

#!/bin/bash
set -e
dir=$1
files=$(ls $dir/snapshots | grep -v old | grep -v tor | grep seg | sort -n -t$'-' -k1)
for file in $files
do
from=$dir/snapshots/$file
to=$dir/snapshots/$file.new
echo "file: $file"
./build/bin/erigon_old snapshots uncompress $from | ./build/bin/erigon snapshots compress $to --datadir=$dir
a=$(du -h $from | awk '{print $1;}')
b=$(du -h $to | awk '{print $1;}')
echo "size: $a -> $b"
mv $from $from.old
mv $from.new $from
done