From 15b865ebed6467756034b2126ddff282d42ea722 Mon Sep 17 00:00:00 2001 From: Tropicar Date: Fri, 9 Dec 2022 16:04:13 +0100 Subject: [PATCH 1/2] remove duplicated entrypoint --- entrypoint.sh | 84 --------------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index 30880d9..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh - -case "$_DAPPNODE_GLOBAL_CONSENSUS_CLIENT_MAINNET" in -"prysm.dnp.dappnode.eth") - echo "Using prysm.dnp.dappnode.eth" - JWT_PATH="/security/prysm/jwtsecret.hex" - ;; -"lighthouse.dnp.dappnode.eth") - echo "Using lighthouse.dnp.dappnode.eth" - JWT_PATH="/security/lighthouse/jwtsecret.hex" - ;; -"teku.dnp.dappnode.eth") - echo "Using teku.dnp.dappnode.eth" - JWT_PATH="/security/teku/jwtsecret.hex" - ;; -"nimbus.dnp.dappnode.eth") - echo "Using nimbus.dnp.dappnode.eth" - JWT_PATH="/security/nimbus/jwtsecret.hex" - ;; -*) - echo "Using default" - JWT_PATH="/security/default/jwtsecret.hex" - ;; -esac - -# Print the jwt to the dappmanager -JWT=$(cat $JWT_PATH) -curl -X POST "http://my.dappnode/data-send?key=jwt&data=${JWT}" - -##################### -# Datadir migration # -##################### -# UPSTREAM: 2021.08.03 -# DAPPNODE: v0.1.7 to v0.1.8 -# Datadir migration must be done manually according to https://github.com/ledgerwatch/erigon/releases/tag/v2021.08.03 - -PORT="${P2P_PORT:=30303}" - -DATADIR="/home/erigon/.local/share" - -if [ -d "$DATADIR/erigon/chaindata" ]; then - mv "$DATADIR/erigon/chaindata" "$DATADIR" -fi - -############################ -# Check database migration # -############################ -# UPSTREAM: v2022.04.01 -# DAPPNODE: v0.1.22 to v0.1.23 - -## Run for 5 secs to check the logs if we found: -## [EROR] [06-27|17:36:39.664] Erigon startup err="migrator.VerifyVersion: cannot upgrade major DB version for more than 1 version from 3 to 6, use integration tool if you know what you are doing" -## We need to re-sync - -timeout -s 9 5 erigon --datadir=/home/erigon/.local/share ${EXTRA_OPTs} 2>/tmp/initlog.txt -if grep -e "migrator.VerifyVersion: cannot upgrade major DB version for more than 1 version from 3 to 6, use integration tool if you know what you are doing" /tmp/initlog.txt; then - echo "Cannot upgrade major DB version for more than 1 version from 3 to 6" - echo "The database will be deleted as it needs to be resynchronized..." - rm /home/erigon/.local/share/chaindata/* -fi - -########## -# Erigon # -########## - -exec erigon --datadir=${DATADIR} \ - --http.addr=0.0.0.0 \ - --http.vhosts=* \ - --http.corsdomain=* \ - --ws \ - --private.api.addr=0.0.0.0:9090 \ - --metrics \ - --metrics.addr=0.0.0.0 \ - --metrics.port=6060 \ - --pprof \ - --pprof.addr=0.0.0.0 \ - --pprof.port=6061 \ - --port=${P2P_PORT} \ - --authrpc.jwtsecret=${JWT_PATH} \ - --authrpc.addr 0.0.0.0 \ - --authrpc.vhosts=* \ - ${EXTRA_OPTs} - -# --engine.port=8551 \ From 498a3b820b3a1185c35fb8dcac6afdab43a12362 Mon Sep 17 00:00:00 2001 From: Tropicar Date: Fri, 9 Dec 2022 16:04:39 +0100 Subject: [PATCH 2/2] Change entrypoint path --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 41f2ea8..e69287e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ FROM thorax/erigon:${UPSTREAM_VERSION} USER root COPY /security /security -COPY entrypoint.sh /usr/local/bin/entrypoint.sh +COPY /erigon/entrypoint.sh /usr/local/bin/entrypoint.sh RUN chmod u+x /usr/local/bin/entrypoint.sh ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]