Skip to content

Commit bd1be32

Browse files
authored
Support timestamp env var (#218)
1 parent 853ffe9 commit bd1be32

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

espresso/docker/op-geth/op-geth-init.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ if [ "$MODE" = "genesis" ]; then
1717
op-deployer inspect genesis --workdir /deployer --outfile /config/genesis.json $L2_CHAIN_ID
1818

1919
echo "Updating genesis timestamp..."
20-
dasel put -f /config/genesis.json -s .timestamp -v $(printf '0x%x\n' $(date +%s))
20+
# Use environment variable or fallback to the current time.
21+
GENESIS_TIMESTAMP=${GENESIS_TIMESTAMP:-$(printf '0x%x\n' $(date +%s))}
22+
dasel put -f /config/genesis.json -s .timestamp -v "$GENESIS_TIMESTAMP"
2123

2224
if [[ ! -f /config/jwt.txt ]]; then
2325
echo "Generating JWT token..."

0 commit comments

Comments
 (0)