From 0cbe8ba2e83702e1b9e17bbcfff5c228eac7e9f7 Mon Sep 17 00:00:00 2001 From: rob Date: Thu, 30 Jul 2026 07:12:00 +0000 Subject: [PATCH] build-image.sh: wire-correct version builds (tag-move so getVersion() exact-matches; dRPC edges track provider version strings) --- build-image.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 build-image.sh diff --git a/build-image.sh b/build-image.sh new file mode 100755 index 00000000..79c988b6 --- /dev/null +++ b/build-image.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# build-image.sh — build the StakeSquid dshackle fork image with a WIRE-CORRECT version. +# +# dRPC edges record each provider's dshackle version (Global.version, sent in every +# Describe response and SubscribeChainStatus BuildInfo) and deprioritize providers +# whose string doesn't match the expected release. gradle's getVersion() only yields +# the clean release string on an EXACT tag match; one patch commit past the tag would +# report "-SNAPSHOT" to every edge. So: force-move the base release tag onto the +# patch HEAD locally before building (never push that tag), which makes our build +# report exactly what stock drpcorg/dshackle: reports (verified against a +# live gateway: version.app=0.79.10). +# +# Usage: ./build-image.sh [base-tag] [suffix] +# base-tag: upstream release our branch is based on (default v0.79.10) +# suffix: local image tag suffix (default ss1) -> stakesquid/dshackle:- +# +# Per upstream release: rebase reload-removal onto the new tag, bump the default here, +# rerun. Distribute with: docker save stakesquid/dshackle:- | ssh docker load +set -euo pipefail +cd "$(dirname "$0")" +BASE_TAG=${1:-v0.79.10} +SUFFIX=${2:-ss1} +VER=${BASE_TAG#v} + +git tag -f "$BASE_TAG" HEAD >/dev/null # local only - makes getVersion() exact-match +docker build -q -t drpc-dshackle . >/dev/null +export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-21-openjdk-amd64} +./gradlew jibDockerBuild -Djib.to.image="stakesquid/dshackle:${VER}-${SUFFIX}" -x test + +echo "--- wire version check (must equal stock ${VER}):" +docker run --rm --entrypoint cat "stakesquid/dshackle:${VER}-${SUFFIX}" \ + /app/resources/version.properties