-
Notifications
You must be signed in to change notification settings - Fork 937
feat(scripts): fix bug about sed -i
#5169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0a283c3
7645a35
c0954c0
f120e68
566c45f
e566c29
b16a754
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,16 +20,21 @@ 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 | ||
| GENESIS_TIME=$(lcli pretty-ssz --spec $SPEC_PRESET --testnet-dir $TESTNET_DIR BeaconState $TESTNET_DIR/genesis.ssz | jq | sed -n 's/.*genesis_time": "\([0-9]*\).*/\1/p') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The original script outputs the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah, it doesn't work in my MacOS. |
||
| echo "GENESIS_TIME: $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 | ||
| echo "SHANGHAI_TIME: $CAPELLA_TIME" | ||
| sed 's/"shanghaiTime".*$/"shanghaiTime": '"$CAPELLA_TIME"',/g' $genesis_file > "/tmp/genesis.json" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the command not work in MacOS (I am not familiar with it)? The original script with option
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It also doesn't work in MacOS, so I have to change it. |
||
| mv "/tmp/genesis.json" $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 | ||
| PRAGUE_TIME=$((GENESIS_TIME + (ELECTRA_FORK_EPOCH * $SLOT_PER_EPOCH * SECONDS_PER_SLOT))) | ||
| echo $PRAGUE_TIME | ||
| sed -i 's/"pragueTime".*$/"pragueTime": '"$PRAGUE_TIME"',/g' $genesis_file | ||
| cat $genesis_file | ||
| echo "CANCUN_TIME: $CANCUN_TIME" | ||
| sed 's/"cancunTime".*$/"cancunTime": '"$CANCUN_TIME"',/g' $genesis_file > "/tmp/genesis.json" | ||
| mv "/tmp/genesis.json" $genesis_file | ||
|
|
||
|
|
||
| PRAGUE_TIME=$((GENESIS_TIME + (ELECTRA_FORK_EPOCH * $SLOT_PER_EPOCH * SECONDS_PER_SLOT))) | ||
| echo "PRAGUE_TIME: $PRAGUE_TIME" | ||
| sed 's/"pragueTime".*$/"pragueTime": '"$PRAGUE_TIME"',/g' $genesis_file > "/tmp/genesis.json" | ||
| mv "/tmp/genesis.json" $genesis_file | ||
Uh oh!
There was an error while loading. Please reload this page.