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
174 changes: 12 additions & 162 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,19 @@ jobs:
- name: Create archive (Unix)
if: matrix.archive == 'tar.gz'
run: |
cp config/bootstrap_peers.toml target/${{ matrix.target }}/release/
cd target/${{ matrix.target }}/release
tar -czvf ../../../ant-node-cli-${{ matrix.friendly_name }}.tar.gz ${{ matrix.binary }} ant-keygen
tar -czvf ../../../ant-node-cli-${{ matrix.friendly_name }}.tar.gz ${{ matrix.binary }} ant-keygen bootstrap_peers.toml
cd ../../..

- name: Create archive (Windows)
if: matrix.archive == 'zip'
shell: pwsh
run: |
Compress-Archive -Path "target/${{ matrix.target }}/release/${{ matrix.binary }}", "target/${{ matrix.target }}/release/ant-keygen.exe" -DestinationPath "ant-node-cli-${{ matrix.friendly_name }}.zip"
Copy-Item "config/bootstrap_peers.toml" "target/${{ matrix.target }}/release/bootstrap_peers.toml"
Push-Location "target/${{ matrix.target }}/release"
Compress-Archive -Path "${{ matrix.binary }}", "ant-keygen.exe", "bootstrap_peers.toml" -DestinationPath "../../../ant-node-cli-${{ matrix.friendly_name }}.zip"
Pop-Location

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand All @@ -183,134 +187,9 @@ jobs:
path: ant-node-cli-${{ matrix.friendly_name }}.${{ matrix.archive }}
retention-days: 1

installers-linux:
name: Build Linux Installers
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Install cargo-deb
run: cargo install cargo-deb

- name: Install cargo-generate-rpm
run: cargo install cargo-generate-rpm

- name: Build release binaries
run: cargo build --release

- name: Build .deb package
run: cargo deb --no-build --output ant-node.deb

- name: Build .rpm package
run: cargo generate-rpm --output ant-node.rpm

- name: Upload .deb
uses: actions/upload-artifact@v4
with:
name: installer-deb
path: ant-node.deb
retention-days: 1

- name: Upload .rpm
uses: actions/upload-artifact@v4
with:
name: installer-rpm
path: ant-node.rpm
retention-days: 1

installers-windows:
name: Build Windows Installer
needs: [validate, build]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Build release binaries
run: cargo build --release --target x86_64-pc-windows-msvc

- name: Install WiX Toolset
run: |
choco install wixtoolset -y
echo "C:\Program Files (x86)\WiX Toolset v3.14\bin" >> $env:GITHUB_PATH

- name: Extract version from tag
id: version
shell: pwsh
run: |
$tag = "${{ needs.validate.outputs.version }}"
# Remove 'v' prefix and strip any pre-release suffix (e.g., -rc.1, -beta.2)
$version = $tag -replace '^v', '' -replace '-.*$', ''
# Ensure 4-part version for MSI (add .0 if needed)
$parts = $version.Split('.')
while ($parts.Length -lt 4) {
$version = "$version.0"
$parts = $version.Split('.')
}
echo "version=$version" >> $env:GITHUB_OUTPUT
echo "MSI Version: $version"

- name: Build MSI installer
shell: pwsh
run: |
# Create placeholder images if they don't exist
if (-not (Test-Path "wix\banner.bmp")) {
# Create a simple 493x58 banner
Add-Type -AssemblyName System.Drawing
$bmp = New-Object System.Drawing.Bitmap(493, 58)
$g = [System.Drawing.Graphics]::FromImage($bmp)
$g.Clear([System.Drawing.Color]::FromArgb(0, 120, 212))
$bmp.Save("wix\banner.bmp")
}
if (-not (Test-Path "wix\dialog.bmp")) {
# Create a simple 493x312 dialog
Add-Type -AssemblyName System.Drawing
$bmp = New-Object System.Drawing.Bitmap(493, 312)
$g = [System.Drawing.Graphics]::FromImage($bmp)
$g.Clear([System.Drawing.Color]::FromArgb(0, 120, 212))
$bmp.Save("wix\dialog.bmp")
}
if (-not (Test-Path "wix\ant.ico")) {
# Use a default icon
Copy-Item "C:\Windows\System32\shell32.dll" -Destination "wix\temp.dll"
Add-Type -AssemblyName System.Drawing
$icon = [System.Drawing.Icon]::ExtractAssociatedIcon("C:\Windows\System32\cmd.exe")
$stream = [System.IO.File]::Create("wix\ant.ico")
$icon.Save($stream)
$stream.Close()
}

# Create license.rtf if it doesn't exist
if (-not (Test-Path "wix\license.rtf")) {
$licenseText = Get-Content "LICENSE-MIT" -Raw
$rtfContent = "{\rtf1\ansi\deff0{\fonttbl{\f0 Consolas;}}\f0\fs20 " + ($licenseText -replace '\n', '\par ') + "}"
Set-Content -Path "wix\license.rtf" -Value $rtfContent
}

$version = "${{ steps.version.outputs.version }}"
candle.exe wix\main.wxs -o wix\main.wixobj -ext WixUIExtension -dProductVersion="$version"
light.exe wix\main.wixobj -o ant-node.msi -ext WixUIExtension

- name: Upload MSI
uses: actions/upload-artifact@v4
with:
name: installer-msi
path: ant-node.msi
retention-days: 1

sign:
name: Sign Releases
needs: [build, installers-linux, installers-windows]
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -339,7 +218,7 @@ jobs:

- name: Sign all release files
run: |
for file in artifacts/ant-node-cli-*.tar.gz artifacts/ant-node-cli-*.zip artifacts/*.deb artifacts/*.rpm artifacts/*.msi; do
for file in artifacts/ant-node-cli-*.tar.gz artifacts/ant-node-cli-*.zip; do
if [ -f "$file" ]; then
echo "Signing $file..."
./target/release/ant-keygen sign \
Expand All @@ -356,7 +235,7 @@ jobs:
- name: Generate checksums
run: |
cd artifacts
sha256sum ant-node-cli-* *.deb *.rpm *.msi 2>/dev/null > SHA256SUMS.txt || true
sha256sum ant-node-cli-* 2>/dev/null > SHA256SUMS.txt || true
cat SHA256SUMS.txt

- name: Upload signed artifacts
Expand Down Expand Up @@ -426,36 +305,13 @@ jobs:

**CLI Usage:**
```bash
# Linux/macOS
# Linux/macOS — extract and run (bootstrap peers auto-discovered)
tar -xzf ant-node-cli-linux-x64.tar.gz
./ant-node --testnet
./ant-node --rewards-address 0xYourAddress

# Windows (PowerShell)
Expand-Archive ant-node-cli-windows-x64.zip
.\ant-node.exe --testnet
```

### Service Installers (Automatic Startup)

Install as a system service with automatic startup:

| Platform | Download |
|----------|----------|
| Debian/Ubuntu | `ant-node.deb` |
| RHEL/Fedora | `ant-node.rpm` |
| Windows | `ant-node.msi` |

**Service Installation:**
```bash
# Debian/Ubuntu
sudo dpkg -i ant-node.deb
sudo systemctl enable --now ant-node

# RHEL/Fedora
sudo rpm -i ant-node.rpm
sudo systemctl enable --now ant-node

# Windows: Run ant-node.msi installer
.\ant-node.exe --rewards-address 0xYourAddress
```

### Verification
Expand All @@ -477,12 +333,6 @@ jobs:
release/ant-node-cli-*.tar.gz
release/ant-node-cli-*.zip
release/ant-node-cli-*.sig
release/*.deb
release/*.rpm
release/*.msi
release/*.deb.sig
release/*.rpm.sig
release/*.msi.sig
release/SHA256SUMS.txt
draft: false
prerelease: ${{ needs.validate.outputs.is_prerelease }}
Expand Down
29 changes: 5 additions & 24 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ cargo run --release -- --listen 0.0.0.0:10000 --bootstrap
# Run additional instance (use any port in range 10000-10999)
cargo run --release -- --listen 0.0.0.0:10001

# Run as regular node connecting to bootstrap
cargo run --release -- --listen 0.0.0.0:10000 --connect saorsa-2.saorsalabs.com:10000

# Run with debug logging
RUST_LOG=debug cargo run --release -- --listen 0.0.0.0:10000
```
Expand Down Expand Up @@ -97,31 +94,15 @@ When testing or developing ant-node:
# CORRECT - ant-node operations (within 10000-10999)
cargo run --release -- --listen 0.0.0.0:10000
cargo run --release -- --listen 0.0.0.0:10001 # Second instance OK
ssh root@saorsa-2.saorsalabs.com "systemctl restart ant-node-bootstrap"

# WRONG - Would disrupt other networks
ssh root@saorsa-2.saorsalabs.com "pkill -f ':9'" # NEVER - matches ant-quic ports
ssh root@saorsa-2.saorsalabs.com "pkill -f ':11'" # NEVER - matches communitas ports
ssh root@saorsa-2.saorsalabs.com "systemctl restart ant-quic-bootstrap" # NOT OUR SERVICE
```

### Bootstrap Endpoints (ant-node)
```
saorsa-2.saorsalabs.com:10000 (NYC - 142.93.199.50)
saorsa-3.saorsalabs.com:10000 (SFO - 147.182.234.192)
```
### Bootstrap Peers Configuration

Production bootstrap peer addresses are defined in `config/bootstrap_peers.toml`.
This file is shipped alongside the binary in release archives and is auto-discovered
on startup when no `--bootstrap` CLI argument is provided.

### Before Any VPS Operations
1. Verify you're targeting ports 10000-10999 only
2. Double-check service names contain "ant-node"
3. Never run broad `pkill` commands that could affect other services

### Deploy New Binary
```bash
# Build release binary
cargo build --release

# Deploy to bootstrap node
scp target/release/ant-node root@saorsa-2.saorsalabs.com:/opt/ant-node/
ssh root@saorsa-2.saorsalabs.com "systemctl restart ant-node-bootstrap"
```
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 0 additions & 37 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,40 +157,3 @@ unused_async = "allow"
cognitive_complexity = "allow"
# Allow non-const functions during initial development (may need runtime features later)
missing_const_for_fn = "allow"

# Debian package metadata (cargo-deb)
[package.metadata.deb]
maintainer = "David Irvine <david.irvine@maidsafe.net>"
copyright = "2024-2025 Autonomi"
license-file = ["LICENSE-MIT", "0"]
extended-description = """
Ant Node is a pure quantum-proof network node for the Autonomi decentralized network.
It provides secure, private, and censorship-resistant data storage using post-quantum
cryptography (ML-DSA-65, ML-KEM-768). Features include:
- Quantum-resistant authentication and encryption
- Distributed Hash Table (DHT) with anti-Sybil protection
- Automatic upgrades with staged rollout
- Bootstrap node support for testnet deployment
"""
section = "net"
priority = "optional"
assets = [
["target/release/ant-node", "usr/bin/", "755"],
["target/release/ant-keygen", "usr/bin/", "755"],
["README.md", "usr/share/doc/ant-node/", "644"],
]
conf-files = ["/etc/ant/config.toml"]
depends = "$auto"
systemd-units = { enable = true }

# RPM package metadata (cargo-generate-rpm)
[package.metadata.generate-rpm]
assets = [
{ source = "target/release/ant-node", dest = "/usr/bin/ant-node", mode = "755" },
{ source = "target/release/ant-keygen", dest = "/usr/bin/ant-keygen", mode = "755" },
{ source = "README.md", dest = "/usr/share/doc/ant-node/README.md", mode = "644" },
{ source = "systemd/ant-node.service", dest = "/usr/lib/systemd/system/ant-node.service", mode = "644" },
]

[package.metadata.generate-rpm.requires]
# Runtime dependencies auto-detected
Loading
Loading