diff --git a/cronos/cometbft.Dockerfile b/cronos/cometbft.Dockerfile index ee2752f7..05f88016 100644 --- a/cronos/cometbft.Dockerfile +++ b/cronos/cometbft.Dockerfile @@ -1,11 +1,21 @@ -ARG CRONOS_CRONOS_IMAGE +# cronosd — public GitHub release tarball (ghcr.io/crypto-org-chain/cronos returns 403 +# on anonymous pulls). Mirror zero-gravity/zerog.Dockerfile: alpine base + tarball extract. +ARG CRONOS_CRONOS_VERSION=v1.7.8 + +FROM alpine:3.21 + +RUN apk add --no-cache ca-certificates curl jq + ARG CRONOS_CRONOS_VERSION -FROM ${CRONOS_CRONOS_IMAGE}:${CRONOS_CRONOS_VERSION} -# Layer the shared CometBFT bootstrap lib + the chain init.sh onto the upstream -# cronos binary image (alpine-based, has sh+apk; runs nonroot by default — the compose -# sets user: root so init.sh can apk-add curl and write the /root home). -USER root +RUN _ver="${CRONOS_CRONOS_VERSION#v}" && \ + curl -fsSL "https://github.com/crypto-org-chain/cronos/releases/download/${CRONOS_CRONOS_VERSION}/cronos_${_ver}_Linux_x86_64.tar.gz" \ + -o /tmp/cronos.tar.gz && \ + tar -xzf /tmp/cronos.tar.gz -C /tmp && \ + install -m 755 /tmp/bin/cronosd /usr/local/bin/cronosd && \ + rm -rf /tmp/cronos.tar.gz /tmp/bin + COPY ./scripts/cometbft-common.sh /usr/local/bin/cometbft-common.sh COPY ./scripts/init.sh /usr/local/bin/init.sh RUN chmod +x /usr/local/bin/init.sh /usr/local/bin/cometbft-common.sh + ENTRYPOINT ["init.sh"] diff --git a/cronos/scripts/init.sh b/cronos/scripts/init.sh index f19b931f..093b5067 100644 --- a/cronos/scripts/init.sh +++ b/cronos/scripts/init.sh @@ -11,7 +11,8 @@ 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}" +STATESYNC_RPC="${STATESYNC_RPC:-https://cronos-rpc.publicnode.com:443}" +MIN_GAS="${MIN_GAS:-5000000000000basecro}" PRUNING="${PRUNING:-custom}" PRUNING_KEEP_RECENT="${PRUNING_KEEP_RECENT:-100}" PRUNING_INTERVAL="${PRUNING_INTERVAL:-19}" @@ -29,6 +30,7 @@ if cronosd init "${MONIKER:-rpc-node}" --chain-id "$CHAINID" --home "$HOME_DIR" ct_log "fresh init; fetching genesis" ct_fetch "$GENESIS_URL" "$CONFIG_DIR/genesis.json" required ct_localize_home "$CONFIG_DIR" + ct_set_min_gas_prices "$CONFIG_DIR/app.toml" "$MIN_GAS" else ct_log "already initialized, continuing" fi @@ -54,4 +56,4 @@ ct_merge_seeds "$CONFIG_DIR/config.toml" "$SEEDS" 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" "$@" +exec cronosd start --chain-id "$CHAINID" --minimum-gas-prices "$MIN_GAS" "$@"