2022-03-21 04:22:37 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-03-21 06:40:35 +00:00
|
|
|
datadir=$1
|
|
|
|
network=$2
|
2022-03-21 04:22:37 +00:00
|
|
|
|
2022-03-21 06:40:35 +00:00
|
|
|
#git reset --hard
|
|
|
|
#git checkout devel
|
|
|
|
#git pull
|
|
|
|
|
|
|
|
# clean
|
|
|
|
cd ./../erigon-snapshot
|
2022-03-21 04:22:37 +00:00
|
|
|
git reset --hard
|
|
|
|
git pull
|
2022-03-21 06:40:35 +00:00
|
|
|
cd ../erigon
|
|
|
|
|
2022-03-21 04:22:37 +00:00
|
|
|
# it will return only .seg of 500K (because Erigon send to Downloader only such files)
|
2022-03-28 07:44:11 +00:00
|
|
|
go run -trimpath ./cmd/downloader torrent_hashes --datadir="$datadir" --targetfile=./../erigon-snapshot/"$network".toml
|
2022-03-21 06:40:35 +00:00
|
|
|
cd ./../erigon-snapshot
|
2022-03-21 04:22:37 +00:00
|
|
|
git add "$network".toml
|
2022-03-21 06:40:35 +00:00
|
|
|
git commit -m "ci: $network"
|
2022-03-21 04:22:37 +00:00
|
|
|
git push
|
2022-03-21 06:40:35 +00:00
|
|
|
|
2022-03-21 04:22:37 +00:00
|
|
|
# update Erigon submodule
|
|
|
|
cd ./../erigon
|
|
|
|
cd turbo/snapshotsync/snapshothashes/erigon-snapshots
|
|
|
|
git checkout main
|
|
|
|
git pull
|
|
|
|
cd ../../../../
|
|
|
|
git add turbo/snapshotsync/snapshothashes/erigon-snapshots
|
2022-03-21 06:40:35 +00:00
|
|
|
git commit -m "ci: $network snapshots"
|
2022-03-21 04:22:37 +00:00
|
|
|
git push
|