Add Oracle Aggregator and CCIP Integration

- 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.
This commit is contained in:
defiQUG
2025-12-12 14:57:48 -08:00
parent a1466e4005
commit 1fb7266469
1720 changed files with 241279 additions and 16 deletions

140
scripts/setup/dev-environment.sh Executable file
View File

@@ -0,0 +1,140 @@
#!/usr/bin/env bash
# Development environment setup script
# Installs required tools and dependencies for development
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
source "$SCRIPT_DIR/../lib/common/validation.sh"
cd "$PROJECT_ROOT"
log_section "Development Environment Setup"
# Check for required commands
log_subsection "Checking dependencies"
REQUIRED_COMMANDS=(
"bash"
"git"
"docker"
"python3"
"node"
"npm"
)
MISSING_COMMANDS=()
for cmd in "${REQUIRED_COMMANDS[@]}"; do
if command_exists "$cmd"; then
log_success "$cmd is installed"
else
log_warn "$cmd is not installed"
MISSING_COMMANDS+=("$cmd")
fi
done
# Optional tools
log_subsection "Checking optional tools"
OPTIONAL_COMMANDS=(
"shellcheck:Static analysis for shell scripts"
"shfmt:Shell script formatter"
"yamllint:YAML linter"
"terraform:Infrastructure as code"
"kubectl:Kubernetes CLI"
"az:Azure CLI"
)
for cmd_info in "${OPTIONAL_COMMANDS[@]}"; do
IFS=':' read -r cmd desc <<< "$cmd_info"
if command_exists "$cmd"; then
log_success "$cmd is installed"
else
log_info "$cmd is not installed (optional: $desc)"
fi
done
# Install shellcheck if missing
if ! command_exists shellcheck && command_exists apt-get; then
log_info "Installing shellcheck..."
sudo apt-get update
sudo apt-get install -y shellcheck
fi
# Install shfmt if missing
if ! command_exists shfmt && command_exists go; then
log_info "Installing shfmt..."
go install mvdan.cc/sh/v3/cmd/shfmt@latest
fi
# Setup pre-commit hooks
log_subsection "Setting up pre-commit hooks"
if [ -d ".git" ]; then
if [ ! -f ".git/hooks/pre-commit" ]; then
log_info "Creating pre-commit hook..."
cat > .git/hooks/pre-commit <<'EOF'
#!/usr/bin/env bash
# Pre-commit hook for code quality checks
set -e
# Run shellcheck on shell scripts
if command -v shellcheck &>/dev/null; then
git diff --cached --name-only --diff-filter=ACM | grep '\.sh$' | while read -r file; do
shellcheck "$file" || exit 1
done
fi
# Run yamllint on YAML files
if command -v yamllint &>/dev/null; then
git diff --cached --name-only --diff-filter=ACM | grep -E '\.(yml|yaml)$' | while read -r file; do
yamllint "$file" || exit 1
done
fi
EOF
chmod +x .git/hooks/pre-commit
log_success "Pre-commit hook created"
else
log_info "Pre-commit hook already exists"
fi
fi
# Create .env.example if it doesn't exist
if [ ! -f ".env.example" ]; then
log_info "Creating .env.example..."
cat > .env.example <<'EOF'
# Environment Configuration
# Copy this file to .env and update with your values
# RPC Configuration
RPC_URL=http://localhost:8545
# Chain Configuration
CHAIN_ID=138
# Azure Configuration (if using Azure)
AZURE_SUBSCRIPTION_ID=
AZURE_RESOURCE_GROUP=
AZURE_LOCATION=westeurope
# Key Vault Configuration
KEY_VAULT_NAME=
# Deployment Configuration
ENVIRONMENT=development
EOF
log_success ".env.example created"
fi
log_success "Development environment setup complete"
if [ ${#MISSING_COMMANDS[@]} -gt 0 ]; then
log_warn "Missing required commands: ${MISSING_COMMANDS[*]}"
log_info "Please install missing commands before continuing"
fi

View File

@@ -0,0 +1,81 @@
#!/usr/bin/env bash
# Install All Required Tools
# Installs Terraform, kubectl, and Helm
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
log() {
log_success "[✓] $1"
}
error() {
log_error "[✗] $1"
exit 1
}
warn() {
log_warn "[!] $1"
}
info() {
log_info "[i] $1"
}
section() {
echo
log_info "=== $1 ==="
}
section "Installing All Required Tools"
# Install Terraform
section "Terraform"
if [ -f "$SCRIPT_DIR/install-terraform.sh" ]; then
"$SCRIPT_DIR/install-terraform.sh"
else
warn "Terraform installation script not found"
fi
# Install kubectl
section "kubectl"
if [ -f "$SCRIPT_DIR/install-kubectl.sh" ]; then
"$SCRIPT_DIR/install-kubectl.sh"
else
warn "kubectl installation script not found"
fi
# Install Helm
section "Helm"
if [ -f "$SCRIPT_DIR/install-helm.sh" ]; then
"$SCRIPT_DIR/install-helm.sh"
else
warn "Helm installation script not found"
fi
# Verify all installations
section "Verification"
TOOLS=("terraform" "kubectl" "helm")
ALL_INSTALLED=true
for tool in "${TOOLS[@]}"; do
if command -v "$tool" &> /dev/null; then
VERSION=$($tool version 2>/dev/null | head -n 1 || echo "installed")
log "$tool: $VERSION"
else
error "$tool is not installed"
ALL_INSTALLED=false
fi
done
if [ "$ALL_INSTALLED" = true ]; then
section "Installation Complete"
log "All tools installed successfully"
info "You can now proceed with deployment"
else
error "Some tools failed to install"
fi

63
scripts/setup/install-helm.sh Executable file
View File

@@ -0,0 +1,63 @@
#!/usr/bin/env bash
# Install Helm 3.x
# Supports multiple installation methods
set -euo pipefail
# Colors
log() {
log_success "[✓] $1"
}
error() {
log_error "[✗] $1"
exit 1
}
info() {
log_info "[i] $1"
}
# Check if Helm is already installed
if command -v helm &> /dev/null; then
HELM_VERSION=$(helm version --short 2>/dev/null || helm version | head -n 1)
log "Helm is already installed: $HELM_VERSION"
exit 0
fi
info "Installing Helm..."
# Detect OS
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
if command -v snap &> /dev/null; then
info "Installing via snap..."
sudo snap install helm --classic
log "Helm installed via snap"
else
info "Installing via script..."
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
log "Helm installed via script"
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
if command -v brew &> /dev/null; then
info "Installing via Homebrew..."
brew install helm
log "Helm installed via Homebrew"
else
error "Homebrew not found. Please install Homebrew first: https://brew.sh"
fi
else
error "Unsupported OS: $OSTYPE"
fi
# Verify installation
if command -v helm &> /dev/null; then
HELM_VERSION=$(helm version --short 2>/dev/null || echo "installed")
log "Helm installed successfully: $HELM_VERSION"
else
error "Helm installation failed"
fi

View File

@@ -0,0 +1,67 @@
#!/usr/bin/env bash
# Install kubectl
# Supports multiple installation methods
set -euo pipefail
# Colors
log() {
log_success "[✓] $1"
}
error() {
log_error "[✗] $1"
exit 1
}
info() {
log_info "[i] $1"
}
# Check if kubectl is already installed
if command -v kubectl &> /dev/null; then
KUBECTL_VERSION=$(kubectl version --client --short 2>/dev/null || kubectl version --client | head -n 1)
log "kubectl is already installed: $KUBECTL_VERSION"
exit 0
fi
info "Installing kubectl..."
# Detect OS
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
if command -v snap &> /dev/null; then
info "Installing via snap..."
sudo snap install kubectl --classic
log "kubectl installed via snap"
elif command -v apt-get &> /dev/null; then
info "Installing via apt..."
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
rm kubectl
log "kubectl installed"
else
error "Package manager not found"
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
if command -v brew &> /dev/null; then
info "Installing via Homebrew..."
brew install kubectl
log "kubectl installed via Homebrew"
else
error "Homebrew not found. Please install Homebrew first: https://brew.sh"
fi
else
error "Unsupported OS: $OSTYPE"
fi
# Verify installation
if command -v kubectl &> /dev/null; then
KUBECTL_VERSION=$(kubectl version --client --short 2>/dev/null || echo "installed")
log "kubectl installed successfully: $KUBECTL_VERSION"
else
error "kubectl installation failed"
fi

View File

@@ -0,0 +1,79 @@
#!/usr/bin/env bash
# Install Terraform
# Supports multiple installation methods
set -euo pipefail
# Colors
log() {
log_success "[✓] $1"
}
error() {
log_error "[✗] $1"
exit 1
}
warn() {
log_warn "[!] $1"
}
info() {
log_info "[i] $1"
}
# Check if Terraform is already installed
if command -v terraform &> /dev/null; then
TERRAFORM_VERSION=$(terraform version -json | grep -o '"terraform_version":"[^"]*' | cut -d'"' -f4 || terraform version | head -n 1)
log "Terraform is already installed: $TERRAFORM_VERSION"
exit 0
fi
info "Installing Terraform..."
# Detect OS
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
if command -v snap &> /dev/null; then
info "Installing via snap..."
sudo snap install terraform --classic
log "Terraform installed via snap"
elif command -v apt-get &> /dev/null; then
info "Installing via apt (HashiCorp repository)..."
# Add HashiCorp repository
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update
sudo apt-get install -y terraform
log "Terraform installed via apt"
else
warn "Package manager not found. Installing manually..."
TERRAFORM_VERSION="1.6.0"
wget -q "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
unzip -q "terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
sudo mv terraform /usr/local/bin/
rm "terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
log "Terraform installed manually"
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
if command -v brew &> /dev/null; then
info "Installing via Homebrew..."
brew install terraform
log "Terraform installed via Homebrew"
else
error "Homebrew not found. Please install Homebrew first: https://brew.sh"
fi
else
error "Unsupported OS: $OSTYPE"
fi
# Verify installation
if command -v terraform &> /dev/null; then
TERRAFORM_VERSION=$(terraform version | head -n 1)
log "Terraform installed successfully: $TERRAFORM_VERSION"
else
error "Terraform installation failed"
fi