Skip to content

Commit

Permalink
Normalize aria2c threads
Browse files Browse the repository at this point in the history
  • Loading branch information
88plug committed Nov 14, 2023
1 parent c6852b8 commit 8f71fd7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions charts/akash-node/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ 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
;;

"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
;;

"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
;;
Expand All @@ -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
;;
Expand Down

0 comments on commit 8f71fd7

Please sign in to comment.