Files
solace-bg-dubai/deployment/proxmox/DEPLOY_INSTRUCTIONS.md
defiQUG c94eb595f8
Some checks failed
CI / lint-and-test (push) Has been cancelled
Initial commit: add .gitignore and README
2026-02-09 21:51:53 -08:00

4.4 KiB

Deployment Instructions

Quick Deploy

The deployment must be run on the Proxmox host as root.

  1. SSH to Proxmox host:

    ssh root@192.168.11.10
    
  2. Copy deployment files to Proxmox host:

    # From your local machine
    scp -r /home/intlc/projects/solace-bg-dubai/deployment/proxmox root@192.168.11.10:/root/
    scp -r /home/intlc/projects/solace-bg-dubai/backend root@192.168.11.10:/root/solace-deploy/
    scp -r /home/intlc/projects/solace-bg-dubai/frontend root@192.168.11.10:/root/solace-deploy/
    scp -r /home/intlc/projects/solace-bg-dubai/contracts root@192.168.11.10:/root/solace-deploy/
    
  3. On Proxmox host, set database password and deploy:

    cd /root/proxmox
    export DATABASE_PASSWORD="your_secure_password_here"
    ./deploy-dapp.sh
    

Option 2: One-Line Remote Deployment

From your local machine:

export DATABASE_PASSWORD="your_secure_password_here"
cd /home/intlc/projects/solace-bg-dubai/deployment/proxmox
ssh root@192.168.11.10 "mkdir -p /root/solace-deploy && cd /root/solace-deploy"
scp -r /home/intlc/projects/solace-bg-dubai/deployment/proxmox/* root@192.168.11.10:/root/solace-deploy/
scp -r /home/intlc/projects/solace-bg-dubai/{backend,frontend,contracts} root@192.168.11.10:/root/solace-deploy/
ssh root@192.168.11.10 "cd /root/solace-deploy && export DATABASE_PASSWORD='$DATABASE_PASSWORD' && chmod +x *.sh && ./deploy-dapp.sh"

Option 3: Manual Step-by-Step

  1. Deploy Database:

    ssh root@192.168.11.10
    cd /root/solace-deploy
    export DATABASE_PASSWORD="your_password"
    ./deploy-database.sh
    
  2. Deploy Backend:

    ./deploy-backend.sh
    
  3. Deploy Indexer:

    ./deploy-indexer.sh
    
  4. Deploy Frontend:

    ./deploy-frontend.sh
    

Prerequisites

Before deploying, ensure:

  1. Ubuntu 22.04 template is available:

    pveam list local | grep ubuntu-22.04
    

    If not available:

    pveam download local ubuntu-22.04-standard_22.04-1_amd64.tar.zst
    
  2. Sufficient resources:

    • Minimum 10GB RAM available
    • Minimum 4 CPU cores available
    • Minimum 120GB disk space available
  3. Network access:

    • IP addresses 192.168.11.60-63 available
    • Access to Chain 138 RPC nodes (192.168.11.250-252)
  4. Database password set:

    export DATABASE_PASSWORD="your_secure_password"
    

Post-Deployment

After deployment completes:

  1. Deploy contracts to Chain 138:

    cd contracts
    pnpm install
    pnpm run deploy:chain138
    
  2. Configure environment variables:

    # Use the setup script
    ./scripts/setup-chain138.sh
    
    # Or manually create .env files
    # See deployment/proxmox/README.md for details
    
  3. Copy environment files to containers:

    pct push 3000 frontend/.env.production /opt/solace-frontend/.env.production
    pct push 3001 backend/.env /opt/solace-backend/.env
    pct push 3003 backend/.env.indexer /opt/solace-indexer/.env.indexer
    
  4. Run database migrations:

    pct exec 3001 -- bash -c 'cd /opt/solace-backend && pnpm run db:migrate'
    
  5. Start services:

    pct exec 3001 -- systemctl start solace-backend
    pct exec 3003 -- systemctl start solace-indexer
    pct exec 3000 -- systemctl start solace-frontend
    
  6. Verify deployment:

    pct list | grep -E "300[0-3]"
    pct exec 3000 -- systemctl status solace-frontend
    pct exec 3001 -- systemctl status solace-backend
    pct exec 3003 -- systemctl status solace-indexer
    

Troubleshooting

Container Creation Fails

  • Check available resources: pvesh get /nodes/pve/resources
  • Verify template exists: pveam list local
  • Check network configuration

Service Won't Start

  • Check logs: pct exec <VMID> -- journalctl -u <service> -n 50
  • Verify environment variables are set
  • Check database connectivity

Database Connection Issues

  • Verify database is running: pct exec 3002 -- systemctl status postgresql
  • Test connection: pct exec 3001 -- psql -h 192.168.11.62 -U solace_user -d solace_treasury

Quick Status Check

# List all DApp containers
pct list | grep -E "300[0-3]"

# Check service status
for vmid in 3000 3001 3003; do
  echo "=== Container $vmid ==="
  pct exec $vmid -- systemctl status solace-* --no-pager | head -10
done