From 361110f1ff9b3999f03e0cf39b2a1809dbe2e70d Mon Sep 17 00:00:00 2001 From: Claude Agent Date: Sat, 4 Jul 2026 04:10:27 +0000 Subject: [PATCH] cronos: wire init.sh pruning and statesync from context env Read STATESYNC_RPC and app.toml pruning tunables from environment (set by the generator from context.yml) instead of hardcoding them. --- cronos/scripts/init.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cronos/scripts/init.sh b/cronos/scripts/init.sh index deee82f8..f19b931f 100644 --- a/cronos/scripts/init.sh +++ b/cronos/scripts/init.sh @@ -11,6 +11,10 @@ CHAINID="${CHAINID:-cronosmainnet_25-1}" API="${API:-eth,txpool,net,debug,web3}" GENESIS_URL="${GENESIS_URL:-https://raw.githubusercontent.com/crypto-org-chain/cronos-mainnet/master/cronosmainnet_25-1/genesis.json}" SEEDS="${SEEDS:-0d5cf1394a1cfde28dc8f023567222abc0f47534@seed-0.cronos.com:26656,3032073adc06d710dd512240281637c1bd0c8a7b@seed-1.cronos.com:26656,04f43116b4c6c70054d9c2b7485383df5b1ed1da@seed-2.cronos.com:26656,337377dcda43d79c537d2c4d93ad3b698ce9452e@bd-cronos-mainnet-seed-node-01.bdnodes.net:26656}" +STATESYNC_RPC="${STATESYNC_RPC:-https://rpc-cronos.crypto.org:443,https://cronos-rpc.publicnode.com:443}" +PRUNING="${PRUNING:-custom}" +PRUNING_KEEP_RECENT="${PRUNING_KEEP_RECENT:-100}" +PRUNING_INTERVAL="${PRUNING_INTERVAL:-19}" JSON_RPC_ENABLE="${JSON_RPC_ENABLE:-true}" JSON_RPC_ENABLE_INDEXER="${JSON_RPC_ENABLE_INDEXER:-true}" JSON_RPC_FEEHISTORY_CAP="${JSON_RPC_FEEHISTORY_CAP:-100}" @@ -29,9 +33,9 @@ else ct_log "already initialized, continuing" fi -sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" "$CONFIG_DIR/app.toml" -sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" "$CONFIG_DIR/app.toml" -sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"19\"/" "$CONFIG_DIR/app.toml" +sed -i -e "s/^pruning *=.*/pruning = \"$PRUNING\"/" "$CONFIG_DIR/app.toml" +sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$PRUNING_KEEP_RECENT\"/" "$CONFIG_DIR/app.toml" +sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$PRUNING_INTERVAL\"/" "$CONFIG_DIR/app.toml" sed -i -e "s/^indexer *=.*/indexer = \"null\"/" "$CONFIG_DIR/config.toml" sed -i "/^\[json-rpc\]/,/^\[/{s|^address = .*|address = \"0.0.0.0:8545\"|}" "$CONFIG_DIR/app.toml" @@ -47,7 +51,7 @@ sed -i "/^\[evm\]/,/^\[/{s|^max-tx-gas-wanted = .*|max-tx-gas-wanted = $EVM_MAX_ ct_patch_p2p "$CONFIG_DIR/config.toml" "$IP" "${P2P_PORT:-10521}" ct_merge_seeds "$CONFIG_DIR/config.toml" "$SEEDS" -ct_configure_statesync "$CONFIG_DIR/config.toml" "https://rpc-cronos.crypto.org:443,https://cronos-rpc.publicnode.com:443" 2000 +ct_configure_statesync "$CONFIG_DIR/config.toml" "$STATESYNC_RPC" 2000 ct_set_moniker "$CONFIG_DIR/config.toml" "${MONIKER:-rpc-node}" exec cronosd start --chain-id "$CHAINID" "$@"