-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update local testnet doc and parameters (#4749)
* update * revise link * update parameters * update doc * Update doc * add quic port * remove debug log * Fix el_bootnode not being killed * Fix time * Fix doc in manual creation of testnet * Update file * update api doc * Revert "update api doc" This reverts commit ed69574. * add git clone * Fix path * Fix path * Update scripts/local_testnet/setup_time.sh Co-authored-by: Jimmy Chen <jchen.tc@gmail.com> * Update scripts/local_testnet/README.md Co-authored-by: Jimmy Chen <jchen.tc@gmail.com> * Fix SLOT_PER_EPOCH that changes with mainnet or minimal * Embedded setup_time.sh in start_local_testnet.sh * fix slot per epoch constant * Add comment * Add CANCUN_TIME * Fix CANCUN_TIME constant 32 slots * Correct typo * chmod +x ./setup_time.sh --------- Co-authored-by: Jimmy Chen <jchen.tc@gmail.com>
- Loading branch information
1 parent
7fd9389
commit 1b8c0ed
Showing
6 changed files
with
111 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
priv_key="02fd74636e96a8ffac8e7b01b0de8dea94d6bcf4989513b38cf59eb32163ff91" | ||
source ./vars.env | ||
$EL_BOOTNODE_BINARY --nodekeyhex $priv_key | ||
exec $EL_BOOTNODE_BINARY --nodekeyhex $priv_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuo pipefail | ||
|
||
source ./vars.env | ||
|
||
# Function to output SLOT_PER_EPOCH for mainnet or minimal | ||
get_spec_preset_value() { | ||
case "$SPEC_PRESET" in | ||
mainnet) echo 32 ;; | ||
minimal) echo 8 ;; | ||
gnosis) echo 16 ;; | ||
*) echo "Unsupported preset: $SPEC_PRESET" >&2; exit 1 ;; | ||
esac | ||
} | ||
|
||
SLOT_PER_EPOCH=$(get_spec_preset_value $SPEC_PRESET) | ||
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') | ||
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 | ||
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 | ||
cat $genesis_file | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters