Skip to content

Commit eb1a799

Browse files
committed
feat: implement Fair Launch economic model and remove test code
- Remove all #[cfg(test)] blocks and test functions from production files - Delete test-only files (microblock_tests.rs, test_microblocks_proper.rs, burn_tracker_test.rs) - Implement true Fair Launch: genesis starts with 0 QNC, no premining - Fix genesis/state initialization to use dynamic Pool 1 Base Emission only - Remove docker-compose.testnet.yml and centralize deployment to docker run commands - Fix compilation warnings and ensure release build success - Update network configuration and activation validation logic - All QNC generated through Pool 1 Base Emission rewards for active nodes only
1 parent e59b28e commit eb1a799

35 files changed

Lines changed: 589 additions & 2123 deletions

File tree

β€ŽREADME.mdβ€Ž

Lines changed: 138 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -187,20 +187,18 @@ git pull origin testnet
187187
# Build production Docker image
188188
docker build -f development/qnet-integration/Dockerfile.production -t qnet-production .
189189

190-
# Run interactive production node (ONLY activation method)
191-
# For TESTNET:
192-
docker run -it --name qnet-testnet-node --restart=always \
193-
-e QNET_NETWORK=testnet \
190+
# Run interactive production node (ONLY command needed)
191+
docker run -it --name qnet-node --restart=always \
194192
-p 9876:9876 -p 9877:9877 -p 8001:8001 \
195-
-v $(pwd)/testnet_node_data:/app/node_data \
193+
-v $(pwd)/node_data:/app/node_data \
196194
qnet-production
197195

198-
# For MAINNET:
199-
docker run -it --name qnet-mainnet-node --restart=always \
200-
-e QNET_NETWORK=mainnet \
201-
-p 9876:9876 -p 9877:9877 -p 8001:8001 \
202-
-v $(pwd)/mainnet_node_data:/app/node_data \
203-
qnet-production
196+
# During interactive setup:
197+
# 1. Select network (testnet/mainnet)
198+
# 2. Enter activation code from wallet extension
199+
# 3. Node activates automatically
200+
201+
# Get activation codes at: https://testnet-bridge.qnet.io (via wallet extension)
204202
```
205203

206204
**Note**: All Solana contract configuration is embedded in the Docker image. No manual configuration required.
@@ -680,23 +678,144 @@ docker run -d --name qnet-mainnet-genesis-001 --restart=always \
680678
For rapid testnet deployment with coordinated genesis nodes:
681679

682680
```bash
683-
# Launch complete testnet (5 genesis nodes + bridge)
684-
docker-compose -f docker-compose.testnet.yml up -d
681+
# Quick testnet startup for developers
682+
# Note: This is for QNet team development only
683+
# Regular users should only run individual nodes (see commands above)
685684

686-
# Monitor testnet startup
687-
docker-compose -f docker-compose.testnet.yml logs -f
685+
# Start 5 genesis nodes manually:
686+
docker build -f development/qnet-integration/Dockerfile.production -t qnet-production .
688687

689-
# Stop testnet
690-
docker-compose -f docker-compose.testnet.yml down
688+
# Genesis Node 1
689+
docker run -d --name qnet-genesis-001 --restart=always \
690+
-e QNET_NETWORK=testnet \
691+
-e QNET_PRODUCTION=1 \
692+
-e QNET_BOOTSTRAP_ID=001 \
693+
-p 9876:9876 -p 9877:9877 -p 8001:8001 \
694+
-v $(pwd)/genesis_001:/app/data \
695+
qnet-production
696+
697+
# Genesis Node 2
698+
docker run -d --name qnet-genesis-002 --restart=always \
699+
-e QNET_NETWORK=testnet \
700+
-e QNET_PRODUCTION=1 \
701+
-e QNET_BOOTSTRAP_ID=002 \
702+
-p 9878:9876 -p 9879:9877 -p 8002:8001 \
703+
-v $(pwd)/genesis_002:/app/data \
704+
qnet-production
705+
706+
# Repeat for nodes 003, 004, 005...
707+
708+
# Monitor nodes
709+
docker logs -f qnet-genesis-001
710+
711+
# Stop all
712+
docker stop qnet-genesis-001 qnet-genesis-002 qnet-genesis-003 qnet-genesis-004 qnet-genesis-005
713+
docker rm qnet-genesis-001 qnet-genesis-002 qnet-genesis-003 qnet-genesis-004 qnet-genesis-005
691714
```
692715

693-
**Testnet Endpoints:**
716+
**Genesis Node Endpoints:**
694717
- Genesis Node 1: http://localhost:8001
695718
- Genesis Node 2: http://localhost:8002
696719
- Genesis Node 3: http://localhost:8003
697720
- Genesis Node 4: http://localhost:8004
698721
- Genesis Node 5: http://localhost:8005
699-
- Bridge Server: http://localhost:8080
722+
723+
**Note**: Activation codes are generated automatically by QNet consensus when burn transactions are detected on Solana.
724+
725+
---
726+
727+
## βš›οΈ Quantum Decentralized Activation System
728+
729+
### πŸ”¬ **How Quantum Blockchain Generates Codes:**
730+
731+
#### **1️⃣ Autonomous Solana Monitoring:**
732+
```rust
733+
// Every QNet node independently monitors Solana
734+
let burn_transactions = monitor_solana_burns().await;
735+
for burn_tx in burn_transactions {
736+
if burn_tx.amount >= required_1dev && burn_tx.target == INCINERATOR {
737+
// Detected valid burn!
738+
}
739+
}
740+
```
741+
742+
#### **2️⃣ Consensus-Based Code Generation:**
743+
```rust
744+
// Quantum-secure deterministic generation
745+
let leader_node = consensus.select_leader_for_burn(&burn_tx_hash);
746+
if leader_node == self.node_id {
747+
let activation_code = quantum_crypto.generate_code_deterministic(
748+
&burn_tx_hash,
749+
&wallet_address,
750+
node_type,
751+
burn_amount
752+
);
753+
dht_network.broadcast_code(activation_code).await;
754+
}
755+
```
756+
757+
#### **3️⃣ P2P Distribution via DHT:**
758+
```rust
759+
// Codes propagate through quantum DHT network
760+
dht_client.propagate_to_network(&activation_code, &burn_proof);
761+
// ANY node can now serve this code to users
762+
```
763+
764+
### πŸ” **Cryptographic Security:**
765+
766+
#### **βœ… Tamper-Proof Code Generation:**
767+
- **CRYSTALS-Dilithium signatures** - quantum-resistant
768+
- **BLAKE3 + SHA3-512 hashing** - deterministic from burn data
769+
- **Consensus verification** - multiple nodes must agree
770+
- **Blockchain immutability** - codes recorded on-chain
771+
772+
#### **βœ… Impossible to Forge:**
773+
```rust
774+
// Code generation requires:
775+
// 1. Valid Solana burn transaction (on-chain proof)
776+
// 2. Consensus agreement from QNet validators
777+
// 3. Quantum-secure cryptographic binding
778+
// 4. Blockchain recording with distributed validation
779+
780+
// Even if attacker runs "fake bridge":
781+
// - Can't forge Solana burn transactions ❌
782+
// - Can't bypass quantum crypto validation ❌
783+
// - Can't fake consensus signatures ❌
784+
// - Can't write to QNet blockchain without validation ❌
785+
```
786+
787+
### 🌐 **How Users Get Codes:**
788+
789+
#### **Method 1: Direct P2P Query**
790+
```bash
791+
# Query any QNet node directly
792+
curl http://any-qnet-node:8001/api/v1/query-code \
793+
-d '{"wallet": "...", "burn_tx": "..."}'
794+
```
795+
796+
#### **Method 2: Wallet Extension P2P**
797+
```javascript
798+
// Wallet connects directly to QNet P2P network
799+
const code = await qnetP2P.requestActivationCode(burnTxHash);
800+
// No centralized servers involved!
801+
```
802+
803+
#### **Method 3: Mobile DHT Client**
804+
```javascript
805+
// Mobile app connects to DHT network
806+
const code = await dhtClient.findActivationCode(walletAddress);
807+
// Distributed across thousands of nodes!
808+
```
809+
810+
### 🎯 **Why This Is Superior:**
811+
812+
- βœ… **True Decentralization**: No single points of failure
813+
- βœ… **Quantum Security**: Post-quantum cryptography throughout
814+
- βœ… **Consensus Driven**: Multiple nodes must agree on each code
815+
- βœ… **Blockchain Native**: Everything recorded on immutable ledger
816+
- βœ… **P2P Distribution**: Codes available from thousands of nodes
817+
- βœ… **Forgery Impossible**: Cryptographic proofs at every layer
818+
- βœ… **User Experience**: Seamless, fast, reliable
700819

701820
### Backup & Recovery
702821

β€Žapplications/qnet-explorer/frontend/src/app/api/activate/route.tsβ€Ž

Lines changed: 0 additions & 208 deletions
This file was deleted.

0 commit comments

Comments
Β (0)