cronos: build cronosd from GitHub release tarball; fix MIN_GAS and statesync RPC
GHCR image returns 403 on anonymous pulls — switch cometbft.Dockerfile to alpine + public v1.7.8 tarball. init.sh sets minimum-gas-prices (5000000000000basecro) and drops dead rpc-cronos.crypto.org statesync endpoint.
This commit was merged in pull request #32.
This commit is contained in:
@@ -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
|
ARG CRONOS_CRONOS_VERSION
|
||||||
FROM ${CRONOS_CRONOS_IMAGE}:${CRONOS_CRONOS_VERSION}
|
RUN _ver="${CRONOS_CRONOS_VERSION#v}" && \
|
||||||
# Layer the shared CometBFT bootstrap lib + the chain init.sh onto the upstream
|
curl -fsSL "https://github.com/crypto-org-chain/cronos/releases/download/${CRONOS_CRONOS_VERSION}/cronos_${_ver}_Linux_x86_64.tar.gz" \
|
||||||
# cronos binary image (alpine-based, has sh+apk; runs nonroot by default — the compose
|
-o /tmp/cronos.tar.gz && \
|
||||||
# sets user: root so init.sh can apk-add curl and write the /root home).
|
tar -xzf /tmp/cronos.tar.gz -C /tmp && \
|
||||||
USER root
|
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/cometbft-common.sh /usr/local/bin/cometbft-common.sh
|
||||||
COPY ./scripts/init.sh /usr/local/bin/init.sh
|
COPY ./scripts/init.sh /usr/local/bin/init.sh
|
||||||
RUN chmod +x /usr/local/bin/init.sh /usr/local/bin/cometbft-common.sh
|
RUN chmod +x /usr/local/bin/init.sh /usr/local/bin/cometbft-common.sh
|
||||||
|
|
||||||
ENTRYPOINT ["init.sh"]
|
ENTRYPOINT ["init.sh"]
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ CHAINID="${CHAINID:-cronosmainnet_25-1}"
|
|||||||
API="${API:-eth,txpool,net,debug,web3}"
|
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}"
|
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}"
|
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="${PRUNING:-custom}"
|
||||||
PRUNING_KEEP_RECENT="${PRUNING_KEEP_RECENT:-100}"
|
PRUNING_KEEP_RECENT="${PRUNING_KEEP_RECENT:-100}"
|
||||||
PRUNING_INTERVAL="${PRUNING_INTERVAL:-19}"
|
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_log "fresh init; fetching genesis"
|
||||||
ct_fetch "$GENESIS_URL" "$CONFIG_DIR/genesis.json" required
|
ct_fetch "$GENESIS_URL" "$CONFIG_DIR/genesis.json" required
|
||||||
ct_localize_home "$CONFIG_DIR"
|
ct_localize_home "$CONFIG_DIR"
|
||||||
|
ct_set_min_gas_prices "$CONFIG_DIR/app.toml" "$MIN_GAS"
|
||||||
else
|
else
|
||||||
ct_log "already initialized, continuing"
|
ct_log "already initialized, continuing"
|
||||||
fi
|
fi
|
||||||
@@ -54,4 +56,4 @@ ct_merge_seeds "$CONFIG_DIR/config.toml" "$SEEDS"
|
|||||||
ct_configure_statesync "$CONFIG_DIR/config.toml" "$STATESYNC_RPC" 2000
|
ct_configure_statesync "$CONFIG_DIR/config.toml" "$STATESYNC_RPC" 2000
|
||||||
ct_set_moniker "$CONFIG_DIR/config.toml" "${MONIKER:-rpc-node}"
|
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" "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user