From 8757f468ac1b6d9c21d59d7ebb315fcf7beb867f Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Fri, 30 Aug 2024 11:23:43 -0700 Subject: [PATCH] add hash verification --- init.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/init.sh b/init.sh index 40fb5bd..f8bd22f 100755 --- a/init.sh +++ b/init.sh @@ -95,9 +95,12 @@ install_genesis_zetacored() { } restore_snapshot() { - snapshot_link=$($CURL "${ZETACHAIN_SNAPSHOT_METADATA_URL}" | jq -r '.snapshots[0].link') + snapshot=$($CURL "${ZETACHAIN_SNAPSHOT_METADATA_URL}" | jq -r '.snapshots[0]') + snapshot_link=$(echo "$snapshot" | jq -r '.link') + snapshot_md5=$(echo "$snapshot" | jq -r '.checksums.md5') echo "Restoring snapshot from ${snapshot_link}" - dl-pipe "$snapshot_link" | tar x -C $HOME/.zetacored + # https://github.com/zeta-chain/dl-pipe + dl-pipe -hash "md5:${snapshot_md5}" "$snapshot_link" | tar x -C $HOME/.zetacored } cd $HOME