diff --git a/dappnode_package.json b/dappnode_package.json index 8524339..c0cb184 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.2", "arg": "STAKER_SCRIPTS_VERSION" } ], diff --git a/docker-compose.yml b/docker-compose.yml index e78c434..01cd6c5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: UPSTREAM_VERSION: v1.3.14 KEYPER_CONFIG_DIR: /keyper/config SHUTTER_CHAIN_DIR: /chain - STAKER_SCRIPTS_VERSION: v0.1.0 + STAKER_SCRIPTS_VERSION: v0.1.2 restart: unless-stopped environment: - SHUTTER_GNOSIS_NODE_PRIVATEKEY="" diff --git a/shutter/scripts/configure_keyper.sh b/shutter/scripts/configure_keyper.sh index bdc5de3..d5bf618 100755 --- a/shutter/scripts/configure_keyper.sh +++ b/shutter/scripts/configure_keyper.sh @@ -14,12 +14,14 @@ 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:-$(get_execution_ws_url_from_global_env ${NETWORK} ${SUPPORTED_NETWORKS})} + if [ -z "$ETHEREUM_WS" ]; then + export SHUTTER_GNOSIS_NODE_ETHEREUMURL=$(get_execution_ws_url_from_global_env ${NETWORK}) + else + export SHUTTER_GNOSIS_NODE_ETHEREUMURL=$ETHEREUM_WS + fi 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 + 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 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!" @@ -30,7 +32,11 @@ function test_ethereum_url() { } function test_beacon_url() { - export SHUTTER_BEACONAPIURL=${BEACON_HTTP:-$(get_beacon_api_url_from_global_env "$NETWORK" "$SUPPORTED_NETWORKS")} + if [ -z "$BEACON_HTTP" ]; then + export SHUTTER_BEACONAPIURL=$(get_beacon_api_url_from_global_env "$NETWORK") + else + export SHUTTER_BEACONAPIURL=$BEACON_HTTP + fi 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