mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Fix local testnet scripts (#2229)
## Issue Addressed Resolves #2094 ## Proposed Changes Fixes scripts for creating local testnets. Adds an option in `lighthouse boot_node` to run with a previously generated enr.
This commit is contained in:
33
scripts/local_testnet/bootnode.sh
Executable file
33
scripts/local_testnet/bootnode.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# Generates a bootnode enr and saves it in $TESTNET/boot_enr.yaml
|
||||
# Starts a bootnode from the generated enr.
|
||||
#
|
||||
|
||||
source ./vars.env
|
||||
|
||||
echo "Generating bootnode enr"
|
||||
|
||||
lcli \
|
||||
generate-bootnode-enr \
|
||||
--ip 127.0.0.1 \
|
||||
--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"
|
||||
|
||||
DEBUG_LEVEL=${1:-info}
|
||||
|
||||
echo "Starting bootnode"
|
||||
|
||||
exec lighthouse boot_node \
|
||||
--testnet-dir $TESTNET_DIR \
|
||||
--port $BOOTNODE_PORT \
|
||||
--listen-address 127.0.0.1 \
|
||||
--network-dir $DATADIR/bootnode \
|
||||
Reference in New Issue
Block a user