update hive client script

add enode.sh
use HIVE_BOOTNODES flag in nimbus.sh
This commit is contained in:
jangko 2021-05-19 16:36:43 +07:00
parent ec1af91370
commit 2fd2665026
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
3 changed files with 22 additions and 1 deletions

View File

@ -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

View File

@ -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"

View File

@ -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