Files
zeekay 072311fef2 feat: Update Lux SDK with working mainnet boot and clean architecture
- Implement network management with mainnet/testnet/local support
- Add blockchain builder for L1/L2/L3 chains with multiple VM types
- Create P-Chain, C-Chain, X-Chain managers with mock implementations
- Fix bech32 encoding using btcsuite library (all crypto tests pass)
- Clean up dependencies and remove non-existent package references
- Archive old incompatible code to .archive/ directory
- Add working mainnet boot example (21 validators, 3 chains)
- Configure CI/CD pipeline with Go 1.24.5
- Add golangci-lint and goreleaser configurations
- Achieve 100% test pass rate across all packages

This SDK now provides a clean foundation for Lux blockchain development
with mock implementations ready for integration with actual node software.
2025-08-04 01:20:21 -05:00

1.7 KiB

Lux Mainnet Boot Example

This example demonstrates how to boot a Lux mainnet using the Lux SDK.

Features

  • Creates a mainnet network configuration with 21 validators
  • Deploys the core Lux chains:
    • P-Chain (Platform Chain) - For staking and validation
    • C-Chain (Contract Chain) - EVM-compatible smart contracts
    • X-Chain (Exchange Chain) - Asset management and trading

Prerequisites

  • Go 1.22 or higher
  • Lux SDK (parent directory)

Building

go build -o boot-mainnet main.go

Running

./boot-mainnet

Output

The application will:

  1. Create a mainnet network with 21 validator nodes
  2. Deploy P-Chain, C-Chain, and X-Chain
  3. Display network and chain information
  4. Keep running until interrupted (Ctrl+C)

Example Output

Booting Lux Mainnet...
Network ID: 96369
API Endpoint: https://api.mainnet.lux.network

Mainnet created:
- ID: network-1754286981765854000-0
- Name: lux-mainnet
- Type: mainnet
- Status: running
- Nodes: 21

Validator Nodes:
1. NodeID-0 - healthy (Stake: 2000 LUX)
...
21. NodeID-20 - healthy (Stake: 2000 LUX)

=== Lux Mainnet Boot Summary ===
Network: lux-mainnet (ID: network-1754286981765854000-0)
Status: running
Validators: 21
Chains deployed: 3
- P-Chain: ae0213a9b00f3aa151ff0a587f146755d78574ecfc3b7111383744fed14f9040
- C-Chain: 6578589968a1f0c6f7063611d490ee0a05bec69c8dfa427704ab45f819c617e7
- X-Chain: e0792cf0941a8bf2e5640a86ff488d1fa1c86fca2677ad7726dc60dde585b3cc

Mainnet is running. Press Ctrl+C to shutdown...

Note

This is a mock implementation for demonstration purposes. In a real deployment, the SDK would interface with actual Lux node software through the netrunner client.