From 872eeb6b1b3651a92b15d6c08c7b168a9bf78915 Mon Sep 17 00:00:00 2001 From: Andrey Arapov Date: Thu, 26 Sep 2024 11:56:03 +0200 Subject: [PATCH 1/2] feat(node): add default akash snapshot provider fixes akash-network/support#287 --- charts/akash-node/Chart.yaml | 2 +- charts/akash-node/scripts/init.sh | 10 +++++++++- charts/akash-node/values.yaml | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/charts/akash-node/Chart.yaml b/charts/akash-node/Chart.yaml index af9e38e..106a6f9 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: 11.1.0 +version: 11.1.1 # 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 3c5936b..419996c 100644 --- a/charts/akash-node/scripts/init.sh +++ b/charts/akash-node/scripts/init.sh @@ -40,6 +40,14 @@ else apt -y --no-install-recommends install aria2 lz4 liblz4-tool wget > /dev/null 2>&1 case "$SNAPSHOT_PROVIDER" in + "akash") + SNAPSHOT_URL="https://snapshots.akash.network/akashnet-2/akashnet-2_latest.tar.lz4" + echo "Using default akash blockchain snapshot, $SNAPSHOT_URL" + aria2c --out=snapshot.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 8 -x 8 -k 1M -j 1 "$SNAPSHOT_URL" + lz4 -c -d snapshot.tar.lz4 | tar -x -C "$AKASH_HOME" + rm -rf snapshot.tar.lz4 + ;; + "polkachu") 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" @@ -61,7 +69,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}" + echo "Using 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/data" rm -rf snapshot.tar diff --git a/charts/akash-node/values.yaml b/charts/akash-node/values.yaml index 762fec9..1e61f7e 100644 --- a/charts/akash-node/values.yaml +++ b/charts/akash-node/values.yaml @@ -16,12 +16,12 @@ debug: "false" # Defaults to mainnet akash_node: enabled: true - # snapshot_provider can be : "polkachu" (1Gi), "c29r3" (2Gi), or "autostake" (3Gi) + # snapshot_provider can be : "akash" (3Gi), "polkachu" (1Gi), "c29r3" (2Gi), or "autostake" (3Gi) # Nov/02 2023: disabled polkachu since it is now behind Cloudflare's "Verify you are human" CAPTCHA # Nov/14 2023: autostake snapshot is unavailable, fixed polkachu and set as default, fix "c29r3" snapshot provider # Aprl/14 2024: peers updated and autostake working again - snapshot_provider: "polkachu" + snapshot_provider: "akash" api_enable: false moniker: mynode chainid: akashnet-2 From b2bab161a391ee859d57c7c731e958f0378d170c Mon Sep 17 00:00:00 2001 From: Andrey Arapov Date: Thu, 26 Sep 2024 11:58:18 +0200 Subject: [PATCH 2/2] fix(node/initContainers): remove duplicate port definition to tackle these warnings: $ helm install akash-node ./charts/akash-node -n akash-services W0926 11:56:36.874077 117617 warnings.go:70] spec.template.spec.containers[0].ports[0]: duplicate port definition with spec.template.spec.initContainers[0].ports[0] W0926 11:56:36.874089 117617 warnings.go:70] spec.template.spec.containers[0].ports[1]: duplicate port definition with spec.template.spec.initContainers[0].ports[1] W0926 11:56:36.874094 117617 warnings.go:70] spec.template.spec.containers[0].ports[2]: duplicate port definition with spec.template.spec.initContainers[0].ports[2] W0926 11:56:36.874096 117617 warnings.go:70] spec.template.spec.containers[0].ports[3]: duplicate port definition with spec.template.spec.initContainers[0].ports[3] --- charts/akash-node/templates/statefulset.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/charts/akash-node/templates/statefulset.yaml b/charts/akash-node/templates/statefulset.yaml index 19e4a53..d973aa6 100644 --- a/charts/akash-node/templates/statefulset.yaml +++ b/charts/akash-node/templates/statefulset.yaml @@ -110,15 +110,6 @@ spec: {{- end }} - name: AKASH_API_ENABLE value: "{{ .Values.akash_node.api_enable }}" - ports: - - containerPort: 1317 - name: akashd-api - - containerPort: 9090 - name: akashd-grpc - - containerPort: 26656 - name: akashd-p2p - - containerPort: 26657 - name: akashd-rpc volumeMounts: - name: config mountPath: /config