axionax Core – Build and Development Guide
Prerequisites
Required Software
- Rust (core): Main blockchain logic (PoPC consensus, state, crypto, network)
- Docker: For containerized deployment
- Python (deai): AI/ML modules
- TypeScript (sdk): Client & tools
- Git: Version control
Verify Installation
rustc --version
# Should output: rustc 1.7x.x or newer
docker --version
# Should output: Docker version 24.x.x ...Building from Source
1. Clone the Repository
git clone https://github.com/axionaxprotocol/axionax-core.git
cd axionax-core2. Download Rust Dependencies
cargo fetch
# If using Python/ML: pip install -r deai/requirements.txt3. Build the Binary
Using Cargo:
cargo build --release --workspaceBuild with version info:
RUSTFLAGS="--cfg version=\"v1.6.0\"" cargo build --release --workspace4. Verify Build
./target/release/axionax-core --versionaxionax Core
Version: v1.6.0-testnet
Build Type: release
Building for Multiple Platforms
cargo build --release --target x86_64-unknown-linux-gnu
cargo build --release --target x86_64-apple-darwin
cargo build --release --target aarch64-apple-darwin
cargo build --release --target x86_64-pc-windows-gnuOr use Cargo Make (if using):
cargo make build-allDocker Build
Build Docker Image
docker build -t axionax-core:v1.6.0 .Run in Docker
docker run -p 8545:8545 -p 30303:30303 \
-v $(pwd)/data:/var/lib/axionax \
axionax-core:v1.6.0Using Docker Compose
docker compose up -dDevelopment
Running Tests
cargo test --workspace
# For Python ML: pytest deai/
# For typescript sdk: npm test --prefix sdk/Code Quality
cargo fmt --all
cargo clippy --all
# Python: black deai/
# TypeScript: npm run lint --prefix sdk/Development Mode
cargo run --bin axionax-node --features=dev
# live reload (Rust): cargo watch -x 'run --bin axionax-node'
# Python live reload: python -m deai.asr (with dev flags)
Hot Reload (dev example)
cargo install cargo-watch
cargo watch -x check -x test
Project Structure
axionax-core/
├── core/ # Rust main modules
├── deai/ # Python ML, fraud detection
├── sdk/ # TypeScript SDK
├── bridge/ # Rust↔Python/TS interop
├── docs/
├── docker/ # Docker & compose configs
├── Makefile # Build automation
├── Dockerfile
├── README.md
Common Issues
Rust Not Found
Solution: Install Rust from rustup.rs and add to PATH
Dependency Errors
cargo clean
cargo fetch
cargo build
Build Errors
cargo clean
cargo build
Docker Build Fails
docker builder prune
docker build --no-cache -t axionax-core:v1.6.0 .
IDE Setup
Visual Studio Code
- Install extensions: rust-analyzer, Docker, Python, TypeScript
- Example .vscode/settings.json:
{
"rust-analyzer.checkOnSave.command": "clippy",
"editor.formatOnSave": true,
"python.formatting.provider": "black"
}
JetBrains/CLion (Rust)
- Open project directory
- Auto-detect Rust and Python/TS modules
- Enable format on save in Settings
Performance Profiling
CPU Profiling
cargo bench
cargo test -- --nocapture --test-threads=1Memory Profiling
valgrind ./target/release/axionax-core
Benchmarking
cargo bench --workspace
Release Process
1. Update Version
Edit version in core/main.rs or use build flags.
2. Build Release Binaries
cargo build --release --workspace
3. Create Release Package
tar -czf axionax-core-v1.6.0-linux-amd64.tar.gz \
-C target/release axionax-core \
-C .. README.md LICENSE4. Generate Checksums
sha256sum target/release/axionax-core* > checksums.txtContributing
See CONTRIBUTING.md for workflow and guidelines.