Devnet Deployment Guide
This guide covers deploying all components to Solana devnet for testing.
Prerequisites
- Solana CLI installed and configured for devnet
- PostgreSQL database running
- Redis server running
- Python 3.9+
- Rust and Cargo (for Solana program)
- CMake (for C++ workers)
1. Catacomb Underwriter Service (133x Scaling)
Location: catacomb-underwriter-service/
Steps:
cd catacomb-underwriter-service
# Create .env from example
cp .env.example .env
# Edit .env with your devnet credentials:
# - DATABASE_URL (PostgreSQL)
# - REDIS_URL (Redis)
# - STRIPE_SECRET_KEY (test mode: sk_test_*)
# - STRIPE_PUBLISHABLE_KEY (test mode: pk_test_*)
# - SECRET_KEY
# Install dependencies
pip install -r requirements.txt
# Initialize database
python -c "from database import get_database_manager; db = get_database_manager(); db.initialize_schema()"
# Start service
python underwriter_app.py
Devnet Configuration:
- Solana RPC:
https://api.devnet.solana.com - Stripe: Test mode keys
- Port: 5002
Test Endpoints:
GET http://localhost:5002/api/scaling/healthGET http://localhost:5002/api/scaling/metricsGET http://localhost:5002/api/loadbalancer/metrics
2. C++ Gate.io WebSocket Workers
Location: cpp-trading-trainer/
Steps:
cd cpp-trading-trainer
# Build workers
mkdir -p build
cd build
cmake ..
make gateio_worker_manager
cd ..
# Start aggregation server (port 5003)
python aggregation_server.py &
# Start workers
./build/gateio_worker_manager "BTC_USDT,ETH_USDT,SOL_USDT" "1m"
Test Endpoints:
GET http://localhost:5003/api/statusGET http://localhost:5003/api/symbolsGET http://localhost:5003/api/candles/BTC_USDT?limit=10GET http://localhost:5003/api/stream(SSE)
3. ShadowPool Solana Program
Location: shadowpool/
Steps:
cd shadowpool
# Configure Solana CLI for devnet
solana config set --url https://api.devnet.solana.com
# Airdrop devnet SOL
solana airdrop 2
# Build program
cargo build-bpf
# Deploy program
solana program deploy target/deploy/shadowpool.so
# Save the program ID for client configuration
Program Features:
- Pool-native token (Token ≡ Pool Share)
- Lambda-stabilized shadow liquidity
- Anti-fake rules (ambiguity, distortion limits)
- Shadow rebase mechanism
Program Fields:
shadow_root: [u8; 32]- Merkle root of shadow projectionprojection_hash: [u8; 32]- Hash of projectionshadow_liquidity_bps: u16- Liquidity score in basis pointsambiguity_bps: u16- Ambiguity penaltydistortion_bps: u16- Distortion penaltyshadow_index_q64: u128- Shadow index (Q64 fixed-point)lambda_coefficient: u64- Lambda coefficient
4. Proof-of-Shadow-Liquidity Components
Components to Deploy:
- LiquidDB (off-chain manifold storage)
- IPFS (for Merkle tree storage)
- Manifold projection service
- Shadow rebase instruction handlers
Steps:
# Deploy LiquidDB (PostgreSQL)
createdb liquiddb_devnet
psql liquiddb_devnet < schema.sql
# Start IPFS daemon
ipfs daemon
# Configure manifold projection service
# (implementation depends on your embedding model)
Environment Variables Summary
Catacomb Underwriter (.env):
SOLANA_RPC_URL=https://api.devnet.solana.com
STRIPE_SECRET_KEY=sk_test_*
STRIPE_PUBLISHABLE_KEY=pk_test_*
DATABASE_URL=postgresql://user:pass@localhost:5432/catacomb_devnet
REDIS_URL=redis://localhost:6379/0
REDIS_HOSTS=localhost
REDIS_MAX_CONNECTIONS=500
NUM_WORKERS=133
ENABLE_AUTO_SCALING=true
ShadowPool (Solana):
- Network: Devnet
- Program ID: (after deployment)
- Authority: Your devnet keypair
Testing
Test Underwriter Service:
curl http://localhost:5002/api/scaling/health
curl http://localhost:5002/api/scaling/metrics
Test Gate.io Workers:
curl http://localhost:5003/api/status
curl http://localhost:5003/api/symbols
Test ShadowPool:
solana program show <PROGRAM_ID>
solana logs <PROGRAM_ID>
Troubleshooting
Cargo lock file version error:
rm Cargo.lock
cargo update
cargo build-bpf
Redis not running:
redis-server
PostgreSQL not running:
# macOS
brew services start postgresql
# Linux
sudo systemctl start postgresql
Solana airdrop failed:
# Request more SOL
solana airdrop 2
Next Steps After Devnet Testing
- Verify all components work together
- Test shadow rebase mechanism
- Test lambda coefficient calculations
- Test anti-fake rules
- Test 133x scaling under load
- Document any issues
- Prepare for mainnet deployment with real credentials