Skip to content

Commit 310f4b4

Browse files
fix: use staker scripts if ETHEREUM_WS is set to empty string
1 parent 3caedd4 commit 310f4b4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

shutter/scripts/configure_keyper.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ NODE_PATH=$NODE_HOME/lib/node_modules
1414
PATH=$NODE_HOME/bin:$PATH
1515

1616
function test_ethereum_url() {
17-
export SHUTTER_GNOSIS_NODE_ETHEREUMURL=${ETHEREUM_WS:-$(get_execution_ws_url_from_global_env ${NETWORK})}
17+
if [ -z "$ETHEREUM_WS" ]; then
18+
export SHUTTER_GNOSIS_NODE_ETHEREUMURL=$(get_execution_ws_url_from_global_env ${NETWORK})
19+
else
20+
export SHUTTER_GNOSIS_NODE_ETHEREUMURL=$ETHEREUM_WS
21+
fi
1822
RESULT=$(wscat -c "$SHUTTER_GNOSIS_NODE_ETHEREUMURL" -x '{"jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1}')
1923
if [[ $RESULT =~ '"id":1' ]]; then return 0; else
2024
export SHUTTER_GNOSIS_NODE_ETHEREUMURL=ws://execution.${NETWORK}.dncore.dappnode:8545 #letting it default to the old URL, incase the node running on the dappnode is not updated to the new version
@@ -28,7 +32,11 @@ function test_ethereum_url() {
2832
}
2933

3034
function test_beacon_url() {
31-
export SHUTTER_BEACONAPIURL=${BEACON_HTTP:-$(get_beacon_api_url_from_global_env "$NETWORK")}
35+
if [ -z "$BEACON_HTTP" ]; then
36+
export SHUTTER_BEACONAPIURL=$(get_beacon_api_url_from_global_env "$NETWORK")
37+
else
38+
export SHUTTER_BEACONAPIURL=$BEACON_HTTP
39+
fi
3240
RESULT=$(curl -X GET "${SHUTTER_BEACONAPIURL}/eth/v1/beacon/genesis" -H "Accept: application/json")
3341
if [[ $RESULT =~ '"genesis_time"' ]]; then return 0; else
3442
export SHUTTER_BEACONAPIURL=http://beacon-chain.${NETWORK}.dncore.dappnode:4000

0 commit comments

Comments
 (0)