Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/db-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/known-hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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.
#
Expand Down Expand Up @@ -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

Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 5 additions & 3 deletions ci/known-hosts/run-weekly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion docs/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions docs/differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions docs/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
28 changes: 15 additions & 13 deletions packaging/make-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <full|pruned> <version> <node binary> <executor dir> <jdk dir> <out dir> [known_hosts]
# Usage: make-package.sh <version> <node binary> <executor dir> <jdk dir> <out dir> [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
Expand All @@ -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
Expand All @@ -51,18 +51,18 @@ checkpoint_keep=2
prune_keep_blocks=1000
block_db=lmdb
INI
fi

cat > "$dir/README-COMMUNITY.txt" <<EOF
Credits node, community build $version ($variant storage)
Credits node, community build $version

Built from https://github.com/EnzinoBB/node and https://github.com/EnzinoBB/contract-executor.
Node protocol version 532, compatible with the mainnet release 4.2.532.
Runs on: ${PACKAGE_RUNS_ON:-Linux x86-64 with glibc 2.38 or later (Ubuntu 24.04, Debian 13 and later)}.

Differences from the official package:
- config.ini: [event_report] is commented out; executor_commit_max=$commits accepts the
community executor (build $commits instead of 1518).$( [ "$variant" = pruned ] && printf '\n- config.ini: [storage] runs the node with pruned storage on LMDB.' )
community executor (build $commits instead of 1518).
- config.pruned.ini: the same with [storage] for pruned storage on LMDB (only recent blocks).
- The executor listens on 127.0.0.1 only (contract.executor.host in settings.properties
changes it). Keep port 9080 closed to other hosts anyway.
- The node itself: same protocol and database format by default, new opt-in storage options,
Expand All @@ -82,11 +82,13 @@ Changing the block database (db_backend)
only reads berkeleydb: convert back before running it on this folder. In Docker, use
CREDITS_CONVERT_DB=yes. Every [storage] setting and the conversion in detail: https://github.com/EnzinoBB/node/blob/master/docs/storage.md

Start: cd csnode && ./node
Start: cd csnode && ./node (full storage, as the official node)
or: cd csnode && ./node --config-file config.pruned.ini (pruned storage)
A pruned node can start from the published snapshot: ./node --config-file config.pruned.ini --download-snapshot
EOF

mkdir -p "$out"
# PACKAGE_PLATFORM names a build for another baseline, e.g. glibc2.31 for Ubuntu 20.04 and later
name="credits-node-$version-linux-x64${PACKAGE_PLATFORM:+-$PACKAGE_PLATFORM}-$variant.tar.gz"
name="credits-node-$version-linux-x64${PACKAGE_PLATFORM:+-$PACKAGE_PLATFORM}.tar.gz"
tar -C "$stage" --owner=0 --group=0 --sort=name -czf "$out/$name" csnode
echo "$out/$name"
Loading