From 12c1d1517b0470c476564f12b9e83f23b1b0c546 Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Tue, 10 Jun 2025 16:23:08 +0530 Subject: [PATCH 01/21] feat: bump rolling shutter version to v1.3.10 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5fa7283..fc8dade 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: context: shutter args: ASSETS_VERSION: shutter-gnosis-1000-set1.3 # $NETWORK-10*$CHAIN_ID-set-$VERSION - UPSTREAM_VERSION: v1.3.6 + UPSTREAM_VERSION: v1.3.10 KEYPER_CONFIG_DIR: /keyper/config SHUTTER_CHAIN_DIR: /chain STAKER_SCRIPTS_VERSION: v0.1.0 From ff7919199fc81a5a1d82515520579a0e58c2c06f Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Tue, 10 Jun 2025 18:25:08 +0530 Subject: [PATCH 02/21] feat: log collection setup via promtail --- docker-compose.yml | 1 + setup-wizard.yml | 12 +++++++++ shutter/promtail_config.yaml | 46 ++++++++++++++++++++++++++++++++ shutter/scripts/run_chain.sh | 8 ++++-- shutter/scripts/run_configure.sh | 9 +++++++ shutter/scripts/run_keyper.sh | 7 ++++- shutter/scripts/run_promtail.sh | 12 +++++++++ shutter/supervisord.conf | 16 +++++++++-- 8 files changed, 106 insertions(+), 5 deletions(-) create mode 100644 shutter/promtail_config.yaml create mode 100644 shutter/scripts/run_configure.sh create mode 100644 shutter/scripts/run_promtail.sh diff --git a/docker-compose.yml b/docker-compose.yml index 5fa7283..7747b08 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,6 +23,7 @@ services: SHUTTER_GNOSIS_NODE_PRIVATEKEY: "" SHUTTER_PUSH_METRICS_ENABLED: false KEYPER_NAME: "" + SHUTTER_PUSH_LOGS_ENABLED: false volumes: - chain:/chain - keyper-config:/keyper/config diff --git a/setup-wizard.yml b/setup-wizard.yml index d134348..ae53853 100644 --- a/setup-wizard.yml +++ b/setup-wizard.yml @@ -21,6 +21,18 @@ fields: required: false secret: true + - id: enable_push_logs + title: Enable Push Logs + description: | + Enable the push logs feature to send logs to an external server controlled by Shutter. + target: + type: environment + name: SHUTTER_PUSH_LOGS_ENABLED + service: [shutter, metrics] + enum: + - "true" + - "false" + - id: enable_push_metrics title: Enable Push Metrics description: | diff --git a/shutter/promtail_config.yaml b/shutter/promtail_config.yaml new file mode 100644 index 0000000..f241855 --- /dev/null +++ b/shutter/promtail_config.yaml @@ -0,0 +1,46 @@ +server: + http_listen_port: 9080 + grpc_listen_port: 0 + +positions: + filename: /tmp/positions.yaml + +client: + url: https://logs.metrics.shutter.network/insert/loki/api/v1/push + basic_auth: + username: ${PUSHGATEWAY_USERNAME} + password: ${PUSHGATEWAY_PASSWORD} + +scrape_configs: + - job_name: configure + pipeline_stages: + - docker: + static_configs: + - targets: + - localhost + labels: + job: configure + host: ${KEYPER_NAME} + __path__: /tmp/configure.log + + - job_name: keyper + pipeline_stages: + - docker: + static_configs: + - targets: + - localhost + labels: + job: keyper + host: ${KEYPER_NAME} + __path__: /tmp/keyper.log + + - job_name: chain + pipeline_stages: + - docker: + static_configs: + - targets: + - localhost + labels: + job: chain + host: ${KEYPER_NAME} + __path__: /tmp/chain.log diff --git a/shutter/scripts/run_chain.sh b/shutter/scripts/run_chain.sh index 3167447..c5e7265 100755 --- a/shutter/scripts/run_chain.sh +++ b/shutter/scripts/run_chain.sh @@ -3,8 +3,12 @@ run_chain() { echo "[INFO | chain] Starting chain..." - - $SHUTTER_BIN chain --config "$SHUTTER_CHAIN_CONFIG_FILE" + if [[ SHUTTER_PUSH_LOGS_ENABLED=true ]]; + then + $SHUTTER_BIN chain --config "$SHUTTER_CHAIN_CONFIG_FILE" |& rotatelogs -n 1 -e -c /tmp/chain.log 5M + else + $SHUTTER_BIN chain --config "$SHUTTER_CHAIN_CONFIG_FILE" + fi } run_chain diff --git a/shutter/scripts/run_configure.sh b/shutter/scripts/run_configure.sh new file mode 100644 index 0000000..484dbf6 --- /dev/null +++ b/shutter/scripts/run_configure.sh @@ -0,0 +1,9 @@ +#!/bin/bash + + +if [[ SHUTTER_PUSH_LOGS_ENABLED=true ]]; +then + configure.sh |& rotatelogs -n 1 -e -c /tmp/configure.log 5M +else + configure.sh +fi diff --git a/shutter/scripts/run_keyper.sh b/shutter/scripts/run_keyper.sh index b6f792c..b6484b0 100755 --- a/shutter/scripts/run_keyper.sh +++ b/shutter/scripts/run_keyper.sh @@ -18,7 +18,12 @@ perform_chain_healthcheck() { } run_keyper() { - $SHUTTER_BIN gnosiskeyper --config "$KEYPER_CONFIG_FILE" + if [[ SHUTTER_PUSH_LOGS_ENABLED=true ]]; + then + $SHUTTER_BIN gnosiskeyper --config "$KEYPER_CONFIG_FILE" |& rotatelogs -n 1 -e -c /tmp/keyper.log 5M + else + $SHUTTER_BIN gnosiskeyper --config "$KEYPER_CONFIG_FILE" + fi } perform_chain_healthcheck diff --git a/shutter/scripts/run_promtail.sh b/shutter/scripts/run_promtail.sh new file mode 100644 index 0000000..f335d42 --- /dev/null +++ b/shutter/scripts/run_promtail.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +run_promtail() { + if [[ $SHUTTER_PUSH_LOGS_ENABLED=true ]]; + then + promtail -config.expand-env=true -log-config-reverse-order -print-config-stderr -config.file /etc/promtail_config.yaml + else + tail -f /dev/null + fi +} + +run_promtail diff --git a/shutter/supervisord.conf b/shutter/supervisord.conf index bfc6ccc..4c6b47c 100644 --- a/shutter/supervisord.conf +++ b/shutter/supervisord.conf @@ -18,7 +18,7 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface serverurl=unix:///var/run/supervisor.sock [program:configure] -command = configure.sh +command = run_configure.sh priority = 1 autostart = true autorestart = false @@ -47,4 +47,16 @@ autorestart = true stdout_logfile = /dev/stdout stdout_logfile_maxbytes = 0 stderr_logfile = /dev/stderr -stderr_logfile_maxbytes = 0 \ No newline at end of file +stderr_logfile_maxbytes = 0 + +[program:promtail] +command = run_promtail.sh ; we ingest 'rotatelogs' managed logfiles -- there is potential for some missed log lines. +priority = 4 +autostart = %(ENV_SHUTTER_PUSH_LOGS_ENABLED)s +startretries = 9999 ; A large number enough to cover node updates +autorestart = %(ENV_SHUTTER_PUSH_LOGS_ENABLED)s +environment = KEYPER_NAME="%(ENV_KEYPER_NAME)s",PUSHGATEWAY_USERNAME="%(ENV_PUSHGATEWAY_USERNAME)s",PUSHGATEWAY_PASSWORD="%(ENV_PUSHGATEWAY_PASSWORD)s",SHUTTER_PUSH_LOGS_ENABLED="%(ENV_SHUTTER_PUSH_LOGS_ENABLED)s" +stdout_logfile = /dev/stdout +stdout_logfile_maxbytes = 0 +stderr_logfile = /dev/stderr +stderr_logfile_maxbytes = 0 From e2d9631251d0e8c6ce86ee02c60b5b97d657131b Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Wed, 11 Jun 2025 16:51:46 +0530 Subject: [PATCH 03/21] chore: update env setup in docker compose and setup wizard --- docker-compose.yml | 10 ++++++---- setup-wizard.yml | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7747b08..218de73 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,10 +20,12 @@ services: STAKER_SCRIPTS_VERSION: v0.1.0 restart: unless-stopped environment: - SHUTTER_GNOSIS_NODE_PRIVATEKEY: "" - SHUTTER_PUSH_METRICS_ENABLED: false - KEYPER_NAME: "" - SHUTTER_PUSH_LOGS_ENABLED: false + - SHUTTER_GNOSIS_NODE_PRIVATEKEY="" + - SHUTTER_PUSH_METRICS_ENABLED=false + - KEYPER_NAME="" + - SHUTTER_PUSH_LOGS_ENABLED=false + - PUSHGATEWAY_USERNAME="" + - PUSHGATEWAY_PASSWORD="" volumes: - chain:/chain - keyper-config:/keyper/config diff --git a/setup-wizard.yml b/setup-wizard.yml index ae53853..e29fdc6 100644 --- a/setup-wizard.yml +++ b/setup-wizard.yml @@ -63,7 +63,7 @@ fields: target: type: environment name: PUSHGATEWAY_USERNAME - service: metrics + service: [metrics, shutter] required: false if: { enable_push_metrics: { "enum": ["true"] } } @@ -74,7 +74,7 @@ fields: target: type: environment name: PUSHGATEWAY_PASSWORD - service: metrics + service: [metrics, shutter] required: false secret: true if: { enable_push_metrics: { "enum": ["true"] } } From 7eaeb286edf0614fe3c38c746b625862a1b82ed4 Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Wed, 11 Jun 2025 17:03:04 +0530 Subject: [PATCH 04/21] fix: add promtail in DockerFile --- shutter/Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shutter/Dockerfile b/shutter/Dockerfile index c7784c9..7e5305d 100644 --- a/shutter/Dockerfile +++ b/shutter/Dockerfile @@ -41,6 +41,7 @@ ADD ${STAKER_SCRIPTS_URL}/dvt_lsd_tools.sh /etc/profile.d/ COPY go-shutter-settings ${SHUTTER_SETTINGS_SRC_DIR} COPY supervisord.conf /etc/supervisord.conf +COPY promtail_config.yaml /etc/promtail_config.yaml RUN go build -C ${SHUTTER_SETTINGS_SRC_DIR} -o /usr/local/bin/go_shutter_settings @@ -50,6 +51,14 @@ RUN mkdir -p ${KEYPER_CONFIG_DIR} ${SHUTTER_CHAIN_DIR} ${ASSETS_DIR} /opt/superv COPY scripts /usr/local/bin/ COPY --from=assets ${ASSETS_DIR}/ ${ASSETS_DIR}/ +# For pushing logs to loki +RUN apt-get -y install wget gpg +RUN mkdir -p /etc/apt/keyrings/ +RUN wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor > /etc/apt/keyrings/grafana.gpg +RUN echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | tee /etc/apt/sources.list.d/grafana.list +# promtail & rotatelogs (from apache2) +RUN apt-get update && apt-get -y install promtail apache2 + # Placed here to rebuild less layers ENV CHAIN_PORT=${CHAIN_PORT} \ SHUTTER_P2P_LISTENADDRESSES="/ip4/0.0.0.0/tcp/${KEYPER_PORT},/ip4/0.0.0.0/udp/${KEYPER_PORT}/quic-v1" \ From bf14cdb930f734708479e8e95c2a1197937e88ad Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Thu, 12 Jun 2025 14:47:14 +0530 Subject: [PATCH 05/21] chore: update script permissions in Dockerfile --- shutter/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/shutter/Dockerfile b/shutter/Dockerfile index 7e5305d..92d346e 100644 --- a/shutter/Dockerfile +++ b/shutter/Dockerfile @@ -49,6 +49,7 @@ RUN mkdir -p ${KEYPER_CONFIG_DIR} ${SHUTTER_CHAIN_DIR} ${ASSETS_DIR} /opt/superv chmod +rx /etc/profile.d/dvt_lsd_tools.sh COPY scripts /usr/local/bin/ +RUN chmod +x /usr/local/bin/*.sh COPY --from=assets ${ASSETS_DIR}/ ${ASSETS_DIR}/ # For pushing logs to loki From 6922b37a1eed2dee88fdc80c7b07d9734fdd3304 Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Thu, 12 Jun 2025 15:12:11 +0530 Subject: [PATCH 06/21] feat: setup optional external rpc --- docker-compose.yml | 11 ++++++----- setup-wizard.yml | 10 ++++++++++ shutter/Dockerfile | 15 +++++++++++++++ shutter/scripts/configure_keyper.sh | 21 ++++++++++++++++++++- 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5fa7283..c2dd697 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,11 +34,12 @@ services: ASSETS_VERSION: shutter-gnosis-1000-set1.3 # $NETWORK-10*$CHAIN_ID-set-$VERSION restart: on-failure environment: - SHUTTER_PUSH_METRICS_ENABLED: false - KEYPER_NAME: "" - PUSHGATEWAY_URL: "https://keyperingest.metrics.shutter.network/api/v1/write" - PUSHGATEWAY_USERNAME: "" - PUSHGATEWAY_PASSWORD: "" + - SHUTTER_PUSH_METRICS_ENABLED=false + - KEYPER_NAME="" + - PUSHGATEWAY_URL="https://keyperingest.metrics.shutter.network/api/v1/write" + - PUSHGATEWAY_USERNAME="" + - PUSHGATEWAY_PASSWORD="" + - ETHEREUM_WS="" volumes: - metrics-config:/config diff --git a/setup-wizard.yml b/setup-wizard.yml index d134348..18e30f4 100644 --- a/setup-wizard.yml +++ b/setup-wizard.yml @@ -21,6 +21,16 @@ fields: required: false secret: true + - id: external_ws_rpc + title: External WS RPC + description: | + A websocket connection to an external ethereum RPC (e.g. 'wss://some.external.url' or 'ws://1.2.3.4:8545'). If this is given, shutter will use this RPC to connect to the network. If not, shutter will try to use an RPC service on this dappnode. + target: + type: environment + name: ETHEREUM_WS + service: shutter + required: false + - id: enable_push_metrics title: Enable Push Metrics description: | diff --git a/shutter/Dockerfile b/shutter/Dockerfile index c7784c9..7172563 100644 --- a/shutter/Dockerfile +++ b/shutter/Dockerfile @@ -50,6 +50,21 @@ RUN mkdir -p ${KEYPER_CONFIG_DIR} ${SHUTTER_CHAIN_DIR} ${ASSETS_DIR} /opt/superv COPY scripts /usr/local/bin/ COPY --from=assets ${ASSETS_DIR}/ ${ASSETS_DIR}/ +RUN apt-get update && apt-get install -y \ + ca-certificates \ + curl + +ARG NODE_VERSION=22.14.0 +ARG NODE_PACKAGE=node-v$NODE_VERSION-linux-x64 +ARG NODE_HOME=/opt/$NODE_PACKAGE + +ENV NODE_PATH $NODE_HOME/lib/node_modules +ENV PATH $NODE_HOME/bin:$PATH + +RUN curl https://nodejs.org/dist/v$NODE_VERSION/$NODE_PACKAGE.tar.gz | tar -xzC /opt/ + +RUN npm install -g wscat + # Placed here to rebuild less layers ENV CHAIN_PORT=${CHAIN_PORT} \ SHUTTER_P2P_LISTENADDRESSES="/ip4/0.0.0.0/tcp/${KEYPER_PORT},/ip4/0.0.0.0/udp/${KEYPER_PORT}/quic-v1" \ diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index e2363ae..31481aa 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -6,6 +6,22 @@ # shellcheck disable=SC1091 . "${ASSETS_DIR}/variables.env" +NODE_VERSION=22.14.0 +NODE_PACKAGE=node-v$NODE_VERSION-linux-x64 +NODE_HOME=/opt/$NODE_PACKAGE + +NODE_PATH=$NODE_HOME/lib/node_modules +PATH=$NODE_HOME/bin:$PATH + +function test_ethereum_url() { + RESULT=$(wscat -c "$SHUTTER_NETWORK_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') + if [[ $RESULT =~ '"id":1' ]]; then return 0; else + echo "Could not find DAppNode RPC/WS url for this package!" + echo "Please configure 'ETHEREUM_WS' to point to an applicable websocket RPC service." + exit 1; + fi +} + echo "[INFO | configure] Calculating keyper configuration values..." SUPPORTED_NETWORKS="gnosis" @@ -18,7 +34,10 @@ fi export SHUTTER_P2P_ADVERTISEADDRESSES="[\"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/tcp/${KEYPER_PORT}\", \"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/udp/${KEYPER_PORT}/quic-v1\"]" export SHUTTER_BEACONAPIURL=$(get_beacon_api_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS") export SHUTTER_GNOSIS_NODE_CONTRACTSURL=http://execution.gnosis.dncore.dappnode:8545 -export SHUTTER_GNOSIS_NODE_ETHEREUMURL=$(get_execution_ws_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS") +export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-$(get_execution_ws_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS")} +echo "[DEBUG | configure] SHUTTER_NETWORK_NODE_ETHEREUMURL is ${SHUTTER_NETWORK_NODE_ETHEREUMURL}" +test_ethereum_url + export VALIDATOR_PUBLIC_KEY=$(cat "${SHUTTER_CHAIN_DIR}/config/priv_validator_pubkey.hex") export SHUTTER_DISCOVERY_NAMESPACE="${_ASSETS_DISCOVERY_NAME_PREFIX}-${_ASSETS_INSTANCE_ID}" export SHUTTER_METRICS_ENABLED=${SHUTTER_PUSH_METRICS_ENABLED} From 27a7e5da41295d81a422aadfd75a61a141ca8f0c Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Thu, 12 Jun 2025 15:56:42 +0530 Subject: [PATCH 07/21] chore: update configure_keyper script --- shutter/scripts/configure_keyper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index 31481aa..315a29d 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -14,7 +14,7 @@ NODE_PATH=$NODE_HOME/lib/node_modules PATH=$NODE_HOME/bin:$PATH function test_ethereum_url() { - RESULT=$(wscat -c "$SHUTTER_NETWORK_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') + RESULT=$(wscat -c "$SHUTTER_GNOSIS_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') if [[ $RESULT =~ '"id":1' ]]; then return 0; else echo "Could not find DAppNode RPC/WS url for this package!" echo "Please configure 'ETHEREUM_WS' to point to an applicable websocket RPC service." @@ -35,7 +35,7 @@ export SHUTTER_P2P_ADVERTISEADDRESSES="[\"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/tcp export SHUTTER_BEACONAPIURL=$(get_beacon_api_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS") export SHUTTER_GNOSIS_NODE_CONTRACTSURL=http://execution.gnosis.dncore.dappnode:8545 export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-$(get_execution_ws_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS")} -echo "[DEBUG | configure] SHUTTER_NETWORK_NODE_ETHEREUMURL is ${SHUTTER_NETWORK_NODE_ETHEREUMURL}" +echo "[DEBUG | configure] SHUTTER_GNOSIS_NODE_ETHEREUMURL is ${SHUTTER_GNOSIS_NODE_ETHEREUMURL}" test_ethereum_url export VALIDATOR_PUBLIC_KEY=$(cat "${SHUTTER_CHAIN_DIR}/config/priv_validator_pubkey.hex") From 1a3751225442957df481a8e015738a06a0657a01 Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Mon, 23 Jun 2025 19:45:30 +0530 Subject: [PATCH 08/21] feat: add optional beacon api as env and upgrade staker scripts to v0.1.1 --- dappnode_package.json | 2 +- docker-compose.yml | 3 ++- setup-wizard.yml | 10 ++++++++++ shutter/scripts/configure_keyper.sh | 20 ++++++++++++++++++-- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/dappnode_package.json b/dappnode_package.json index 8524339..4b58b20 100644 --- a/dappnode_package.json +++ b/dappnode_package.json @@ -10,7 +10,7 @@ "upstream": [ { "repo": "dappnode/staker-package-scripts", - "version": "v0.1.0", + "version": "v0.1.1", "arg": "STAKER_SCRIPTS_VERSION" } ], diff --git a/docker-compose.yml b/docker-compose.yml index d2f138d..59e5115 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: UPSTREAM_VERSION: v1.3.10 KEYPER_CONFIG_DIR: /keyper/config SHUTTER_CHAIN_DIR: /chain - STAKER_SCRIPTS_VERSION: v0.1.0 + STAKER_SCRIPTS_VERSION: v0.1.1 restart: unless-stopped environment: - SHUTTER_GNOSIS_NODE_PRIVATEKEY="" @@ -43,6 +43,7 @@ services: - PUSHGATEWAY_USERNAME="" - PUSHGATEWAY_PASSWORD="" - ETHEREUM_WS="" + - BEACON_HTTP="" volumes: - metrics-config:/config diff --git a/setup-wizard.yml b/setup-wizard.yml index 161b4cc..bf5a839 100644 --- a/setup-wizard.yml +++ b/setup-wizard.yml @@ -32,6 +32,16 @@ fields: service: shutter required: false + - id: external_beacon_http_rpc + title: External Beacon HTTP RPC + description: | + A HTTP connection to an external ethereum beacon RPC (e.g. 'https://some.external.url' or 'http://1.2.3.4:4000'). If this is given, shutter will use this beacon api to connect to the network. If not, shutter will try to use an beacon api service on this dappnode. + target: + type: environment + name: BEACON_HTTP + service: shutter + required: false + - id: enable_push_logs title: Enable Push Logs description: | diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index 315a29d..014ec1e 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -22,6 +22,15 @@ function test_ethereum_url() { fi } +function test_beacon_url() { + RESULT=${curl -X GET "$SHUTTER_BEACONAPIURL/eth/v1/beacon/genesis" -H "Accept: application/json"} + if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else + echo "Could not find DAppNode Beacon API url for this package!" + echo "Please configure 'BEACON_HTTP' to point to an applicable HTTP API service." + exit 1; + fi +} + echo "[INFO | configure] Calculating keyper configuration values..." SUPPORTED_NETWORKS="gnosis" @@ -32,9 +41,16 @@ if [[ ! "$SHUTTER_P2P_LISTENADDRESSES" =~ ^\[.*\]$ ]]; then fi export SHUTTER_P2P_ADVERTISEADDRESSES="[\"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/tcp/${KEYPER_PORT}\", \"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/udp/${KEYPER_PORT}/quic-v1\"]" -export SHUTTER_BEACONAPIURL=$(get_beacon_api_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS") + + +export SHUTTER_BEACONAPIURL=${BEACON_HTTP:-get_beacon_api_url_from_global_env ${NETWORK} ${SUPPORTED_NETWORKS}} +echo "[DEBUG | configure] SHUTTER_BEACONAPIURL is ${SHUTTER_BEACONAPIURL}" +test_beacon_url + export SHUTTER_GNOSIS_NODE_CONTRACTSURL=http://execution.gnosis.dncore.dappnode:8545 -export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-$(get_execution_ws_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS")} + +//FIXME: This is a workaround for the issue with the staker-scripts@v0.1.1 not setting get_execution_ws_url_from_global_env correctly in the environment variables. +export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-ws://execution.${SUPPORTED_NETWORKS}.dncore.dappnode:8545} echo "[DEBUG | configure] SHUTTER_GNOSIS_NODE_ETHEREUMURL is ${SHUTTER_GNOSIS_NODE_ETHEREUMURL}" test_ethereum_url From 61a33c255765979d97881a82badd5db376ef0265 Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Tue, 24 Jun 2025 12:07:49 +0530 Subject: [PATCH 09/21] fix: execution client rpc port can be 8546/8545 --- shutter/scripts/configure_keyper.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index 014ec1e..e10243f 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -14,11 +14,15 @@ NODE_PATH=$NODE_HOME/lib/node_modules PATH=$NODE_HOME/bin:$PATH function test_ethereum_url() { - RESULT=$(wscat -c "$SHUTTER_GNOSIS_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') + RESULT=$(wscat -c "$SHUTTER_NETWORK_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') if [[ $RESULT =~ '"id":1' ]]; then return 0; else - echo "Could not find DAppNode RPC/WS url for this package!" - echo "Please configure 'ETHEREUM_WS' to point to an applicable websocket RPC service." - exit 1; + export SHUTTER_NETWORK_NODE_ETHEREUMURL=ws://execution.${SUPPORTED_NETWORKS}.dncore.dappnode:8545 + RESULT=$(wscat -c "" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') + if [[ $RESULT =~ '"id":1' ]]; then return 0; else + echo "Could not find DAppNode RPC/WS url for this package!" + echo "Please configure 'ETHEREUM_WS' to point to an applicable websocket RPC service." + exit 1 + fi fi } @@ -50,7 +54,7 @@ test_beacon_url export SHUTTER_GNOSIS_NODE_CONTRACTSURL=http://execution.gnosis.dncore.dappnode:8545 //FIXME: This is a workaround for the issue with the staker-scripts@v0.1.1 not setting get_execution_ws_url_from_global_env correctly in the environment variables. -export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-ws://execution.${SUPPORTED_NETWORKS}.dncore.dappnode:8545} +export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-ws://execution.${NETWORK}.dncore.dappnode:8546} echo "[DEBUG | configure] SHUTTER_GNOSIS_NODE_ETHEREUMURL is ${SHUTTER_GNOSIS_NODE_ETHEREUMURL}" test_ethereum_url From 0c6428d12154f02353a9281244a4b638e3e2a526 Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Tue, 24 Jun 2025 13:05:49 +0530 Subject: [PATCH 10/21] fix: docker compose for BEACON_HTTP and ETHEREUM_WS --- docker-compose.yml | 4 ++-- shutter/scripts/configure_keyper.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 59e5115..afe132f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,6 +26,8 @@ services: - SHUTTER_PUSH_LOGS_ENABLED=false - PUSHGATEWAY_USERNAME="" - PUSHGATEWAY_PASSWORD="" + - ETHEREUM_WS="" + - BEACON_HTTP="" volumes: - chain:/chain - keyper-config:/keyper/config @@ -42,8 +44,6 @@ services: - PUSHGATEWAY_URL="https://keyperingest.metrics.shutter.network/api/v1/write" - PUSHGATEWAY_USERNAME="" - PUSHGATEWAY_PASSWORD="" - - ETHEREUM_WS="" - - BEACON_HTTP="" volumes: - metrics-config:/config diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index e10243f..175f489 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -47,7 +47,7 @@ fi export SHUTTER_P2P_ADVERTISEADDRESSES="[\"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/tcp/${KEYPER_PORT}\", \"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/udp/${KEYPER_PORT}/quic-v1\"]" -export SHUTTER_BEACONAPIURL=${BEACON_HTTP:-get_beacon_api_url_from_global_env ${NETWORK} ${SUPPORTED_NETWORKS}} +export SHUTTER_BEACONAPIURL=${BEACON_HTTP:-$(get_beacon_api_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS")} echo "[DEBUG | configure] SHUTTER_BEACONAPIURL is ${SHUTTER_BEACONAPIURL}" test_beacon_url From 196f4c26b8126219be529d4054dc27421f96be53 Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Tue, 24 Jun 2025 13:49:40 +0530 Subject: [PATCH 11/21] fix: test_beacon_url --- shutter/scripts/configure_keyper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index 175f489..45f5b18 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -16,7 +16,7 @@ PATH=$NODE_HOME/bin:$PATH function test_ethereum_url() { RESULT=$(wscat -c "$SHUTTER_NETWORK_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') if [[ $RESULT =~ '"id":1' ]]; then return 0; else - export SHUTTER_NETWORK_NODE_ETHEREUMURL=ws://execution.${SUPPORTED_NETWORKS}.dncore.dappnode:8545 + export SHUTTER_NETWORK_NODE_ETHEREUMURL=ws://execution.${NETWORK}.dncore.dappnode:8545 RESULT=$(wscat -c "" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') if [[ $RESULT =~ '"id":1' ]]; then return 0; else echo "Could not find DAppNode RPC/WS url for this package!" @@ -27,7 +27,7 @@ function test_ethereum_url() { } function test_beacon_url() { - RESULT=${curl -X GET "$SHUTTER_BEACONAPIURL/eth/v1/beacon/genesis" -H "Accept: application/json"} + RESULT=${curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json"} if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else echo "Could not find DAppNode Beacon API url for this package!" echo "Please configure 'BEACON_HTTP' to point to an applicable HTTP API service." From 5d2ff66c7f75667a2312e28896e7f61e4c6f77ee Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Tue, 24 Jun 2025 14:31:03 +0530 Subject: [PATCH 12/21] fix: test_ethereum_url --- shutter/scripts/configure_keyper.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index 45f5b18..b47a86e 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -14,10 +14,10 @@ NODE_PATH=$NODE_HOME/lib/node_modules PATH=$NODE_HOME/bin:$PATH function test_ethereum_url() { - RESULT=$(wscat -c "$SHUTTER_NETWORK_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') + RESULT=$(wscat -c "$SHUTTER_GNOSIS_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') if [[ $RESULT =~ '"id":1' ]]; then return 0; else - export SHUTTER_NETWORK_NODE_ETHEREUMURL=ws://execution.${NETWORK}.dncore.dappnode:8545 - RESULT=$(wscat -c "" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') + export SHUTTER_GNOSIS_NODE_ETHEREUMURL=ws://execution.${NETWORK}.dncore.dappnode:8545 + RESULT=$(wscat -c "$SHUTTER_GNOSIS_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') if [[ $RESULT =~ '"id":1' ]]; then return 0; else echo "Could not find DAppNode RPC/WS url for this package!" echo "Please configure 'ETHEREUM_WS' to point to an applicable websocket RPC service." @@ -27,7 +27,7 @@ function test_ethereum_url() { } function test_beacon_url() { - RESULT=${curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json"} + RESULT=$(curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json") if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else echo "Could not find DAppNode Beacon API url for this package!" echo "Please configure 'BEACON_HTTP' to point to an applicable HTTP API service." From 5f8eb0c33f3c10b5587de2e5b70720d91958a5bd Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Tue, 24 Jun 2025 15:08:17 +0530 Subject: [PATCH 13/21] chore: add staker scripts git issue link --- shutter/scripts/configure_keyper.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index b47a86e..f02a3eb 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -14,6 +14,10 @@ NODE_PATH=$NODE_HOME/lib/node_modules PATH=$NODE_HOME/bin:$PATH function test_ethereum_url() { + # FIXME: This is a workaround for the issue with the staker-scripts@v0.1.1 not setting get_execution_ws_url_from_global_env correctly in the environment variables. + # Git Issue: https://github.com/dappnode/staker-package-scripts/issues/11 + export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-ws://execution.${NETWORK}.dncore.dappnode:8546} + echo "[DEBUG | configure] SHUTTER_GNOSIS_NODE_ETHEREUMURL is ${SHUTTER_GNOSIS_NODE_ETHEREUMURL}" RESULT=$(wscat -c "$SHUTTER_GNOSIS_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') if [[ $RESULT =~ '"id":1' ]]; then return 0; else export SHUTTER_GNOSIS_NODE_ETHEREUMURL=ws://execution.${NETWORK}.dncore.dappnode:8545 @@ -27,7 +31,7 @@ function test_ethereum_url() { } function test_beacon_url() { - RESULT=$(curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json") + RESULT=${curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json"} if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else echo "Could not find DAppNode Beacon API url for this package!" echo "Please configure 'BEACON_HTTP' to point to an applicable HTTP API service." @@ -53,9 +57,6 @@ test_beacon_url export SHUTTER_GNOSIS_NODE_CONTRACTSURL=http://execution.gnosis.dncore.dappnode:8545 -//FIXME: This is a workaround for the issue with the staker-scripts@v0.1.1 not setting get_execution_ws_url_from_global_env correctly in the environment variables. -export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-ws://execution.${NETWORK}.dncore.dappnode:8546} -echo "[DEBUG | configure] SHUTTER_GNOSIS_NODE_ETHEREUMURL is ${SHUTTER_GNOSIS_NODE_ETHEREUMURL}" test_ethereum_url export VALIDATOR_PUBLIC_KEY=$(cat "${SHUTTER_CHAIN_DIR}/config/priv_validator_pubkey.hex") From a1397aa3fed347690e6e1119933723f8c1989079 Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Tue, 24 Jun 2025 15:12:24 +0530 Subject: [PATCH 14/21] chore: update echo in configure_keyper.sh for better debugging --- shutter/scripts/configure_keyper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index f02a3eb..4714a42 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -17,7 +17,6 @@ function test_ethereum_url() { # FIXME: This is a workaround for the issue with the staker-scripts@v0.1.1 not setting get_execution_ws_url_from_global_env correctly in the environment variables. # Git Issue: https://github.com/dappnode/staker-package-scripts/issues/11 export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-ws://execution.${NETWORK}.dncore.dappnode:8546} - echo "[DEBUG | configure] SHUTTER_GNOSIS_NODE_ETHEREUMURL is ${SHUTTER_GNOSIS_NODE_ETHEREUMURL}" RESULT=$(wscat -c "$SHUTTER_GNOSIS_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') if [[ $RESULT =~ '"id":1' ]]; then return 0; else export SHUTTER_GNOSIS_NODE_ETHEREUMURL=ws://execution.${NETWORK}.dncore.dappnode:8545 @@ -28,6 +27,7 @@ function test_ethereum_url() { exit 1 fi fi + echo "[DEBUG | configure] SHUTTER_GNOSIS_NODE_ETHEREUMURL is ${SHUTTER_GNOSIS_NODE_ETHEREUMURL}" } function test_beacon_url() { From 87dc3041a2ec3ba230690089058b0eb4be7d434d Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Tue, 24 Jun 2025 16:48:57 +0530 Subject: [PATCH 15/21] fix: update test_beacon_url --- shutter/scripts/configure_keyper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index 4714a42..a648aef 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -31,7 +31,7 @@ function test_ethereum_url() { } function test_beacon_url() { - RESULT=${curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json"} + RESULT=$(curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json") if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else echo "Could not find DAppNode Beacon API url for this package!" echo "Please configure 'BEACON_HTTP' to point to an applicable HTTP API service." From d1b87a5b37e12db08b82eae0e2ff7e99a28ebff8 Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Tue, 24 Jun 2025 17:23:30 +0530 Subject: [PATCH 16/21] chore: update echo in configure_keyper.sh for better debugging --- shutter/scripts/configure_keyper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index a648aef..7ec6548 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -27,7 +27,6 @@ function test_ethereum_url() { exit 1 fi fi - echo "[DEBUG | configure] SHUTTER_GNOSIS_NODE_ETHEREUMURL is ${SHUTTER_GNOSIS_NODE_ETHEREUMURL}" } function test_beacon_url() { @@ -58,6 +57,7 @@ test_beacon_url export SHUTTER_GNOSIS_NODE_CONTRACTSURL=http://execution.gnosis.dncore.dappnode:8545 test_ethereum_url +echo "[DEBUG | configure] SHUTTER_GNOSIS_NODE_ETHEREUMURL is ${SHUTTER_GNOSIS_NODE_ETHEREUMURL}" export VALIDATOR_PUBLIC_KEY=$(cat "${SHUTTER_CHAIN_DIR}/config/priv_validator_pubkey.hex") export SHUTTER_DISCOVERY_NAMESPACE="${_ASSETS_DISCOVERY_NAME_PREFIX}-${_ASSETS_INSTANCE_ID}" From af825a9de025987a7e6d5098b6dd4c78b0e0fa5f Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Tue, 24 Jun 2025 19:21:59 +0530 Subject: [PATCH 17/21] chore: move SHUTTER_BEACONAPIURL env to test_beacon_url function --- shutter/scripts/configure_keyper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index 7ec6548..5fbec60 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -30,6 +30,7 @@ function test_ethereum_url() { } function test_beacon_url() { + export SHUTTER_BEACONAPIURL=${BEACON_HTTP:-$(get_beacon_api_url_from_global_env "$NETWORK")} RESULT=$(curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json") if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else echo "Could not find DAppNode Beacon API url for this package!" @@ -50,9 +51,8 @@ fi export SHUTTER_P2P_ADVERTISEADDRESSES="[\"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/tcp/${KEYPER_PORT}\", \"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/udp/${KEYPER_PORT}/quic-v1\"]" -export SHUTTER_BEACONAPIURL=${BEACON_HTTP:-$(get_beacon_api_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS")} -echo "[DEBUG | configure] SHUTTER_BEACONAPIURL is ${SHUTTER_BEACONAPIURL}" test_beacon_url +echo "[DEBUG | configure] SHUTTER_BEACONAPIURL is ${SHUTTER_BEACONAPIURL}" export SHUTTER_GNOSIS_NODE_CONTRACTSURL=http://execution.gnosis.dncore.dappnode:8545 From 0c370ea0decc1662960564e47dcf78a917c0f998 Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Wed, 25 Jun 2025 14:26:40 +0530 Subject: [PATCH 18/21] chore: add debug log --- shutter/scripts/configure_keyper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index 5fbec60..c087926 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -31,6 +31,7 @@ function test_ethereum_url() { function test_beacon_url() { export SHUTTER_BEACONAPIURL=${BEACON_HTTP:-$(get_beacon_api_url_from_global_env "$NETWORK")} + echo "[DEBUG | configure] SHUTTER_BEACONAPIURL is ${SHUTTER_BEACONAPIURL}" RESULT=$(curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json") if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else echo "Could not find DAppNode Beacon API url for this package!" @@ -52,7 +53,6 @@ export SHUTTER_P2P_ADVERTISEADDRESSES="[\"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/tcp test_beacon_url -echo "[DEBUG | configure] SHUTTER_BEACONAPIURL is ${SHUTTER_BEACONAPIURL}" export SHUTTER_GNOSIS_NODE_CONTRACTSURL=http://execution.gnosis.dncore.dappnode:8545 From 795415d7235ff54a9b6315215e2a32d0e1bdec4c Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Wed, 25 Jun 2025 15:53:59 +0530 Subject: [PATCH 19/21] chore: test get_beacon_api_url_from_global_env --- shutter/scripts/configure_keyper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index c087926..5c0a954 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -30,7 +30,7 @@ function test_ethereum_url() { } function test_beacon_url() { - export SHUTTER_BEACONAPIURL=${BEACON_HTTP:-$(get_beacon_api_url_from_global_env "$NETWORK")} + export SHUTTER_BEACONAPIURL=${BEACON_HTTP:-$(get_beacon_api_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS")} echo "[DEBUG | configure] SHUTTER_BEACONAPIURL is ${SHUTTER_BEACONAPIURL}" RESULT=$(curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json") if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else From b001918dd14d0f6b257a44ba8b002b240b36195c Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Wed, 25 Jun 2025 16:42:43 +0530 Subject: [PATCH 20/21] fix: add staker-scripts@v0.1.0 with exlicit 8545 & 4000 port check --- dappnode_package.json | 2 +- docker-compose.yml | 2 +- shutter/scripts/configure_keyper.sh | 13 ++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dappnode_package.json b/dappnode_package.json index 4b58b20..8524339 100644 --- a/dappnode_package.json +++ b/dappnode_package.json @@ -10,7 +10,7 @@ "upstream": [ { "repo": "dappnode/staker-package-scripts", - "version": "v0.1.1", + "version": "v0.1.0", "arg": "STAKER_SCRIPTS_VERSION" } ], diff --git a/docker-compose.yml b/docker-compose.yml index afe132f..c722abb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: UPSTREAM_VERSION: v1.3.10 KEYPER_CONFIG_DIR: /keyper/config SHUTTER_CHAIN_DIR: /chain - STAKER_SCRIPTS_VERSION: v0.1.1 + STAKER_SCRIPTS_VERSION: v0.1.0 restart: unless-stopped environment: - SHUTTER_GNOSIS_NODE_PRIVATEKEY="" diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index 5c0a954..c75dc04 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -16,7 +16,7 @@ PATH=$NODE_HOME/bin:$PATH function test_ethereum_url() { # FIXME: This is a workaround for the issue with the staker-scripts@v0.1.1 not setting get_execution_ws_url_from_global_env correctly in the environment variables. # Git Issue: https://github.com/dappnode/staker-package-scripts/issues/11 - export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-ws://execution.${NETWORK}.dncore.dappnode:8546} + export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-get_execution_ws_url_from_global_env ${NETWORK} ${SUPPORTED_NETWORKS}} RESULT=$(wscat -c "$SHUTTER_GNOSIS_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') if [[ $RESULT =~ '"id":1' ]]; then return 0; else export SHUTTER_GNOSIS_NODE_ETHEREUMURL=ws://execution.${NETWORK}.dncore.dappnode:8545 @@ -31,12 +31,14 @@ function test_ethereum_url() { function test_beacon_url() { export SHUTTER_BEACONAPIURL=${BEACON_HTTP:-$(get_beacon_api_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS")} - echo "[DEBUG | configure] SHUTTER_BEACONAPIURL is ${SHUTTER_BEACONAPIURL}" RESULT=$(curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json") if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else - echo "Could not find DAppNode Beacon API url for this package!" - echo "Please configure 'BEACON_HTTP' to point to an applicable HTTP API service." - exit 1; + export SHUTTER_BEACONAPIURL=http://beacon-chain.${NETWORK}.dncore.dappnode:4000 + if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else + echo "Could not find DAppNode Beacon API url for this package!" + echo "Please configure 'BEACON_HTTP' to point to an applicable HTTP API service." + exit 1; + fi fi } @@ -53,6 +55,7 @@ export SHUTTER_P2P_ADVERTISEADDRESSES="[\"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/tcp test_beacon_url +echo "[DEBUG | configure] SHUTTER_BEACONAPIURL is ${SHUTTER_BEACONAPIURL}" export SHUTTER_GNOSIS_NODE_CONTRACTSURL=http://execution.gnosis.dncore.dappnode:8545 From 01f8f698e2a37529f25d4e02eeae381abc6920bf Mon Sep 17 00:00:00 2001 From: blockchainluffy Date: Wed, 25 Jun 2025 23:56:25 +0530 Subject: [PATCH 21/21] chore: update default values for ETHEREUM_WS and BEACON_HTTP --- docker-compose.yml | 4 ++-- shutter/scripts/configure_keyper.sh | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c722abb..9090eb1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,8 +26,8 @@ services: - SHUTTER_PUSH_LOGS_ENABLED=false - PUSHGATEWAY_USERNAME="" - PUSHGATEWAY_PASSWORD="" - - ETHEREUM_WS="" - - BEACON_HTTP="" + - ETHEREUM_WS= + - BEACON_HTTP= volumes: - chain:/chain - keyper-config:/keyper/config diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index c75dc04..bdc5de3 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -16,7 +16,7 @@ PATH=$NODE_HOME/bin:$PATH function test_ethereum_url() { # FIXME: This is a workaround for the issue with the staker-scripts@v0.1.1 not setting get_execution_ws_url_from_global_env correctly in the environment variables. # Git Issue: https://github.com/dappnode/staker-package-scripts/issues/11 - export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-get_execution_ws_url_from_global_env ${NETWORK} ${SUPPORTED_NETWORKS}} + export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-$(get_execution_ws_url_from_global_env ${NETWORK} ${SUPPORTED_NETWORKS})} RESULT=$(wscat -c "$SHUTTER_GNOSIS_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}') if [[ $RESULT =~ '"id":1' ]]; then return 0; else export SHUTTER_GNOSIS_NODE_ETHEREUMURL=ws://execution.${NETWORK}.dncore.dappnode:8545 @@ -34,6 +34,7 @@ function test_beacon_url() { RESULT=$(curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json") if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else export SHUTTER_BEACONAPIURL=http://beacon-chain.${NETWORK}.dncore.dappnode:4000 + RESULT=$(curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json") if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else echo "Could not find DAppNode Beacon API url for this package!" echo "Please configure 'BEACON_HTTP' to point to an applicable HTTP API service."