From 012a7f1639896a29cdc6ddd1411ef7a5b6908870 Mon Sep 17 00:00:00 2001 From: EnzinoBB Date: Mon, 26 Oct 2026 21:28:26 +0100 Subject: [PATCH] packaging: one package for full and pruned storage The packages differed only in config.ini: one package per build now holds config.ini (full, as the official release) and config.pruned.ini (pruned on LMDB), half the release size. The workflows that take the latest release's package accept the old and the new layout, and copy config.pruned.ini over config.ini where they run a pruned node. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/db-compare.yml | 4 ++-- .github/workflows/docker.yml | 4 ++-- .github/workflows/known-hosts.yml | 6 ++++-- .github/workflows/release.yml | 27 +++++++++++++-------------- .github/workflows/snapshot.yml | 6 ++++-- README.md | 2 +- ci/known-hosts/run-weekly.sh | 8 +++++--- docs/CHANGES.md | 4 +++- docs/differences.md | 6 ++++-- docs/storage.md | 4 ++-- packaging/make-package.sh | 28 +++++++++++++++------------- 11 files changed, 55 insertions(+), 44 deletions(-) diff --git a/.github/workflows/db-compare.yml b/.github/workflows/db-compare.yml index 4faa4b44e..3097152b2 100644 --- a/.github/workflows/db-compare.yml +++ b/.github/workflows/db-compare.yml @@ -125,9 +125,9 @@ jobs: echo "$TARGET_SEQ$TIMEOUT_MIN" | grep -qE '^[0-9]+$' || { echo "bad inputs"; exit 1; } tag=$(gh release list --repo "$GITHUB_REPOSITORY" --limit 50 --json tagName,isDraft \ --jq '[.[] | select(.isDraft | not) | .tagName | select(startswith("community-v"))][0]') - gh release download "$tag" --repo "$GITHUB_REPOSITORY" --pattern '*-linux-x64-full.tar.gz' --pattern SHA256SUMS + gh release download "$tag" --repo "$GITHUB_REPOSITORY" --pattern '*-linux-x64.tar.gz' --pattern '*-linux-x64-full.tar.gz' --pattern SHA256SUMS sha256sum -c --ignore-missing SHA256SUMS - tar -xzf *-linux-x64-full.tar.gz + tar -xzf "$(ls ./*-linux-x64.tar.gz ./*-linux-x64-full.tar.gz 2>/dev/null | head -1)" echo "package $tag" - name: Download node diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8b8bdbbf7..535de5112 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -44,9 +44,9 @@ jobs: run: | tag=$(gh release list --repo "$GITHUB_REPOSITORY" --limit 50 --json tagName,isDraft \ --jq '[.[] | select(.isDraft | not) | .tagName | select(startswith("community-v"))][0]') - gh release download "$tag" --repo "$GITHUB_REPOSITORY" --pattern '*-linux-x64-pruned.tar.gz' --pattern SHA256SUMS + gh release download "$tag" --repo "$GITHUB_REPOSITORY" --pattern '*-linux-x64.tar.gz' --pattern '*-linux-x64-pruned.tar.gz' --pattern SHA256SUMS sha256sum -c --ignore-missing SHA256SUMS - mkdir pkg && tar -xzf *-linux-x64-pruned.tar.gz -C pkg + mkdir pkg && tar -xzf "$(ls ./*-linux-x64.tar.gz ./*-linux-x64-pruned.tar.gz 2>/dev/null | head -1)" -C pkg echo "${tag#community-v}" > pkg/csnode/VERSION packaging/docker/build.sh pkg/csnode credits-node:smoke echo "built from $tag" diff --git a/.github/workflows/known-hosts.yml b/.github/workflows/known-hosts.yml index e96388e48..cbb7d85d6 100644 --- a/.github/workflows/known-hosts.yml +++ b/.github/workflows/known-hosts.yml @@ -66,9 +66,11 @@ jobs: --jq '[.[] | select(.isDraft | not) | .tagName | select(startswith("community-v"))][0]') fi echo "$tag" | grep -qE '^community-v[0-9A-Za-z._-]+$' || { echo "no community package release found ('$tag')"; exit 1; } - gh release download "$tag" --repo "$GITHUB_REPOSITORY" --pattern '*-linux-x64-pruned.tar.gz' --pattern SHA256SUMS + gh release download "$tag" --repo "$GITHUB_REPOSITORY" --pattern '*-linux-x64.tar.gz' --pattern '*-linux-x64-pruned.tar.gz' --pattern SHA256SUMS sha256sum -c --ignore-missing SHA256SUMS - tar -xzf *-linux-x64-pruned.tar.gz + tar -xzf "$(ls ./*-linux-x64.tar.gz ./*-linux-x64-pruned.tar.gz 2>/dev/null | head -1)" + # one package since community.14: the pruned configuration is config.pruned.ini + [ ! -f csnode/config.pruned.ini ] || cp csnode/config.pruned.ini csnode/config.ini echo "package $tag" # start from every peer we know: the shipped list, the last published one and the repository's diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 10ef804e1..401652b48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ name: Release -# Ready-to-run mainnet packages of the community node, in two variants that differ only in -# config.ini: full storage (as the official release) and pruned storage on LMDB. Each holds the node +# Ready-to-run mainnet packages of the community node, one for full and pruned storage: config.ini +# runs a full node (as the official release), config.pruned.ini a pruned one on LMDB. Each holds the node # built here, the contract executor of an EnzinoBB/contract-executor release, the JDK the official # release ships, and the official configuration files kept in packaging/mainnet. # @@ -185,14 +185,12 @@ jobs: - name: Packages run: | chmod +x compat/node - for variant in full pruned; do - packaging/make-package.sh "$variant" "$VERSION" build/client/node executor \ - jdk/java-11-openjdk-11.0.4 dist - PACKAGE_PLATFORM=glibc2.31 \ - PACKAGE_RUNS_ON="Linux x86-64 with glibc 2.31 or later (Ubuntu 20.04, Debian 11 and later)" \ - packaging/make-package.sh "$variant" "$VERSION" compat/node executor \ - jdk/java-11-openjdk-11.0.4 dist - done + packaging/make-package.sh "$VERSION" build/client/node executor \ + jdk/java-11-openjdk-11.0.4 dist + PACKAGE_PLATFORM=glibc2.31 \ + PACKAGE_RUNS_ON="Linux x86-64 with glibc 2.31 or later (Ubuntu 20.04, Debian 11 and later)" \ + packaging/make-package.sh "$VERSION" compat/node executor \ + jdk/java-11-openjdk-11.0.4 dist (cd dist && sha256sum *.tar.gz > SHA256SUMS && cat SHA256SUMS) ls -la dist @@ -214,7 +212,8 @@ jobs: - contract executor: EnzinoBB/contract-executor release ${EXECUTOR_TAG} - JDK: ojdkbuild 11.0.4, the one the official release ships - Full or pruned storage: the packages differ only in config.ini (pruned storage runs on LMDB). + One package for full and pruned storage: \`config.ini\` runs a full node, \`config.pruned.ini\` a pruned one on LMDB + (\`./node --config-file config.pruned.ini\`). Two builds of the same code: \`linux-x64\` needs glibc 2.38 (Ubuntu 24.04, Debian 13 and later); \`linux-x64-glibc2.31\` runs on Ubuntu 20.04, Debian 11 and later. See README-COMMUNITY.txt inside each package. Verify with SHA256SUMS. @@ -229,8 +228,8 @@ jobs: --title "Community node $VERSION" --notes-file notes.md fi - # the Docker image of the pruned package (the image chooses full or pruned at its first start, so - # the package variant only provides the binaries and the configuration template) + # the Docker image of the package (the image chooses full or pruned at its first start: the + # package provides the binaries and the configuration template) image: name: Docker image needs: package @@ -256,7 +255,7 @@ jobs: - name: Build image run: | mkdir pkg - tar -xzf dist/credits-node-${VERSION}-linux-x64-pruned.tar.gz -C pkg + tar -xzf dist/credits-node-${VERSION}-linux-x64.tar.gz -C pkg echo "$VERSION" > pkg/csnode/VERSION packaging/docker/build.sh pkg/csnode "$IMAGE:$VERSION" docker image ls "$IMAGE" diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 142710398..fab8f88ec 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -60,9 +60,11 @@ jobs: fi tag=$(gh release list --repo "$GITHUB_REPOSITORY" --limit 50 --json tagName,isDraft \ --jq '[.[] | select(.isDraft | not) | .tagName | select(startswith("community-v"))][0]') - gh release download "$tag" --repo "$GITHUB_REPOSITORY" --pattern '*-linux-x64-pruned.tar.gz' --pattern SHA256SUMS + gh release download "$tag" --repo "$GITHUB_REPOSITORY" --pattern '*-linux-x64.tar.gz' --pattern '*-linux-x64-pruned.tar.gz' --pattern SHA256SUMS sha256sum -c --ignore-missing SHA256SUMS - tar -xzf *-linux-x64-pruned.tar.gz + tar -xzf "$(ls ./*-linux-x64.tar.gz ./*-linux-x64-pruned.tar.gz 2>/dev/null | head -1)" + # one package since community.14: the pruned configuration is config.pruned.ini + [ ! -f csnode/config.pruned.ini ] || cp csnode/config.pruned.ini csnode/config.ini echo "${tag#community-v}" > csnode/VERSION sed -i 's/^executor_multi_instance=.*/executor_multi_instance=true/' csnode/config.ini python3 ci/testnet/gen_keys.py 1 keys >/dev/null diff --git a/README.md b/README.md index e797ceb5c..d4cc3165b 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ This repository is the community continuation of [CREDITSCOM/node](https://githu | Every change, pull request by pull request | [docs/CHANGES.md](docs/CHANGES.md) | | Block database, pruned storage, conversion | [docs/storage.md](docs/storage.md) | | Docker (pruned node from a snapshot) | [packaging/docker/README.md](packaging/docker/README.md) | -| Packages (full and pruned, Linux x86-64) | [Releases](https://github.com/EnzinoBB/node/releases) | +| Packages (Linux x86-64; one package, `config.ini` full and `config.pruned.ini` pruned) | [Releases](https://github.com/EnzinoBB/node/releases) | Replacing the official binaries with the community ones, with the official `config.ini`, keeps the same BerkeleyDB database and the same behaviour on the network. The new features (other block databases, pruned storage, conversion) are opt-in. diff --git a/ci/known-hosts/run-weekly.sh b/ci/known-hosts/run-weekly.sh index 136dae04d..81065aecc 100755 --- a/ci/known-hosts/run-weekly.sh +++ b/ci/known-hosts/run-weekly.sh @@ -36,10 +36,12 @@ cd "$WORK/run" tag=$(gh release list --repo "$REPO" --limit 50 --json tagName,isDraft \ --jq '[.[] | select(.isDraft | not) | .tagName | select(startswith("community-v"))][0]') echo "$tag" | grep -qE '^community-v[0-9A-Za-z._-]+$' || { echo "no community release found"; exit 1; } -gh release download "$tag" --repo "$REPO" --pattern '*-linux-x64-pruned.tar.gz' --pattern SHA256SUMS +gh release download "$tag" --repo "$REPO" --pattern '*-linux-x64.tar.gz' --pattern '*-linux-x64-pruned.tar.gz' --pattern SHA256SUMS sha256sum -c --ignore-missing SHA256SUMS -tar -xzf ./*-linux-x64-pruned.tar.gz -rm -f ./*-linux-x64-pruned.tar.gz +tar -xzf "$(ls ./*-linux-x64.tar.gz ./*-linux-x64-pruned.tar.gz 2>/dev/null | head -1)" +rm -f ./*-linux-x64.tar.gz ./*-linux-x64-pruned.tar.gz +# one package since community.14: the pruned configuration is config.pruned.ini +[ ! -f csnode/config.pruned.ini ] || cp csnode/config.pruned.ini csnode/config.ini echo "package $tag" # start from every peer we know: the shipped list, the last published one and the repository's diff --git a/docs/CHANGES.md b/docs/CHANGES.md index 7b8d038aa..eb41fd706 100644 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -35,7 +35,9 @@ lines under the new release. ## Not released yet -Nothing yet. +| PR | Change | +|---|---| +| #113 | packaging: one package per build for full and pruned storage (`config.ini` full, `config.pruned.ini` pruned on LMDB), half the release size; the workflows that take the latest package accept both layouts | ## community.13 — 2026-10-26 diff --git a/docs/differences.md b/docs/differences.md index d4670b396..c92fba44e 100644 --- a/docs/differences.md +++ b/docs/differences.md @@ -225,7 +225,8 @@ rounds for both). ## Packages and Docker -- **Release packages.** Each release has full and pruned packages, in two builds: +- **Release packages.** Each release has one package for full and pruned storage (until + community.13, a full and a pruned package), in two builds: - `linux-x64` needs glibc 2.38 (Ubuntu 24.04, Debian 13 and later); - `linux-x64-glibc2.31` runs on Ubuntu 20.04, Debian 11 and later. @@ -239,7 +240,8 @@ rounds for both). (`skip block validation`) and stored, instead of stopping the node at it for good. See "Contract states while syncing"; - `sync_contract_execution=true` (the default), with a comment; - - the pruned package adds a `[storage]` section. + - next to it, `config.pruned.ini` is the same file with a `[storage]` section for pruned storage + on LMDB: `./node --config-file config.pruned.ini`. The executor listens on 127.0.0.1 only. - **Known hosts.** `known_hosts.txt` is refreshed weekly from a verified list of seed nodes. diff --git a/docs/storage.md b/docs/storage.md index 0a404c5cd..3df66e8f9 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -41,7 +41,7 @@ official node. | Backend | Use it for | Notes | |---|---|---| | `berkeleydb` | A folder the official node must also be able to open | The official node's format. Its block table does not reuse the space of pruned blocks, so it is a poor fit for pruned storage. A pruned database cannot be converted to it. | -| `lmdb` | Pruned nodes (the pruned package and Docker default) | Reuses the space of removed blocks; `data.mdb` never shrinks. | +| `lmdb` | Pruned nodes (`config.pruned.ini` of the package, and the Docker default) | Reuses the space of removed blocks; `data.mdb` never shrinks. | | `rocksdb` | The smallest full node | Compressed: about a third of the berkeleydb size on mainnet (9.6 GB to 3.1 GB on the first 4.4 M blocks). | The official node reads berkeleydb only. On a folder converted to another backend it would not @@ -53,7 +53,7 @@ Going from full to pruned keeps the database: set `prune_keep_blocks` and the ol removed at the next checkpoints. Going from pruned to full is not possible, the removed blocks are gone: start over from an empty `db/`. -The pruned package writes this section: +The package's `config.pruned.ini` has this section: ```ini [storage] diff --git a/packaging/make-package.sh b/packaging/make-package.sh index 0393a1415..39bdd050d 100755 --- a/packaging/make-package.sh +++ b/packaging/make-package.sh @@ -2,20 +2,20 @@ # Assemble a ready-to-run mainnet package of the community node, laid out like the official # release (csnode/ with the node, the contract executor, its JDK and the configuration). # -# Usage: make-package.sh [known_hosts] +# Usage: make-package.sh [known_hosts] # executor dir: holds contract-executor.jar and sc-api-support.jar # jdk dir: the java-11-openjdk-11.0.4 directory the release ships (the executor runs and # compiles contracts with it) # known_hosts: optional peer list to ship instead of packaging/mainnet/known_hosts.txt # -# Full and pruned packages hold the same binaries; only config.ini differs. Compared with the -# official config.ini: [event_report] is commented out (it reports node events to a fixed address), -# executor_commit_max accepts the community executor build, and the pruned package adds [storage]. +# One package for full and pruned storage: config.ini runs a full node (as the official release), +# config.pruned.ini the same with [storage] for pruned storage on LMDB. Compared with the official +# config.ini: [event_report] is commented out (it reports node events to a fixed address) and +# executor_commit_max accepts the community executor build. set -euo pipefail -variant=$1 version=$2 node=$3 executor=$4 jdk=$5 out=$6 hosts=${7:-} +version=$1 node=$2 executor=$3 jdk=$4 out=$5 hosts=${6:-} here=$(cd "$(dirname "$0")" && pwd) -case "$variant" in full|pruned) ;; *) echo "variant must be full or pruned" >&2; exit 2 ;; esac stage=$(mktemp -d) trap 'rm -rf "$stage"' EXIT @@ -40,8 +40,8 @@ awk -v commits="$commits" ' { print } ' "$here/mainnet/config.ini" > "$dir/config.ini" -if [ "$variant" = pruned ]; then - cat >> "$dir/config.ini" <<'INI' +cp "$dir/config.ini" "$dir/config.pruned.ini" +cat >> "$dir/config.pruned.ini" <<'INI' [storage] ; pruned storage: the node syncs from block 0 by itself and keeps only recent blocks @@ -51,10 +51,9 @@ checkpoint_keep=2 prune_keep_blocks=1000 block_db=lmdb INI -fi cat > "$dir/README-COMMUNITY.txt" <