From 589d47b9a49a24ee526611c5014a76a311bcedc3 Mon Sep 17 00:00:00 2001 From: Mavrik Date: Wed, 28 Feb 2024 08:58:26 +0100 Subject: [PATCH 1/2] fix: added http flags to vc and bn so testnet can allow siren --- scripts/local_testnet/beacon_node.sh | 3 +++ scripts/local_testnet/validator_client.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scripts/local_testnet/beacon_node.sh b/scripts/local_testnet/beacon_node.sh index 2660dfa3c00..8594f79ab29 100755 --- a/scripts/local_testnet/beacon_node.sh +++ b/scripts/local_testnet/beacon_node.sh @@ -61,6 +61,9 @@ exec $lighthouse_binary \ --enr-tcp-port $tcp_port \ --enr-quic-port $quic_port \ --port $tcp_port \ + --gui \ + --http \ + --http-allow-origin "*" \ --quic-port $quic_port \ --http-port $http_port \ --disable-packet-filter \ diff --git a/scripts/local_testnet/validator_client.sh b/scripts/local_testnet/validator_client.sh index d88a1833cb5..a281300e1e9 100755 --- a/scripts/local_testnet/validator_client.sh +++ b/scripts/local_testnet/validator_client.sh @@ -31,4 +31,7 @@ exec lighthouse \ --init-slashing-protection \ --beacon-nodes ${@:$OPTIND+1:1} \ --suggested-fee-recipient 0x690B9A9E9aa1C9dB991C7721a92d351Db4FaC990 \ + --http \ + --http-allow-origin "*" \ + --http-port ${@:$OPTIND+2:1} \ $VC_ARGS From 4ffaef99a52946b37b67df90bb6cad9fd48c981c Mon Sep 17 00:00:00 2001 From: Mavrik Date: Wed, 28 Feb 2024 08:58:42 +0100 Subject: [PATCH 2/2] fix: adjust grep and sed for mac os --- scripts/local_testnet/setup_time.sh | 6 +++--- scripts/local_testnet/start_local_testnet.sh | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/local_testnet/setup_time.sh b/scripts/local_testnet/setup_time.sh index 21a8ae7ac15..6710246b6c9 100755 --- a/scripts/local_testnet/setup_time.sh +++ b/scripts/local_testnet/setup_time.sh @@ -20,13 +20,13 @@ echo "slot_per_epoch=$SLOT_PER_EPOCH" genesis_file=$1 # Update future hardforks time in the EL genesis file based on the CL genesis time -GENESIS_TIME=$(lcli pretty-ssz --spec $SPEC_PRESET --testnet-dir $TESTNET_DIR BeaconState $TESTNET_DIR/genesis.ssz | jq | grep -Po 'genesis_time": "\K.*\d') +GENESIS_TIME=$(lcli pretty-ssz --spec $SPEC_PRESET --testnet-dir $TESTNET_DIR BeaconState $TESTNET_DIR/genesis.ssz | jq | ggrep -Po 'genesis_time": "\K.*\d') echo $GENESIS_TIME CAPELLA_TIME=$((GENESIS_TIME + (CAPELLA_FORK_EPOCH * $SLOT_PER_EPOCH * SECONDS_PER_SLOT))) echo $CAPELLA_TIME -sed -i 's/"shanghaiTime".*$/"shanghaiTime": '"$CAPELLA_TIME"',/g' $genesis_file +sed -i '' 's/"shanghaiTime".*$/"shanghaiTime": '"$CAPELLA_TIME"',/g' "$genesis_file" CANCUN_TIME=$((GENESIS_TIME + (DENEB_FORK_EPOCH * $SLOT_PER_EPOCH * SECONDS_PER_SLOT))) echo $CANCUN_TIME -sed -i 's/"cancunTime".*$/"cancunTime": '"$CANCUN_TIME"',/g' $genesis_file +sed -i '' 's/"cancunTime".*$/"cancunTime": '"$CANCUN_TIME"',/g' "$genesis_file" cat $genesis_file diff --git a/scripts/local_testnet/start_local_testnet.sh b/scripts/local_testnet/start_local_testnet.sh index 512b1e98d16..9c414dc595d 100755 --- a/scripts/local_testnet/start_local_testnet.sh +++ b/scripts/local_testnet/start_local_testnet.sh @@ -118,6 +118,7 @@ sleeping 1 # Start beacon nodes BN_udp_tcp_base=9000 BN_http_port_base=8000 +VC_http_port_base=10000 EL_base_network=7000 EL_base_http=6000 @@ -132,8 +133,8 @@ done sleeping 20 # Reset the `genesis.json` config file fork times. -sed -i 's/"shanghaiTime".*$/"shanghaiTime": 0,/g' $genesis_file -sed -i 's/"cancunTime".*$/"cancunTime": 0,/g' $genesis_file +sed -i '' 's/"shanghaiTime".*$/"shanghaiTime": 0,/g' "$genesis_file" +sed -i '' 's/"cancunTime".*$/"cancunTime": 0,/g' "$genesis_file" for (( bn=1; bn<=$BN_COUNT; bn++ )); do secret=$DATADIR/geth_datadir$bn/geth/jwtsecret @@ -143,7 +144,7 @@ done # Start requested number of validator clients for (( vc=1; vc<=$VC_COUNT; vc++ )); do - execute_command_add_PID validator_node_$vc.log ./validator_client.sh $BUILDER_PROPOSALS -d $DEBUG_LEVEL $DATADIR/node_$vc http://localhost:$((BN_http_port_base + $vc)) + execute_command_add_PID validator_node_$vc.log ./validator_client.sh $BUILDER_PROPOSALS -d $DEBUG_LEVEL $DATADIR/node_$vc http://localhost:$((BN_http_port_base + $vc)) $((VC_http_port_base + $vc)) done echo "Started!"