7.2 KiB
7.2 KiB
Chain 138 Integration and Proxmox Deployment - Implementation Summary
This document summarizes the implementation of Chain 138 integration and Proxmox VE deployment for the Solace Treasury DApp.
Implementation Status
Phase 1: Chain 138 Network Configuration ✅
Frontend Configuration
- ✅ Updated
frontend/lib/web3/config.tsto include Chain 138 - ✅ Added Chain 138 definition with RPC endpoints (192.168.11.250-252:8545)
- ✅ Added WebSocket support for Chain 138
- ✅ Set Chain 138 as primary network in wagmi config
Backend Configuration
- ✅ Updated
backend/src/indexer/indexer.tsto support Chain 138 - ✅ Added Chain 138 to supported chains mapping
- ✅ Configured RPC URL for Chain 138 indexing
Smart Contract Deployment
- ✅ Updated
contracts/hardhat.config.tswith Chain 138 network configuration - ✅ Created
contracts/scripts/deploy-chain138.tsfor Chain 138 specific deployment - ✅ Added
deploy:chain138script tocontracts/package.json - ✅ Deployment script saves addresses to
contracts/deployments/chain138.json
Phase 2: Proxmox VE Deployment Infrastructure ✅
Deployment Scripts
- ✅ Created
deployment/proxmox/deploy-dapp.sh- Main orchestrator - ✅ Created
deployment/proxmox/deploy-database.sh- PostgreSQL deployment - ✅ Created
deployment/proxmox/deploy-backend.sh- Backend API deployment - ✅ Created
deployment/proxmox/deploy-indexer.sh- Event indexer deployment - ✅ Created
deployment/proxmox/deploy-frontend.sh- Frontend deployment
Configuration Files
- ✅ Created
deployment/proxmox/config/dapp.conf- Deployment configuration template - ✅ Created
deployment/proxmox/templates/nextjs.service- Frontend systemd service - ✅ Created
deployment/proxmox/templates/backend.service- Backend systemd service - ✅ Created
deployment/proxmox/templates/indexer.service- Indexer systemd service - ✅ Created
deployment/proxmox/templates/nginx.conf- Nginx reverse proxy configuration
Setup Scripts
- ✅ Created
scripts/setup-chain138.sh- Chain 138 configuration helper
Phase 3: Documentation ✅
- ✅ Updated
README.mdwith Chain 138 and Proxmox deployment sections - ✅ Created
deployment/proxmox/README.md- Comprehensive deployment guide
File Structure
solace-bg-dubai/
├── contracts/
│ ├── hardhat.config.ts # Updated with Chain 138 network
│ └── scripts/
│ └── deploy-chain138.ts # Chain 138 deployment script
├── frontend/
│ └── lib/web3/
│ └── config.ts # Updated with Chain 138 support
├── backend/
│ └── src/indexer/
│ └── indexer.ts # Updated with Chain 138 support
├── deployment/
│ └── proxmox/
│ ├── deploy-dapp.sh # Main orchestrator
│ ├── deploy-database.sh # Database deployment
│ ├── deploy-backend.sh # Backend deployment
│ ├── deploy-indexer.sh # Indexer deployment
│ ├── deploy-frontend.sh # Frontend deployment
│ ├── config/
│ │ └── dapp.conf # Configuration template
│ ├── templates/
│ │ ├── nextjs.service # Frontend service template
│ │ ├── backend.service # Backend service template
│ │ ├── indexer.service # Indexer service template
│ │ └── nginx.conf # Nginx configuration
│ └── README.md # Deployment guide
├── scripts/
│ └── setup-chain138.sh # Chain 138 setup helper
└── README.md # Updated with deployment info
Key Features Implemented
Chain 138 Integration
-
Network Definition
- Chain ID: 138
- RPC Endpoints: 192.168.11.250-252:8545
- WebSocket: 192.168.11.250-252:8546
- Block Explorer: http://192.168.11.140
-
Frontend Support
- Chain 138 added to wagmi configuration
- WebSocket transport support
- Environment variable configuration
-
Backend Support
- Chain 138 added to indexer supported chains
- RPC URL configuration
- Event indexing support
-
Contract Deployment
- Hardhat network configuration
- Deployment script with address saving
- Gas price configuration (zero base fee)
Proxmox Deployment
-
Container Specifications
- Frontend: VMID 3000, 2GB RAM, 2 CPU, 20GB disk
- Backend: VMID 3001, 2GB RAM, 2 CPU, 20GB disk
- Database: VMID 3002, 4GB RAM, 2 CPU, 50GB disk
- Indexer: VMID 3003, 2GB RAM, 2 CPU, 30GB disk
-
Automated Deployment
- One-command deployment via
deploy-dapp.sh - Individual component deployment scripts
- Dependency-aware deployment order
- One-command deployment via
-
Service Management
- Systemd service files for all components
- Auto-start configuration
- Logging and monitoring setup
-
Network Configuration
- VLAN 103 (Services network)
- Static IP assignment
- Internal service communication
Next Steps for Deployment
-
Deploy Contracts
cd contracts pnpm run deploy:chain138 -
Configure Environment
./scripts/setup-chain138.sh # Edit .env files with contract addresses and credentials -
Deploy to Proxmox
cd deployment/proxmox sudo ./deploy-dapp.sh -
Post-Deployment
- Copy environment files to containers
- Run database migrations
- Start all services
- Configure Nginx for public access
Configuration Requirements
Environment Variables
Frontend (frontend/.env.production):
NEXT_PUBLIC_CHAIN138_RPC_URLNEXT_PUBLIC_CHAIN138_WS_URLNEXT_PUBLIC_CHAIN_ID=138NEXT_PUBLIC_TREASURY_WALLET_ADDRESSNEXT_PUBLIC_SUB_ACCOUNT_FACTORY_ADDRESSNEXT_PUBLIC_WALLETCONNECT_PROJECT_IDNEXT_PUBLIC_API_URL
Backend (backend/.env):
DATABASE_URLRPC_URLCHAIN_ID=138CONTRACT_ADDRESSPORT=3001NODE_ENV=production
Indexer (backend/.env.indexer):
DATABASE_URLRPC_URLCHAIN_ID=138CONTRACT_ADDRESSSTART_BLOCK=0
Proxmox Configuration
Required Settings (deployment/proxmox/config/dapp.conf):
PROXMOX_STORAGE: Storage pool namePROXMOX_BRIDGE: Network bridgeDATABASE_PASSWORD: PostgreSQL password- IP addresses (if different from defaults)
Testing Checklist
- Chain 138 RPC connectivity
- Contract deployment to Chain 138
- Frontend connection to Chain 138
- Backend API functionality
- Database connectivity
- Event indexer synchronization
- Service auto-start on boot
- Nginx reverse proxy (if configured)
- SSL/TLS certificates (if configured)
Notes
- All deployment scripts are executable and ready to use
- Configuration templates are provided for easy setup
- Services are configured with systemd for reliable operation
- Network configuration assumes VLAN 103 for services
- Database password must be set before deployment
- Contract addresses must be updated after deployment
Support
For deployment issues:
- Check service logs:
pct exec <VMID> -- journalctl -u <service> -f - Verify network connectivity
- Check environment variable configuration
- Review deployment logs