Skip to content

Commit a2f009a

Browse files
committed
WIP: Allow alternativ configuration for ETHEREUM_WS
Fixes: #8
1 parent 87f5342 commit a2f009a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

setup-wizard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fields:
2929
type: environment
3030
name: ETHEREUM_WS
3131
service: shutter
32-
required: true
32+
required: false
3333

3434
- id: enable_push_logs
3535
title: Enable Push Logs

shutter/scripts/configure_keyper.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
# shellcheck disable=SC1091
77
. "${ASSETS_DIR}/variables.env"
88

9+
function test_ethereum_url() {
10+
RESULT=$(wscat -c "$SHUTTER_NETWORK_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}')
11+
if [[ $RESULT =~ '"id":1' ]]; then return 0; else
12+
echo "Could not find DAppNode RPC/WS url for this package!"
13+
echo "Please configure 'ETHEREUM_WS' to point to an applicable websocket RPC service."
14+
exit 1;
15+
fi
16+
}
17+
918
echo "[INFO | configure] Calculating keyper configuration values..."
1019

1120
SUPPORTED_NETWORKS="gnosis"
@@ -16,8 +25,11 @@ if [[ ! "$SHUTTER_P2P_LISTENADDRESSES" =~ ^\[.*\]$ ]]; then
1625
fi
1726

1827
export SHUTTER_P2P_ADVERTISEADDRESSES="[\"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/tcp/${KEYPER_PORT}\", \"/ip4/${_DAPPNODE_GLOBAL_PUBLIC_IP}/udp/${KEYPER_PORT}/quic-v1\"]"
19-
export SHUTTER_NETWORK_NODE_ETHEREUMURL=${ETHEREUM_WS}
28+
29+
export SHUTTER_NETWORK_NODE_ETHEREUMURL=${ETHEREUM_WS:-$(get_execution_ws_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS")}
2030
echo "[DEBUG | configure] SHUTTER_NETWORK_NODE_ETHEREUMURL is ${SHUTTER_NETWORK_NODE_ETHEREUMURL}"
31+
test_ethereum_url
32+
2133
export VALIDATOR_PUBLIC_KEY=$(cat "${SHUTTER_CHAIN_DIR}/config/priv_validator_pubkey.hex")
2234
export SHUTTER_METRICS_ENABLED=${SHUTTER_PUSH_METRICS_ENABLED}
2335
export FLOODSUB_DISCOVERY_ENABLED=true

0 commit comments

Comments
 (0)