This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
ant-node is the core P2P network node binary for the Autonomi ecosystem. It provides the decentralized storage and networking foundation using post-quantum cryptography.
# Build the project
cargo build --release
# Run all tests
cargo test
# Run with verbose output
cargo test -- --nocapture
# Format and lint
cargo fmt --all
cargo clippy --all-features -- -D clippy::panic -D clippy::unwrap_used -D clippy::expect_used# Run as bootstrap node (default port)
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- No
.unwrap()- Use?operator or.ok_or() - No
.expect()- Use.context()fromanyhow - No
panic!()- ReturnResultinstead - Exception: Test code may use these for assertions
Payment verification is always on — there is no way to disable it.
- All new chunk storage requires EVM payment verification on Arbitrum
- There is no
--disable-payment-verificationflag orenabledconfig field rewards_addressis required — node startup fails without one- Previously-paid chunks are cached and do not require re-verification
- Test code bypasses EVM by pre-populating the cache via
PaymentVerifier::cache_insert()(only available behind#[cfg(test)]or thetest-utilsfeature)
See src/payment/verifier.rs for implementation details.
Full infrastructure documentation is available at: docs/infrastructure/INFRASTRUCTURE.md
This includes:
- All 9 VPS nodes across 3 cloud providers (DigitalOcean, Hetzner, Vultr)
- Bootstrap node endpoints and IP addresses
- Firewall configurations and SSH access
- Systemd service templates
Production ant-node instances use UDP port range 10000-10999 exclusively.
| Service | UDP Port Range | Default | Description |
|---|---|---|---|
| ant-quic | 9000-9999 | 9000 | QUIC transport layer |
| ant-node | 10000-10999 | 10000 | Core P2P network nodes (THIS PROJECT) |
| communitas | 11000-11999 | 11000 | Collaboration platform nodes |
| ant-node tests | 20000-60000 | random | E2E test isolation (local only) |
Note: The E2E test suite uses ports 20000-60000 with random allocation to prevent conflicts between parallel test runs and local development instances. Production deployments MUST use 10000-10999.
When testing or developing ant-node:
- ONLY use ports 10000-10999 for ant-node services
- NEVER kill processes on ports 9000-9999 or 11000-11999
- NEVER restart services outside our port range
- NEVER modify firewall rules for other port ranges
# 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 SERVICEsaorsa-2.saorsalabs.com:10000 (NYC - 142.93.199.50)
saorsa-3.saorsalabs.com:10000 (SFO - 147.182.234.192)
- Verify you're targeting ports 10000-10999 only
- Double-check service names contain "ant-node"
- Never run broad
pkillcommands that could affect other services
# 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"