- 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.
123 lines
3.5 KiB
Bash
Executable File
123 lines
3.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Deploy All Infrastructure Phases
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "$0")/../.."
|
|
|
|
# Color codes
|
|
|
|
echo "==================================================================="
|
|
echo " CHAIN-138 INFRASTRUCTURE DEPLOYMENT - ALL PHASES"
|
|
echo "==================================================================="
|
|
|
|
# Load environment variables
|
|
if [ -f .env ]; then
|
|
source .env 2>/dev/null || true
|
|
fi
|
|
|
|
PHASES=(
|
|
"Phase 1: Azure Infrastructure"
|
|
"Phase 2: Kubernetes Resources"
|
|
"Phase 3: Besu Network"
|
|
"Phase 4: Monitoring and Explorer"
|
|
)
|
|
|
|
echo "This will deploy Chain-138 infrastructure in 4 phases:"
|
|
for phase in "${PHASES[@]}"; do
|
|
echo " - $phase"
|
|
done
|
|
|
|
read -p "Continue with deployment? (y/N): " -n 1 -r
|
|
|
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
echo "Deployment cancelled."
|
|
exit 0
|
|
fi
|
|
|
|
# Phase 1: Azure Infrastructure
|
|
echo "==================================================================="
|
|
echo " PHASE 1: AZURE INFRASTRUCTURE"
|
|
echo "==================================================================="
|
|
|
|
if [ -d "terraform" ]; then
|
|
cd terraform
|
|
|
|
# Initialize if needed
|
|
if [ ! -d ".terraform" ]; then
|
|
echo "Initializing Terraform..."
|
|
terraform init
|
|
fi
|
|
|
|
# Validate
|
|
echo "Validating configuration..."
|
|
terraform validate
|
|
|
|
# Plan
|
|
echo "Creating plan..."
|
|
terraform plan -out=tfplan
|
|
|
|
log_warn "⚠️ REVIEW THE PLAN ABOVE"
|
|
read -p "Apply Terraform plan? (y/N): " -n 1 -r
|
|
|
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
terraform apply tfplan
|
|
log_success "✅ Phase 1 complete!"
|
|
else
|
|
log_warn "⚠️ Phase 1 skipped. Run manually: cd terraform && terraform apply"
|
|
fi
|
|
|
|
cd ..
|
|
else
|
|
log_error "❌ Terraform directory not found"
|
|
fi
|
|
|
|
# Phase 2: Kubernetes Resources
|
|
echo "==================================================================="
|
|
echo " PHASE 2: KUBERNETES RESOURCES"
|
|
echo "==================================================================="
|
|
|
|
if kubectl cluster-info &> /dev/null; then
|
|
./scripts/deployment/deploy-infrastructure-phase2.sh
|
|
else
|
|
log_warn "⚠️ Kubernetes not accessible. Get kubeconfig first:"
|
|
echo " az aks get-credentials --resource-group <rg> --name <cluster>"
|
|
fi
|
|
|
|
# Phase 3: Besu Network
|
|
echo "==================================================================="
|
|
echo " PHASE 3: BESU NETWORK"
|
|
echo "==================================================================="
|
|
|
|
if kubectl cluster-info &> /dev/null && kubectl get namespace besu-network &> /dev/null; then
|
|
./scripts/deployment/deploy-infrastructure-phase3.sh
|
|
else
|
|
log_warn "⚠️ Kubernetes not ready. Complete Phase 2 first."
|
|
fi
|
|
|
|
# Phase 4: Monitoring
|
|
echo "==================================================================="
|
|
echo " PHASE 4: MONITORING AND EXPLORER"
|
|
echo "==================================================================="
|
|
|
|
if kubectl cluster-info &> /dev/null; then
|
|
./scripts/deployment/deploy-infrastructure-phase4.sh
|
|
else
|
|
log_warn "⚠️ Kubernetes not accessible."
|
|
fi
|
|
|
|
# Final verification
|
|
echo "==================================================================="
|
|
echo " DEPLOYMENT COMPLETE"
|
|
echo "==================================================================="
|
|
|
|
echo "Running verification..."
|
|
./scripts/deployment/verify-chain138-complete.sh
|
|
|
|
log_success "✅ Infrastructure deployment process complete!"
|
|
echo "Next steps:"
|
|
echo " 1. Verify all services are running"
|
|
echo " 2. Get RPC endpoint"
|
|
echo " 3. Deploy contracts"
|
|
echo " 4. Run full verification"
|