Remove fixed IPs and separate network for fixturenet.
This commit is contained in:
parent
efd40052cb
commit
366cb7684e
@ -8,9 +8,6 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
RUN_BOOTNODE: "true"
|
RUN_BOOTNODE: "true"
|
||||||
image: cerc/fixturenet-eth-geth:local
|
image: cerc/fixturenet-eth-geth:local
|
||||||
networks:
|
|
||||||
fixturenet-eth-net:
|
|
||||||
ipv4_address: 172.16.254.10
|
|
||||||
|
|
||||||
fixturenet-eth-geth-1:
|
fixturenet-eth-geth-1:
|
||||||
hostname: fixturenet-eth-geth-1
|
hostname: fixturenet-eth-geth-1
|
||||||
@ -20,9 +17,7 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- fixturenet-eth-bootnode-geth
|
- fixturenet-eth-bootnode-geth
|
||||||
ports:
|
ports:
|
||||||
- "8545"
|
- "8545:8545"
|
||||||
networks:
|
|
||||||
fixturenet-eth-net:
|
|
||||||
|
|
||||||
fixturenet-eth-geth-2:
|
fixturenet-eth-geth-2:
|
||||||
hostname: fixturenet-eth-geth-2
|
hostname: fixturenet-eth-geth-2
|
||||||
@ -31,17 +26,12 @@ services:
|
|||||||
image: cerc/fixturenet-eth-geth:local
|
image: cerc/fixturenet-eth-geth:local
|
||||||
depends_on:
|
depends_on:
|
||||||
- fixturenet-eth-bootnode-geth
|
- fixturenet-eth-bootnode-geth
|
||||||
networks:
|
|
||||||
fixturenet-eth-net:
|
|
||||||
|
|
||||||
fixturenet-eth-bootnode-lighthouse:
|
fixturenet-eth-bootnode-lighthouse:
|
||||||
hostname: fixturenet-eth-bootnode-lighthouse
|
hostname: fixturenet-eth-bootnode-lighthouse
|
||||||
environment:
|
environment:
|
||||||
RUN_BOOTNODE: "true"
|
RUN_BOOTNODE: "true"
|
||||||
image: cerc/fixturenet-eth-lighthouse:local
|
image: cerc/fixturenet-eth-lighthouse:local
|
||||||
networks:
|
|
||||||
fixturenet-eth-net:
|
|
||||||
ipv4_address: 172.16.254.11
|
|
||||||
|
|
||||||
fixturenet-eth-lighthouse-1:
|
fixturenet-eth-lighthouse-1:
|
||||||
hostname: fixturenet-eth-lighthouse-1
|
hostname: fixturenet-eth-lighthouse-1
|
||||||
@ -56,9 +46,7 @@ services:
|
|||||||
- fixturenet-eth-bootnode-lighthouse
|
- fixturenet-eth-bootnode-lighthouse
|
||||||
- fixturenet-eth-geth-1
|
- fixturenet-eth-geth-1
|
||||||
ports:
|
ports:
|
||||||
- "8001"
|
- "5052:8001"
|
||||||
networks:
|
|
||||||
fixturenet-eth-net:
|
|
||||||
|
|
||||||
fixturenet-eth-lighthouse-2:
|
fixturenet-eth-lighthouse-2:
|
||||||
hostname: fixturenet-eth-lighthouse-2
|
hostname: fixturenet-eth-lighthouse-2
|
||||||
@ -73,14 +61,3 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- fixturenet-eth-bootnode-lighthouse
|
- fixturenet-eth-bootnode-lighthouse
|
||||||
- fixturenet-eth-geth-2
|
- fixturenet-eth-geth-2
|
||||||
networks:
|
|
||||||
fixturenet-eth-net:
|
|
||||||
|
|
||||||
networks:
|
|
||||||
# When the bootnode ENR is generated during the build, it requires a specific IP.
|
|
||||||
# The easiest way to do that is to use a private network.
|
|
||||||
fixturenet-eth-net:
|
|
||||||
driver: bridge
|
|
||||||
ipam:
|
|
||||||
config:
|
|
||||||
- subnet: 172.16.254.0/28
|
|
||||||
|
@ -7,5 +7,4 @@ ENODE="enode://af22c29c316ad069cf48a09a4ad5cf04a251b411e45098888d114c6dd7f489a13
|
|||||||
# JWT shared by geth and lighthouse for authentication.
|
# JWT shared by geth and lighthouse for authentication.
|
||||||
JWT="0x6cdcac3501046a08e186730dd8bd136cfaf0fdc1fc955f6e15ad3068c0ff2af0"
|
JWT="0x6cdcac3501046a08e186730dd8bd136cfaf0fdc1fc955f6e15ad3068c0ff2af0"
|
||||||
|
|
||||||
# Should match the definition of fixturenet-eth-net.
|
ENR_URL="http://fixturenet-eth-bootnode-lighthouse:3000/bootnode/enr.dat"
|
||||||
NETRESTRICT="172.16.254.0/28"
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
ETHERBASE=`cat /opt/testnet/build/el/accounts.csv | head -1 | cut -d',' -f2`
|
ETHERBASE=`cat /opt/testnet/build/el/accounts.csv | head -1 | cut -d',' -f2`
|
||||||
NETWORK_ID=`cat /opt/testnet/el/el-config.yaml | grep 'chain_id' | awk '{ print $2 }'`
|
NETWORK_ID=`cat /opt/testnet/el/el-config.yaml | grep 'chain_id' | awk '{ print $2 }'`
|
||||||
|
NETRESTRICT=`ip addr | grep inet | grep -v '127.0' | awk '{print $2}'`
|
||||||
|
|
||||||
if [ "true" == "$RUN_BOOTNODE" ]; then
|
if [ "true" == "$RUN_BOOTNODE" ]; then
|
||||||
geth \
|
geth \
|
||||||
|
@ -10,7 +10,7 @@ set -Eeuo pipefail
|
|||||||
source ./vars.env
|
source ./vars.env
|
||||||
|
|
||||||
SUBSCRIBE_ALL_SUBNETS=
|
SUBSCRIBE_ALL_SUBNETS=
|
||||||
DEBUG_LEVEL=${DEBUG_LEVEL:-info}
|
DEBUG_LEVEL=${DEBUG_LEVEL:-debug}
|
||||||
|
|
||||||
# Get positional arguments
|
# Get positional arguments
|
||||||
data_dir=$DATADIR/node_${NODE_NUMBER}
|
data_dir=$DATADIR/node_${NODE_NUMBER}
|
||||||
@ -18,9 +18,6 @@ network_port=9001
|
|||||||
http_port=8001
|
http_port=8001
|
||||||
authrpc_port=8551
|
authrpc_port=8551
|
||||||
|
|
||||||
ENR=`cat $DATADIR/bootnode/enr.dat`
|
|
||||||
ENR_IP=`ip addr | grep 172 | awk '{print $2}' | cut -d '/' -f1`
|
|
||||||
|
|
||||||
exec lighthouse \
|
exec lighthouse \
|
||||||
--debug-level $DEBUG_LEVEL \
|
--debug-level $DEBUG_LEVEL \
|
||||||
bn \
|
bn \
|
||||||
|
@ -13,6 +13,22 @@ DEBUG_LEVEL=${1:-info}
|
|||||||
|
|
||||||
echo "Starting bootnode"
|
echo "Starting bootnode"
|
||||||
|
|
||||||
|
if [ ! -f "$DATADIR/bootnode/enr.dat" ]; then
|
||||||
|
echo "Generating bootnode enr"
|
||||||
|
lcli \
|
||||||
|
generate-bootnode-enr \
|
||||||
|
--ip $ENR_IP \
|
||||||
|
--udp-port $BOOTNODE_PORT \
|
||||||
|
--tcp-port $BOOTNODE_PORT \
|
||||||
|
--genesis-fork-version $GENESIS_FORK_VERSION \
|
||||||
|
--output-dir $DATADIR/bootnode
|
||||||
|
|
||||||
|
bootnode_enr=`cat $DATADIR/bootnode/enr.dat`
|
||||||
|
echo "- $bootnode_enr" > $TESTNET_DIR/boot_enr.yaml
|
||||||
|
|
||||||
|
echo "Generated bootnode enr and written to $TESTNET_DIR/boot_enr.yaml"
|
||||||
|
fi
|
||||||
|
|
||||||
exec lighthouse boot_node \
|
exec lighthouse boot_node \
|
||||||
--testnet-dir $TESTNET_DIR \
|
--testnet-dir $TESTNET_DIR \
|
||||||
--port $BOOTNODE_PORT \
|
--port $BOOTNODE_PORT \
|
||||||
|
@ -57,18 +57,3 @@ lcli \
|
|||||||
$GENESIS_VALIDATOR_COUNT
|
$GENESIS_VALIDATOR_COUNT
|
||||||
|
|
||||||
echo Created genesis state in $TESTNET_DIR
|
echo Created genesis state in $TESTNET_DIR
|
||||||
|
|
||||||
echo "Generating bootnode enr"
|
|
||||||
|
|
||||||
lcli \
|
|
||||||
generate-bootnode-enr \
|
|
||||||
--ip $BOOTNODE_IP \
|
|
||||||
--udp-port $BOOTNODE_PORT \
|
|
||||||
--tcp-port $BOOTNODE_PORT \
|
|
||||||
--genesis-fork-version $GENESIS_FORK_VERSION \
|
|
||||||
--output-dir $DATADIR/bootnode
|
|
||||||
|
|
||||||
bootnode_enr=`cat $DATADIR/bootnode/enr.dat`
|
|
||||||
echo "- $bootnode_enr" > $TESTNET_DIR/boot_enr.yaml
|
|
||||||
|
|
||||||
echo "Generated bootnode enr and written to $TESTNET_DIR/boot_enr.yaml"
|
|
||||||
|
@ -4,6 +4,8 @@ DATADIR=${DATADIR:-../build/cl}
|
|||||||
# Directory for the eth2 config
|
# Directory for the eth2 config
|
||||||
TESTNET_DIR=${TESTNET_DIR:-$DATADIR/testnet}
|
TESTNET_DIR=${TESTNET_DIR:-$DATADIR/testnet}
|
||||||
JWTSECRET=${JWTSECRET:-$DATADIR/jwtsecret}
|
JWTSECRET=${JWTSECRET:-$DATADIR/jwtsecret}
|
||||||
|
ENR=${ENR:="SET_AT_RUNTIME"}
|
||||||
|
ENR_IP=`ip addr | grep inet | grep -v '127.0.0.1' | sort | head -1 | awk '{print $2}' | cut -d '/' -f1`
|
||||||
|
|
||||||
GENESIS_FORK_VERSION=${GENESIS_FORK_VERSION:-0x12121212}
|
GENESIS_FORK_VERSION=${GENESIS_FORK_VERSION:-0x12121212}
|
||||||
|
|
||||||
@ -22,7 +24,6 @@ VC_COUNT=${VC_COUNT:-$BN_COUNT}
|
|||||||
GENESIS_DELAY=${GENESIS_DELAY:-0}
|
GENESIS_DELAY=${GENESIS_DELAY:-0}
|
||||||
|
|
||||||
# Port for P2P communication with bootnode
|
# Port for P2P communication with bootnode
|
||||||
BOOTNODE_IP=${BOOTNODE_IP:-172.16.254.11}
|
|
||||||
BOOTNODE_PORT=${BOOTNODE_PORT:-4242}
|
BOOTNODE_PORT=${BOOTNODE_PORT:-4242}
|
||||||
|
|
||||||
# Hard fork configuration
|
# Hard fork configuration
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ "true" == "$RUN_BOOTNODE" ]; then
|
if [ "true" == "$RUN_BOOTNODE" ]; then
|
||||||
|
cd /opt/testnet/build/cl
|
||||||
|
python3 -m http.server 3000 &
|
||||||
|
|
||||||
|
|
||||||
cd /opt/testnet/cl
|
cd /opt/testnet/cl
|
||||||
./bootnode.sh 2>&1 | tee /var/log/lighthouse_bootnode.log
|
./bootnode.sh 2>&1 | tee /var/log/lighthouse_bootnode.log
|
||||||
else
|
else
|
||||||
@ -34,6 +38,18 @@ else
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -z "$ENR_URL" ]; then
|
||||||
|
while [ 1 -eq 1 ]; do
|
||||||
|
echo "Waiting on ENR for boot node..."
|
||||||
|
sleep 5
|
||||||
|
result=`wget --no-check-certificate --quiet -O - --timeout=0 $ENR_URL`
|
||||||
|
if [ ! -z "$result" ]; then
|
||||||
|
export ENR="$result"
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
export JWTSECRET="/opt/testnet/build/cl/jwtsecret"
|
export JWTSECRET="/opt/testnet/build/cl/jwtsecret"
|
||||||
echo -n "$JWT" > $JWTSECRET
|
echo -n "$JWT" > $JWTSECRET
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user