Skip to content

Commit 744f1b6

Browse files
committed
document the purpose & usage of scripts/hardfork/create_runtime_config.sh
1 parent df4437b commit 744f1b6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

scripts/hardfork/create_runtime_config.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
#!/usr/bin/env bash
22

3+
# NOTE: This script patches the genesis timestamp of a fork config so a new
4+
# network could be schedueld to genesis in some instant in the future.
5+
36
set -eo pipefail
47

8+
# ==================== Inputs to this script ====================
9+
# The fork config we aim to patch on
510
FORK_CONFIG_JSON=${FORK_CONFIG_JSON:=fork_config.json}
11+
# The hashes file generated by runtime-genesis-ledger
612
LEDGER_HASHES_JSON=${LEDGER_HASHES_JSON:=ledger_hashes.json}
13+
# The "base" config file, needed to know the genesis time of the prefork network
714
FORKING_FROM_CONFIG_JSON=${FORKING_FROM_CONFIG_JSON:=genesis_ledgers/mainnet.json}
8-
9-
# If not given, the genesis timestamp is set to 10 mins into the future
15+
# Genesis timestamp of the postfork network, defaults to 10mins in the future
1016
GENESIS_TIMESTAMP=${GENESIS_TIMESTAMP:=$(date -u +"%Y-%m-%dT%H:%M:%SZ" -d "10 mins")}
1117

1218
# Pull the original genesis timestamp from the pre-fork config file
1319
ORIGINAL_GENESIS_TIMESTAMP=$(jq -r '.genesis.genesis_state_timestamp' "$FORKING_FROM_CONFIG_JSON")
1420
OFFSET=$(jq -r '.proof.fork.global_slot_since_genesis' "$FORKING_FROM_CONFIG_JSON")
21+
# ===============================================================
1522

1623
if [[ "$OFFSET" == null ]]; then
1724
OFFSET=0

0 commit comments

Comments
 (0)