Skip to content

Commit

Permalink
Use JWT from staker tools (#2)
Browse files Browse the repository at this point in the history
* Use JWT from staker tools

* Remove global envs
  • Loading branch information
dappnodedev authored Aug 8, 2024
1 parent 4d18044 commit e215dac
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 22 deletions.
3 changes: 1 addition & 2 deletions beacon-chain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ARG DATA_DIR
ARG P2P_TCP_PORT
ARG P2P_UDP_PORT

ENV JWT_FILE_PATH=/jwtsecret \
ENV JWT_FILE_PATH=/jwtsecret.hex \
BEACON_API_PORT=3500 \
P2P_TCP_PORT=${P2P_TCP_PORT} \
P2P_UDP_PORT=${P2P_UDP_PORT} \
Expand All @@ -35,7 +35,6 @@ ENV JWT_FILE_PATH=/jwtsecret \
LUKSO_CHAIN_CONFIG_FILE_PATH=${LUKSO_CONFIG_PATH}/config.yaml \
STAKER_SCRIPTS_URL=https://github.com/dappnode/staker-package-scripts/releases/download/${STAKER_SCRIPTS_VERSION}

COPY jwtsecret.hex ${JWT_FILE_PATH}
COPY entrypoint.sh /usr/local/bin/entrypoint.sh

ADD ${STAKER_SCRIPTS_URL}/consensus_tools.sh /etc/profile.d/
Expand Down
6 changes: 4 additions & 2 deletions beacon-chain/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/bin/sh

SUPPORTED_NETWORKS="sepolia lukso holesky mainnet"
CHECKPOINT_SYNC_FLAG_KEY_1="--checkpoint-sync-url"
CHECKPOINT_SYNC_FLAG_KEY_2="--genesis-beacon-api-url"
MEVBOOST_FLAG_KEY="--http-mev-relay"

# shellcheck disable=SC1091 # Path is relative to the Dockerfile
. /etc/profile.d/consensus_tools.sh

ENGINE_URL=$(get_engine_api_url "${NETWORK}" "${SUPPORTED_NETWORKS}")
ENGINE_URL="http://execution.${NETWORK}.staker.dappnode:8551"
VALID_FEE_RECIPIENT=$(get_valid_fee_recipient "${FEE_RECIPIENT}")
MEVBOOST_FLAG=$(get_mevboost_flag "${NETWORK}" "${MEVBOOST_FLAG_KEY}")

JWT_SECRET=$(get_jwt_secret_by_network "${NETWORK}")
echo "${JWT_SECRET}" >"${JWT_FILE_PATH}"

# To avoid failure for users who have added fee recipient to extra opts
EXTRA_OPTS=$(add_flag_to_extra_opts_safely "${EXTRA_OPTS}" "--suggested-fee-recipient=${VALID_FEE_RECIPIENT}")

Expand Down
1 change: 0 additions & 1 deletion beacon-chain/jwtsecret.hex

This file was deleted.

6 changes: 1 addition & 5 deletions package_variants/holesky/dappnode_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@
"docs": "https://docs.prylabs.network/docs/getting-started"
},
"globalEnvs": [
{
"envs": ["EXECUTION_CLIENT_HOLESKY", "MEVBOOST_HOLESKY"],
"services": ["beacon-chain"]
},
{
"envs": ["MEVBOOST_HOLESKY"],
"services": ["validator"]
"services": ["validator", "beacon-chain"]
}
]
}
8 changes: 1 addition & 7 deletions package_variants/lukso/dappnode_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,5 @@
"homepage": "https://prysmaticlabs.com/",
"readme": "https://github.com/dappnode/DAppNodePackage-prysm-generic",
"docs": "https://docs.prylabs.network/docs/getting-started"
},
"globalEnvs": [
{
"envs": ["EXECUTION_CLIENT_LUKSO"],
"services": ["beacon-chain"]
}
]
}
}
6 changes: 1 addition & 5 deletions package_variants/mainnet/dappnode_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@
"docs": "https://docs.prylabs.network/docs/getting-started"
},
"globalEnvs": [
{
"envs": ["EXECUTION_CLIENT_MAINNET", "MEVBOOST_MAINNET"],
"services": ["beacon-chain"]
},
{
"envs": ["MEVBOOST_MAINNET"],
"services": ["validator"]
"services": ["validator", "beacon-chain"]
}
]
}

0 comments on commit e215dac

Please sign in to comment.