Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The setup wizard provides options for users to configure the package. These valu

- `KEYPER_NAME`: a unique name for your keyper so it can be identified in the network.
- `SHUTTER_API_NODE_PRIVATEKEY`: A privatekey for an ethereum externally owned account.
- `ETHEREUM_WS`: An ethereum websocket RPC url. This can either point to an external RPC, or an RPC node running on your dappnode.
- `ETHEREUM_WS`: An optional ethereum websocket RPC url. This can either point to an external RPC, or an RPC node running on your dappnode. If it is not given, shutter will try to use an internal RPC through the 'staker scripts' mechanism.
- `SHUTTER_PUSH_METRICS_ENABLED`: A boolean flag deciding whether metrics will be pushed (see values below).
- `PUSHGATEWAY_URL`: You don't need to change the default here.
- `PUSHGATEWAY_USERNAME`: A username for the push gateway from above.
Expand Down
4 changes: 2 additions & 2 deletions setup-wizard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ fields:
- id: external_ws_rpc
title: External WS RPC
description: |
A websocket connection to an external ethereum RPC.
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: true
required: false

- id: enable_push_logs
title: Enable Push Logs
Expand Down
14 changes: 14 additions & 0 deletions shutter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ RUN echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com
# promtail & rotatelogs (from apache2)
RUN apt-get update && apt-get -y install promtail apache2

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} \
Expand Down
21 changes: 20 additions & 1 deletion shutter/scripts/configure_keyper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -16,8 +32,11 @@ 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_NETWORK_NODE_ETHEREUMURL=${ETHEREUM_WS}

export SHUTTER_NETWORK_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_METRICS_ENABLED=${SHUTTER_PUSH_METRICS_ENABLED}
export FLOODSUB_DISCOVERY_ENABLED=true
Expand Down
Loading