Files
smom-dbis-138/scripts/vm-deployment/restore-vm.sh
defiQUG 1fb7266469 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.
2025-12-12 14:57:48 -08:00

58 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Restore VM data script
# This script restores Besu data to a VM
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
# Configuration
VM_IP="${1:-}"
BACKUP_FILE="${2:-}"
if [ -z "$VM_IP" ] || [ -z "$BACKUP_FILE" ]; then
log_error "Error: VM IP or backup file not provided"
echo "Usage: $0 <vm-ip> <backup-file>"
exit 1
fi
if [ ! -f "$BACKUP_FILE" ]; then
log_error "Error: Backup file not found: $BACKUP_FILE"
exit 1
fi
log_success "Restoring VM data: $VM_IP from $BACKUP_FILE"
log_error "WARNING: This will overwrite existing data. Continue? (y/N)"
read -r CONFIRM
if [ "$CONFIRM" != "y" ] && [ "$CONFIRM" != "Y" ]; then
echo "Restore cancelled"
exit 0
fi
# Stop Besu container
log_warn "Stopping Besu container..."
ssh besuadmin@$VM_IP "docker compose -f /opt/besu/docker-compose.yml down"
# Restore data
log_warn "Restoring data..."
cat "$BACKUP_FILE" | ssh besuadmin@$VM_IP "sudo tar xzf - -C /"
if [ $? -eq 0 ]; then
log_success "✓ Data restored"
else
log_error "✗ Restore failed"
exit 1
fi
# Restart Besu container
log_warn "Restarting Besu container..."
ssh besuadmin@$VM_IP "docker compose -f /opt/besu/docker-compose.yml up -d"
log_success "Restore completed!"