From c6852b8b09393739e66ddf644dc7f5672d5ee6a6 Mon Sep 17 00:00:00 2001 From: 88plug Date: Tue, 14 Nov 2023 01:46:17 -0800 Subject: [PATCH 1/3] Fix polkachu and c29r3 Autostake is down, set default to Polkachu and add support for c29r3 again. (new URL) --- charts/akash-node/Chart.yaml | 2 +- charts/akash-node/scripts/init.sh | 44 ++++++++++++++++++++----------- charts/akash-node/values.yaml | 6 +++-- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/charts/akash-node/Chart.yaml b/charts/akash-node/Chart.yaml index 8ca572f8..e63690a1 100644 --- a/charts/akash-node/Chart.yaml +++ b/charts/akash-node/Chart.yaml @@ -17,7 +17,7 @@ type: application # Versions are expected to follow Semantic Versioning (https://semver.org/) # Major version bit highlights the mainnet release (e.g. mainnet4 = 4.x.x, mainnet5 = 5.x.x, ...) -version: 6.0.6 +version: 6.0.7 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/akash-node/scripts/init.sh b/charts/akash-node/scripts/init.sh index bb12cb85..3294aecb 100644 --- a/charts/akash-node/scripts/init.sh +++ b/charts/akash-node/scripts/init.sh @@ -41,27 +41,39 @@ else case "$SNAPSHOT_PROVIDER" in "polkachu") - SNAPSHOT_URL=$(curl -s https://polkachu.com/tendermint_snapshots/akash | grep tar.lz4 | head -n1 | grep -io 'akashnet-2.*.tar.lz4" | tr -d ">" | tail -1) - echo "Using latest Autostake blockchain snapshot, $SNAP_URL/$SNAP_NAME" - aria2c --out=snapshot_autostake.tar.lz4 --summary-interval 15 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 4 -x 4 -k 1M -j 1 "$SNAP_URL/$SNAP_NAME" - lz4 -c -d snapshot_autostake.tar.lz4 | tar -x -C "$AKASH_HOME" - rm -f snapshot_autostake.tar.lz4 + + "autostake") #Snapshot is not available as of 14/11/2023 + SNAP_URL="http://snapshots.autostake.com/$AKASH_CHAIN_ID/" + SNAP_NAME=$(curl -s "${SNAP_URL}" | egrep -o "$AKASH_CHAIN_ID" | tr -d ">" | tail -1) + aria2c --out=snapshot.tar.lz4 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 16 -x 16 -k 1M -j 1 "${SNAP_URL}${SNAP_NAME}" + lz4 -c -d snapshot.tar.lz4 | tar -x -C "$AKASH_HOME" + rm -rf snapshot.tar.lz4 + ;; + + "c29r3") + SNAP_NAME=$(curl -s https://snapshots.c29r3.xyz/akash/ | egrep -o ">$AKASH_CHAIN_ID.*tar" | tr -d ">") + echo "Using default c29r3.xyz blockchain snapshot, https://snapshots.c29r3.xyz/akash/${SNAP_NAME}" + aria2c --out=snapshot.tar --summary-interval 15 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 4 -x 4 -k 1M -j 1 "https://snapshots.c29r3.xyz/akash/${SNAP_NAME}" + tar -xf snapshot.tar -C "$AKASH_HOME" + rm -rf snapshot.tar ;; *) - SNAPSHOT_URL=$(curl -s https://cosmos-snapshots.s3.filebase.com/akash/pruned/snapshot.json | jq -r .latest) - echo "Using latest Cosmos blockchain snapshot, $SNAPSHOT_URL" - aria2c --out=snapshot.tar.gz --summary-interval 15 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 16 -x 16 -k 1M -j 1 "$SNAPSHOT_URL" - tar -zxvf snapshot.tar.gz - rm -f snapshot.tar.gz + SNAPSHOTS_DIR_URL="https://snapshots.polkachu.com/snapshots/" + USER_AGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" + LATEST=$(curl -s -A "$USER_AGENT" "$SNAPSHOTS_DIR_URL" | grep -oP 'akash/[^<]+\.tar\.lz4' | tail -n1) + SNAPSHOT_URL="https://snapshots.polkachu.com/snapshots/" + aria2c --out=snapshot.tar.lz4 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 16 -x 16 -k 1M -j 1 "${SNAPSHOT_URL}${LATEST}" + lz4 -c -d snapshot.tar.lz4 | tar -x -C "$AKASH_HOME" + rm -rf snapshot.tar.lz4 ;; esac diff --git a/charts/akash-node/values.yaml b/charts/akash-node/values.yaml index 30ade9d9..e110ad27 100644 --- a/charts/akash-node/values.yaml +++ b/charts/akash-node/values.yaml @@ -16,9 +16,11 @@ debug: "false" # Defaults to mainnet akash_node: enabled: true - # snapshot_provider can be either "polkachu" (1Gi), "autostake" (3Gi). Otherwise it'll default to a much larger in size. + # snapshot_provider can be : "polkachu" (1Gi), "c29r3" (2Gi), or "autostake" (3Gi) # Nov/02 2023: disabled polkachu since it is now behind Cloudflare's "Verify you are human" CAPTCHA - snapshot_provider: "autostake" + # Nov/14 2023: autostake snapshot is unavailable, fixed polkachu and set as default, fix "c29r3" snapshot provider + + snapshot_provider: "polkachu" api_enable: false moniker: mynode chainid: akashnet-2 From 8f71fd795c365354b255a03e52271bfe24bec25d Mon Sep 17 00:00:00 2001 From: 88plug Date: Tue, 14 Nov 2023 01:51:07 -0800 Subject: [PATCH 2/3] Normalize aria2c threads --- charts/akash-node/scripts/init.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/akash-node/scripts/init.sh b/charts/akash-node/scripts/init.sh index 3294aecb..05959659 100644 --- a/charts/akash-node/scripts/init.sh +++ b/charts/akash-node/scripts/init.sh @@ -45,7 +45,7 @@ else USER_AGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" LATEST=$(curl -s -A "$USER_AGENT" "$SNAPSHOTS_DIR_URL" | grep -oP 'akash/[^<]+\.tar\.lz4' | tail -n1) SNAPSHOT_URL="https://snapshots.polkachu.com/snapshots/" - aria2c --out=snapshot.tar.lz4 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 16 -x 16 -k 1M -j 1 "${SNAPSHOT_URL}${LATEST}" + aria2c --out=snapshot.tar.lz4 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 8 -x 8 -k 1M -j 1 "${SNAPSHOT_URL}${LATEST}" lz4 -c -d snapshot.tar.lz4 | tar -x -C "$AKASH_HOME" rm -rf snapshot.tar.lz4 ;; @@ -53,7 +53,7 @@ else "autostake") #Snapshot is not available as of 14/11/2023 SNAP_URL="http://snapshots.autostake.com/$AKASH_CHAIN_ID/" SNAP_NAME=$(curl -s "${SNAP_URL}" | egrep -o "$AKASH_CHAIN_ID" | tr -d ">" | tail -1) - aria2c --out=snapshot.tar.lz4 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 16 -x 16 -k 1M -j 1 "${SNAP_URL}${SNAP_NAME}" + aria2c --out=snapshot.tar.lz4 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 8 -x 8 -k 1M -j 1 "${SNAP_URL}${SNAP_NAME}" lz4 -c -d snapshot.tar.lz4 | tar -x -C "$AKASH_HOME" rm -rf snapshot.tar.lz4 ;; @@ -61,7 +61,7 @@ else "c29r3") SNAP_NAME=$(curl -s https://snapshots.c29r3.xyz/akash/ | egrep -o ">$AKASH_CHAIN_ID.*tar" | tr -d ">") echo "Using default c29r3.xyz blockchain snapshot, https://snapshots.c29r3.xyz/akash/${SNAP_NAME}" - aria2c --out=snapshot.tar --summary-interval 15 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 4 -x 4 -k 1M -j 1 "https://snapshots.c29r3.xyz/akash/${SNAP_NAME}" + aria2c --out=snapshot.tar --summary-interval 15 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 8 -x 8 -k 1M -j 1 "https://snapshots.c29r3.xyz/akash/${SNAP_NAME}" tar -xf snapshot.tar -C "$AKASH_HOME" rm -rf snapshot.tar ;; @@ -71,7 +71,7 @@ else USER_AGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" LATEST=$(curl -s -A "$USER_AGENT" "$SNAPSHOTS_DIR_URL" | grep -oP 'akash/[^<]+\.tar\.lz4' | tail -n1) SNAPSHOT_URL="https://snapshots.polkachu.com/snapshots/" - aria2c --out=snapshot.tar.lz4 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 16 -x 16 -k 1M -j 1 "${SNAPSHOT_URL}${LATEST}" + aria2c --out=snapshot.tar.lz4 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 8 -x 8 -k 1M -j 1 "${SNAPSHOT_URL}${LATEST}" lz4 -c -d snapshot.tar.lz4 | tar -x -C "$AKASH_HOME" rm -rf snapshot.tar.lz4 ;; From 79314b01fb7a0f1b14ed18edfb4a6f34c4655004 Mon Sep 17 00:00:00 2001 From: 88plug Date: Wed, 15 Nov 2023 10:38:38 -0800 Subject: [PATCH 3/3] Fix c29r3 extraction point --- charts/akash-node/scripts/init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/akash-node/scripts/init.sh b/charts/akash-node/scripts/init.sh index 05959659..b96b9b04 100644 --- a/charts/akash-node/scripts/init.sh +++ b/charts/akash-node/scripts/init.sh @@ -62,7 +62,7 @@ else SNAP_NAME=$(curl -s https://snapshots.c29r3.xyz/akash/ | egrep -o ">$AKASH_CHAIN_ID.*tar" | tr -d ">") echo "Using default c29r3.xyz blockchain snapshot, https://snapshots.c29r3.xyz/akash/${SNAP_NAME}" aria2c --out=snapshot.tar --summary-interval 15 --check-certificate=false --max-tries=99 --retry-wait=5 --always-resume=true --max-file-not-found=99 --conditional-get=true -s 8 -x 8 -k 1M -j 1 "https://snapshots.c29r3.xyz/akash/${SNAP_NAME}" - tar -xf snapshot.tar -C "$AKASH_HOME" + tar -xf snapshot.tar -C "$AKASH_HOME/data" rm -rf snapshot.tar ;;