Files
CurrenciCombo/docs/DEPLOYMENT_RUNBOOK.md
defiQUG f600b7b15e Add ECDSA signature verification and enhance ComboHandler functionality
- Integrated ECDSA for signature verification in ComboHandler.
- Updated event emissions to include additional parameters for better tracking.
- Improved gas tracking during execution of combo plans.
- Enhanced database interactions for storing and retrieving plans, including conflict resolution and status updates.
- Added new dependencies for security and database management in orchestrator.
2025-11-05 16:28:48 -08:00

2.4 KiB

Deployment Runbook

Overview

This document provides step-by-step procedures for deploying the ISO-20022 Combo Flow system to production.


Prerequisites

  • Docker and Docker Compose installed
  • Kubernetes cluster (for production)
  • PostgreSQL database
  • Redis instance
  • Domain name and SSL certificates
  • Environment variables configured

Local Development Deployment

Using Docker Compose

# Start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Manual Setup

  1. Database Setup

    cd orchestrator
    npm install
    npm run migrate
    
  2. Start Orchestrator

    cd orchestrator
    npm run dev
    
  3. Start Frontend

    cd webapp
    npm install
    npm run dev
    

Production Deployment

Step 1: Database Migration

# Connect to production database
export DATABASE_URL="postgresql://user:pass@db-host:5432/comboflow"

# Run migrations
cd orchestrator
npm run migrate

Step 2: Build Docker Images

# Build orchestrator
docker build -t orchestrator:latest -f Dockerfile .

# Build webapp
docker build -t webapp:latest -f webapp/Dockerfile ./webapp

Step 3: Deploy to Kubernetes

# Apply configurations
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/webapp-deployment.yaml

# Check status
kubectl get pods
kubectl get services

Step 4: Verify Deployment

# Check health endpoints
curl https://api.example.com/health
curl https://api.example.com/ready
curl https://api.example.com/metrics

Rollback Procedure

Quick Rollback

# Rollback to previous deployment
kubectl rollout undo deployment/orchestrator
kubectl rollout undo deployment/webapp

Database Rollback

# Restore from backup
pg_restore -d comboflow backup.dump

Monitoring

  • Health checks: /health, /ready, /live
  • Metrics: /metrics (Prometheus format)
  • Logs: Check Kubernetes logs or Docker logs

Troubleshooting

Service Won't Start

  1. Check environment variables
  2. Verify database connectivity
  3. Check logs: kubectl logs <pod-name>

Database Connection Issues

  1. Verify DATABASE_URL
  2. Check network connectivity
  3. Verify database credentials

Performance Issues

  1. Check metrics endpoint
  2. Review database query performance
  3. Check Redis connectivity

Last Updated: 2025-01-15