From 661b6c13155d725404ee8528162ce349a432d65b Mon Sep 17 00:00:00 2001 From: squidbear <379651+czarly@users.noreply.github.com> Date: Mon, 31 Mar 2025 09:57:37 +0200 Subject: [PATCH] do it --- viction/scripts/download.node.sh | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 viction/scripts/download.node.sh diff --git a/viction/scripts/download.node.sh b/viction/scripts/download.node.sh new file mode 100644 index 00000000..27b8f6bc --- /dev/null +++ b/viction/scripts/download.node.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Exit on error and show commands +set -ex + +# Verify snapshot URL is provided +if [ -z "$SNAPSHOT_URL" ]; then + echo "Error: SNAPSHOT_URL environment variable not set" + exit 1 +fi + +# Install required tools +apk add --no-cache wget tar zstd + +# Create and prepare directories +mkdir -p /tomochain/data/tomo/chaindata +rm -rf /tomochain/data/tomo/chaindata/* + +# Download and extract chain data +echo "Downloading CHAIN_DATA from ${SNAPSHOT_URL}" +wget -q --show-progress -c "${SNAPSHOT_URL}/CHAIN_DATA.tar.zst" -O - | \ + tar -I zstd -xvf - -C /tomochain/data/tomo/chaindata + +# Create and prepare tomox directory +mkdir -p /tomochain/data/tomox +rm -rf /tomochain/data/tomox/* + +# Download and extract tomox data +echo "Downloading TOMOX_DATA from ${SNAPSHOT_URL}" +wget -q --show-progress -c "${SNAPSHOT_URL}/TOMOX_DATA.tar.zst" -O - | \ + tar -I zstd -xvf - -C /tomochain/data/tomox + +echo "Download and extraction complete"