Skip to content

fix: extract bootstrap_peers.toml from archive during node add#36

Merged
jacderida merged 1 commit intorc-2026.4.1from
fix/extract-bootstrap-peers-from-archive
Apr 14, 2026
Merged

fix: extract bootstrap_peers.toml from archive during node add#36
jacderida merged 1 commit intorc-2026.4.1from
fix/extract-bootstrap-peers-from-archive

Conversation

@jacderida
Copy link
Copy Markdown
Contributor

@jacderida jacderida commented Apr 14, 2026

Summary

  • When ant node add downloads a node binary from a GitHub release archive, the
    bootstrap_peers.toml file that ships alongside the binary was being discarded during
    extraction. Without this file, nodes cannot discover production network peers on startup.
  • Updates extract_tar_gz and extract_zip to also extract bootstrap_peers.toml when present
    in the archive, caches it alongside the binary with a versioned name, and copies it into each
    node's data directory next to the binary.
  • Also checks for bootstrap_peers.toml next to local binaries when using --path.

Test plan

  • 130 unit tests pass (cargo test -p ant-core --lib)
  • New test extract_tar_gz_finds_bootstrap_peers verifies extraction from tar.gz archives
  • New test resolve_version_uses_cached_bootstrap_peers verifies cached bootstrap file lookup
  • Existing test extract_tar_gz_finds_binary updated to assert no bootstrap file when absent
  • Clippy clean, fmt clean

🤖 Generated with Claude Code

@jacderida jacderida changed the base branch from main to rc-2026.4.1 April 14, 2026 14:04
When adding nodes via `ant node add`, the binary is downloaded from a GitHub release archive and
placed in each node's data directory. However, the `bootstrap_peers.toml` file — which ships
alongside the binary in the same archive — was being discarded during extraction. Without this
file, nodes cannot discover production network peers on startup.

This updates the archive extraction to also extract `bootstrap_peers.toml` when present, cache it
alongside the binary with a versioned name, and copy it into each node's data directory next to
the binary.

- Update `extract_tar_gz` and `extract_zip` to extract `bootstrap_peers.toml` alongside the binary
- Cache the bootstrap file with a versioned name (e.g., `ant-node-0.3.4.bootstrap_peers.toml`)
- Copy bootstrap_peers.toml into each node's data directory during `add_nodes`
- Check for bootstrap_peers.toml next to local binaries in `resolve_local`
- Add `ResolvedBinary` and `ExtractionResult` structs for cleaner return types
- Add tests for bootstrap peers extraction and cached bootstrap peers resolution

Test results: 130 unit tests passed, all integration tests passed. Clippy and fmt clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jacderida jacderida force-pushed the fix/extract-bootstrap-peers-from-archive branch from 80cc682 to b3c93ec Compare April 14, 2026 14:06
@jacderida jacderida merged commit 5ee30a2 into rc-2026.4.1 Apr 14, 2026
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.

2 participants