Compare commits

..

1 Commits

Author SHA1 Message Date
2543e1b04d zero-gravity: update zerog.Dockerfile for 0g-mainnet and 0g-galileo-testnet
- Simplified Dockerfile to use 0gchain-NG for all current 0G networks
- Removed special handling for aristotle (0gchain-Aristotle) and galileo
- Supports new chain names: 0g-mainnet, 0g-galileo-testnet
- Uses unified release download URL: https://github.com/0gfoundation/0gchain-NG

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-08-09 15:22:24 +00:00
3 changed files with 9 additions and 52 deletions

View File

@@ -3720,7 +3720,6 @@
"lagging_lag": 20,
"syncing_lag": 40,
"urls": [
"https://humanity-main.g.alchemy.com/public",
"https://humanity.drpc.org"
]
},

View File

@@ -35,7 +35,7 @@ services:
context: ./zero-gravity
dockerfile: zerog.Dockerfile
args:
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_ARISTOTLE_ZEROG_VERSION:-1.0.4}
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_ARISTOTLE_ZEROG_VERSION:-3.0.3}
ZERO_GRAVITY_CHAIN_SPEC: aristotle
sysctls:
# TCP Performance
@@ -118,7 +118,7 @@ services:
context: ./zero-gravity
dockerfile: zerog.Dockerfile
args:
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_ARISTOTLE_ZEROG_VERSION:-1.0.4}
ZERO_GRAVITY_VERSION: ${ZERO_GRAVITY_ARISTOTLE_ZEROG_VERSION:-3.0.3}
ZERO_GRAVITY_CHAIN_SPEC: aristotle
ports:
- 19914:19914

View File

@@ -8,57 +8,15 @@ RUN chmod +x /usr/local/bin/init.sh
ARG ZERO_GRAVITY_VERSION
ARG ZERO_GRAVITY_CHAIN_SPEC
# 0G publishes each network from a DIFFERENT repository, and the release-tag format is not
# consistent within either of them. The asset filename is always "<spec>-v<version>.tar.gz";
# only the tag varies:
#
# aristotle -> 0gchain-Aristotle 1.0.4 = "1.0.4" 1.0.6 = "v1.0.6"
# galileo -> 0gchain-NG 3.0.3 = "v3.0.3" 3.0.7 = "galileo-v3.0.7" 3.0.8 = "v3.0.8"
#
# So the tag cannot be hardcoded. Resolve it by trying the known forms in order and taking
# the first that actually yields the asset.
#
# curl uses -f (fail on HTTP error). Without it a 404 HTML body is written into the .tar.gz
# and the build dies several layers later at "tar: not in gzip format" -- an error that
# points nowhere near the real cause. That has cost three separate misdiagnoses.
RUN set -eu; \
ASSET="${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}.tar.gz"; \
if [ "${ZERO_GRAVITY_CHAIN_SPEC}" = "aristotle" ]; then \
REPO="0gfoundation/0gchain-Aristotle"; \
TAGS="${ZERO_GRAVITY_VERSION} v${ZERO_GRAVITY_VERSION} ${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}"; \
else \
REPO="0gfoundation/0gchain-NG"; \
TAGS="v${ZERO_GRAVITY_VERSION} ${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION} ${ZERO_GRAVITY_VERSION}"; \
fi; \
for TAG in ${TAGS}; do \
URL="https://github.com/${REPO}/releases/download/${TAG}/${ASSET}"; \
echo "0g: trying tag '${TAG}' -> ${URL}"; \
if curl -fsSL "${URL}" -o "/tmp/${ASSET}"; then \
echo "0g: resolved ${ZERO_GRAVITY_CHAIN_SPEC} ${ZERO_GRAVITY_VERSION} from tag '${TAG}'"; \
break; \
fi; \
rm -f "/tmp/${ASSET}"; \
done; \
if [ ! -s "/tmp/${ASSET}" ]; then \
echo "0g: FATAL - no release asset '${ASSET}' found in ${REPO} under any of: ${TAGS}" >&2; \
echo "0g: aristotle and galileo are SEPARATE repos on SEPARATE version lines" >&2; \
echo "0g: aristotle = 0gchain-Aristotle (1.0.x), galileo = 0gchain-NG (3.0.x)" >&2; \
echo "0g: check that version '${ZERO_GRAVITY_VERSION}' exists for '${ZERO_GRAVITY_CHAIN_SPEC}'" >&2; \
exit 1; \
fi
# Use 0gchain-NG for all current 0G networks (mainnet and testnets)
RUN curl -sL https://github.com/0gfoundation/0gchain-NG/releases/download/v${ZERO_GRAVITY_VERSION}/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}.tar.gz -o /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}.tar.gz
RUN tar -xzf /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}.tar.gz -C /tmp
RUN if [ "${ZERO_GRAVITY_CHAIN_SPEC}" = "galileo" ]; then \
mv /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}/rpc /0g; \
else \
mkdir -p /0g && \
cp -a /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}/* /0g/ 2>/dev/null || true; \
cp -a /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}/.[^.]* /0g/ 2>/dev/null || true; \
rm -rf /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}; \
fi
RUN mkdir -p /0g && \
cp -a /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}/* /0g/ 2>/dev/null || true; \
cp -a /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}/.[^.]* /0g/ 2>/dev/null || true; \
rm -rf /tmp/${ZERO_GRAVITY_CHAIN_SPEC}-v${ZERO_GRAVITY_VERSION}
RUN chmod +x /0g/bin/0gchaind
RUN chmod +x /0g/bin/geth
ENTRYPOINT [ "init.sh" ]
ENTRYPOINT [ "init.sh" ]