- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control. - Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities. - Created .gitmodules to include OpenZeppelin contracts as a submodule. - Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment. - Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks. - Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring. - Created scripts for resource import and usage validation across non-US regions. - Added tests for CCIP error handling and integration to ensure robust functionality. - Included various new files and directories for the orchestration portal and deployment scripts.
Phase 2: Docker Compose Deployment
Overview
Phase 2 deploys multi-service docker-compose stacks to Phase 1 VMs. Each region gets a region-specific docker-compose file with services including Besu, FireFly, Cacti, Chainlink, databases, and monitoring.
Prerequisites
- Phase 1 must be deployed first - Phase 2 depends on Phase 1 VMs
- SSH access to VMs - Requires:
- SSH private key corresponding to the public key used in Phase 1
- Network connectivity to VMs (VPN/ExpressRoute/Cloudflare Tunnel if using private IPs)
- Docker Engine installed - Phase 1 cloud-init installs Docker, but verify it's running
Architecture
Region to Docker Compose Mapping
-
Central US (centralus) →
docker-compose.cus.yml- Besu + FireFly Core A + Cacti Core A + Chainlink A + shared DBs + agents
-
East US (eastus) →
docker-compose.eus.yml- Besu + FireFly Core B + primary FireFly/Cacti DBs + Chainlink B + agents
-
East US 2 (eastus2) →
docker-compose.eus2.yml- Besu + FireFly DataExchange A + IPFS + Cacti UI + Prometheus primary + agents
-
West US (westus) →
docker-compose.wus.yml- Besu + FireFly DataExchange B + Prometheus secondary + Grafana + Alertmanager + Chainlink C + agents
-
West US 2 (westus2) →
docker-compose.wus2.yml- Besu + Loki + Log UI + FireFly Postgres Replica + Cacti Core B + agents
Configuration
Variables
Create a terraform.tfvars file or set environment variables:
environment = "prod"
vm_admin_username = "besuadmin"
ssh_private_key_path = "/path/to/ssh/private/key"
# Phase 1 VM information - pass from Phase 1 outputs
phase1_vm_info = {
centralus = {
vm_names = ["az-p-cus-vm-besu-node-0"]
private_ips = ["10.3.1.4"]
public_ips = []
resource_group = "az-p-cus-rg-comp-001"
region = "centralus"
}
eastus = {
vm_names = ["az-p-eus-vm-besu-node-0"]
private_ips = ["10.1.1.4"]
public_ips = []
resource_group = "az-p-eus-rg-comp-001"
region = "eastus"
}
# ... similar for other regions
}
docker_compose_source_path = "../../../docker/phase2"
Getting Phase 1 VM Information
If Phase 1 was deployed via Terraform, you can get the VM information from Phase 1 outputs:
cd terraform/phases/phase1
terraform output -json phase1_us_regions > phase1-outputs.json
Then use a script to convert Phase 1 outputs to Phase 2 phase1_vm_info format.
Deployment
Method 1: Terraform Apply
cd terraform/phases/phase2
terraform init
terraform plan
terraform apply
Method 2: Deployment Script
cd terraform/phases/phase2/scripts
./deploy-phase2.sh [region]
If no region is specified, deploys to all regions.
Service Management
Start Services
cd terraform/phases/phase2/scripts
./start-services.sh [region]
Stop Services
cd terraform/phases/phase2/scripts
./stop-services.sh [region]
Check Status
cd terraform/phases/phase2/scripts
./status.sh [region]
Manual Service Management
SSH to the VM and use systemctl:
# Start
sudo systemctl start phase2-stack.service
# Stop
sudo systemctl stop phase2-stack.service
# Restart
sudo systemctl restart phase2-stack.service
# Status
sudo systemctl status phase2-stack.service
# View logs
sudo journalctl -u phase2-stack.service -f
Or use docker compose directly:
cd /opt/docker-compose
docker compose ps
docker compose logs -f
docker compose restart
Terraform Outputs
View Deployment Status
cd terraform/phases/phase2
terraform output deployment_status
terraform output systemd_service_status
terraform output management_commands
Example Output
{
"centralus": {
"region": "centralus",
"vm_name": "az-p-cus-vm-besu-node-0",
"compose_file": "docker-compose.cus.yml",
"status": "deployed",
"docker_compose_path": "/opt/docker-compose/docker-compose.yml"
},
...
}
File Locations on VMs
- Docker Compose File:
/opt/docker-compose/docker-compose.yml - Systemd Service:
/etc/systemd/system/phase2-stack.service - Volume Mounts:
- Besu:
/opt/besu/{data,config,keys,logs} - FireFly:
/opt/firefly/{postgres,postgres-primary,postgres-replica} - Cacti:
/opt/cacti/{postgres,postgres-primary} - Prometheus:
/opt/prometheus - Grafana:
/opt/grafana,/opt/grafana-logs - Alertmanager:
/opt/alertmanager - Loki:
/opt/loki/{data,config} - IPFS:
/opt/ipfs/data - Promtail:
/opt/promtail
- Besu:
Network Connectivity
Important: Phase 1 VMs use private IPs only. To deploy Phase 2, ensure:
- VPN/ExpressRoute is configured to access VM private IPs, OR
- Cloudflare Tunnel is running on VMs, OR
- Bastion Host is configured for SSH access, OR
- VMs are temporarily assigned public IPs for deployment
The Terraform provisioner will use:
- Private IP if available
- Public IP as fallback
- Requires SSH key path to be set in
ssh_private_key_pathvariable
Troubleshooting
SSH Connection Issues
If you cannot SSH to VMs:
- Verify network connectivity (VPN/ExpressRoute/Bastion)
- Check SSH key path and permissions
- Verify VM is running and accessible
- Check NSG rules allow SSH from your IP
Docker Compose Issues
If services fail to start:
- Check docker compose file syntax:
docker compose config - Verify all required directories exist with correct permissions
- Check docker logs:
docker compose logs - Verify systemd service:
sudo systemctl status phase2-stack.service
Volume Mount Issues
If volumes are not accessible:
- Verify directories exist:
ls -la /opt/* - Check permissions:
sudo chown -R besuadmin:besuadmin /opt/* - Ensure Docker has access:
sudo usermod -aG docker besuadmin
Next Steps
After Phase 2 deployment:
- Verify all services are running:
./status.sh all - Configure service-specific settings (database passwords, API keys, etc.)
- Set up monitoring and alerting
- Configure cross-service connectivity (FireFly to Besu, etc.)
- Test end-to-end workflows
Related Documentation
- Phase 1 Deployment:
../phase1/README.md - Docker Compose Files:
../../../docker/phase2/ - Service Documentation: See individual service documentation in
docs/