diff --git a/hive_integration/nimbus/Dockerfile b/hive_integration/nimbus/Dockerfile index 2bc917f06..e63bfc982 100644 --- a/hive_integration/nimbus/Dockerfile +++ b/hive_integration/nimbus/Dockerfile @@ -34,6 +34,7 @@ RUN usr/bin/nimbus -v > /version.txt # Inject the startup script and helper files COPY *.sh *.jq *.json / RUN chmod +x /nimbus.sh +RUN chmod +x /enode.sh # Export the usual networking ports to allow outside access to the node EXPOSE 8545 8546 8547 30303 30303/udp diff --git a/hive_integration/nimbus/enode.sh b/hive_integration/nimbus/enode.sh new file mode 100644 index 000000000..f5395afa9 --- /dev/null +++ b/hive_integration/nimbus/enode.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Script to retrieve the enode +# +# This is copied into the validator container by Hive +# and used to provide a client-specific enode id retriever +# + +# Immediately abort the script on any error encountered +set -e + +TARGET_RESPONSE=$(curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"net_nodeInfo","params":[],"id":1}' "localhost:8545" ) + +TARGET_ENODE=$(echo ${TARGET_RESPONSE}| jq -r '.result.enode') +echo "$TARGET_ENODE" diff --git a/hive_integration/nimbus/nimbus.sh b/hive_integration/nimbus/nimbus.sh index eba9c4cf2..4db6b2c95 100644 --- a/hive_integration/nimbus/nimbus.sh +++ b/hive_integration/nimbus/nimbus.sh @@ -11,7 +11,7 @@ # # This script assumes the following environment variables: # -# - [ ] HIVE_BOOTNODE enode URL of the remote bootstrap node +# - [x] HIVE_BOOTNODE enode URL of the remote bootstrap node # - [x] HIVE_NETWORK_ID network ID number to use for the eth protocol # - [ ] HIVE_TESTNET whether testnet nonces (2^20) are needed # - [ ] HIVE_NODETYPE sync and pruning selector (archive, full, light) @@ -53,6 +53,11 @@ if [ "$HIVE_LOGLEVEL" != "" ]; then FLAGS="$FLAGS --log-level:DEBUG" fi +# It doesn't make sense to dial out, use only a pre-set bootnode. +if [ "$HIVE_BOOTNODE" != "" ]; then + FLAGS="$FLAGS --bootnodes:$HIVE_BOOTNODE" +fi + # Configure the genesis chain and use it as start block and dump it to stdout echo "Supplied genesis state:" jq -f /mapper.jq /genesis.json | tee /genesis-start.json