Skip to content

feat: combine NU7 join into one script that downloads released binaries#4

Merged
evan-forbes merged 3 commits into
mainfrom
join-script-prebuilt-binaries
Jun 5, 2026
Merged

feat: combine NU7 join into one script that downloads released binaries#4
evan-forbes merged 3 commits into
mainfrom
join-script-prebuilt-binaries

Conversation

@evan-forbes

Copy link
Copy Markdown
Collaborator

What

Joining the NU7 testnet previously took two scripts: a downloader wrapper (in the zebra fork) and a join script generated by kresko join-bundle and embedded in each bundle, which git cloned + cargo buildd both Zebra and kresko from source on the host.

This combines them into one committed scriptscripts/join-nu7-testnet.sh — and switches to the prebuilt binaries we now publish on releases.

Changes

  • scripts/join-nu7-testnet.sh (new): downloads the join bundle, validates its hashes, then downloads and checksum-verifies the prebuilt zebrad (release tarball) and kresko (release binary) named in the bundle manifest, seeds local genesis, and starts zebrad (+ optional kresko mine). No rustup/cargo/clang/git — runtime deps shrink to curl jq tar tmux chrony python3 libstdc++6. Supports --mine, --miner-address, --foreground, --dry-run, and --zebra-*/--kresko-* overrides.
  • join_bundle.rs / main.rs: the bundle is now data-only (manifest, zebrad.join.toml, local_genesis/*); kresko join-bundle no longer emits a script (~480 lines of embedded template removed). The manifest and CLI carry release coordinates (--zebra-repo/--zebra-release-tag, --kresko-repo/--kresko-release-tag, defaulting to valargroup/zebra @ nu7-testnet-v0.1.0 and valargroup/kresko @ v0.1.0) instead of git URLs/refs. The script reads these from the manifest, so it stays version-independent.
  • release.yml: attaches join-nu7-testnet.sh as a release asset. (The v0.1.0 release already has it uploaded.)
  • docs/regenerate_join_bundle_example.md: rewritten for the binary flow.

Validation

  • 101 tests pass, including both join_bundle tests; release build compiles.
  • Script: bash -n clean; --dry-run validates a real bundle; tampered file rejected; overrides + missing-arg handling correct. Real release asset URLs + .sha256 formats verified against the script's checksum logic.
  • One pre-existing, unrelated test failure remains (pow_tuning::…equihash_params — the pinned NU7 Zebra rejects regtest Equihash params; that file is untouched here).

Notes

  • The companion zebra-fork cleanup (remove the obsolete wrappers, repoint the book join page at the kresko release asset) is a separate change in valargroup/zebra.
  • The actions/upload-artifact v5→v7 bump is intentionally not here — it stays in ci: bump actions/upload-artifact v5 → v7 (Node 24) #3.

🤖 Generated with Claude Code

Joining the NU7 testnet previously took two scripts: a downloader wrapper (in
the zebra fork) and a join script generated by `kresko join-bundle` and embedded
in each bundle, which built Zebra and kresko from source on the host.

Combine them into a single committed script, scripts/join-nu7-testnet.sh, and
switch to prebuilt binaries:

- The script downloads the join bundle, validates its hashes, then downloads and
  checksum-verifies the prebuilt zebrad (release tarball) and kresko (release
  binary) named in the bundle manifest. No rustup/cargo/clang/git on the host;
  runtime deps shrink to curl/jq/tar/tmux/chrony/python3.
- The bundle is now data-only (manifest, zebrad.join.toml, local_genesis/*);
  `kresko join-bundle` no longer emits a script. Its manifest and CLI carry
  release coordinates (repo + tag) instead of git URLs/refs.
- The release workflow attaches join-nu7-testnet.sh as a release asset.
- docs/regenerate_join_bundle_example.md updated for the binary flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
evan-forbes and others added 2 commits May 21, 2026 10:04
The join bundle is run-specific (genesis + live bootstrap-peer IPs), so it can't
be built by the release CI. Add an operator one-shot:

  scripts/publish-join-bundle.sh --run-dir <dir> [--tag v0.1.0]

It runs `kresko join-bundle`, compresses to nu7-join-bundle.tar.gz (+ .sha256),
validates it with `join-nu7-testnet.sh --dry-run`, and `gh release upload`s it
(--clobber). Gives joiners a stable --bundle-url on the release. Defaults to
valargroup/kresko @ v0.1.0; --skip-upload builds without uploading; args after
`--` forward to `kresko join-bundle`.

docs/regenerate_join_bundle_example.md documents this as the primary publish
path and points the join examples at the release bundle URL.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- join-nu7-testnet.sh resets any prior NU7 join install before seeding (stops
  nu7-zebrad/nu7-mine, kills zebrad/kresko, clears /opt/nu7-testnet + logs +
  configs), guarded against removing "" or "/", so a host can be re-joined
  without manual cleanup.
- publish-join-bundle.sh uploads join-nu7-testnet.sh alongside the bundle by
  default (--skip-script-upload / --join-script to control), so republishing a
  bundle keeps the script in sync.
- Bump the default --zebra-release-tag to nu7-testnet-v0.1.1 (matches the live
  bundle on the release) so regenerating a bundle no longer downgrades zebrad.
- docs updated for the rerun behavior and the v0.1.1 tag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@evan-forbes
evan-forbes merged commit 512814a into main Jun 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant