- 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.
8.8 KiB
Phase 1: Next Steps - Complete Setup Guide
✅ Deployment Verification
All Phase 1 resources have been successfully deployed:
- 6 Virtual Machines: 5 backend VMs + 1 Nginx proxy
- Networking: VNets, NSGs, and public IP for Nginx proxy
- Storage: Boot diagnostics and backup storage accounts
- Monitoring: Log Analytics Workspaces
- Backup: Recovery Services Vaults
- Security: Key Vault with Managed Identity access
📋 Next Steps Checklist
1. Verify VM Access ✅
Nginx Proxy (West Europe):
ssh besuadmin@20.160.58.99
Backend VMs (US Regions):
# Central US
ssh besuadmin@10.3.1.4
# East US
ssh besuadmin@10.1.1.4
# East US 2
ssh besuadmin@10.4.1.4
# West US
ssh besuadmin@<private-ip> # Check terraform output
# West US 2
ssh besuadmin@<private-ip> # Check terraform output
Note: Backend VMs use private IPs only. You'll need to:
- Connect via VPN/ExpressRoute, OR
- Use Azure Bastion, OR
- SSH from another VM in the same VNet
2. Configure Besu Nodes on Backend VMs
For each backend VM, run:
# SSH to the VM first
ssh besuadmin@<vm-private-ip>
# Run the setup script
cd /opt/besu
sudo bash /opt/besu/setup.sh # This was created by cloud-init
# Or use the provided script
wget https://raw.githubusercontent.com/your-repo/terraform/phases/phase1/scripts/setup-besu-node.sh
chmod +x setup-besu-node.sh
./setup-besu-node.sh besu-node 0 <region-name>
Manual steps:
- Replace
/opt/besu/config/genesis.jsonwith your actual genesis file - If validator, add keys to
/opt/besu/keys/ - Start Besu:
sudo systemctl start besu.service - Verify:
sudo systemctl status besu.service - Check logs:
sudo journalctl -u besu.service -f
3. Set Up Cloudflare Tunnel on Nginx Proxy
✅ Cloudflare credentials are automatically loaded from .env file!
Option A: Cloudflare Tunnel on Nginx Proxy Only (Recommended for initial setup)
# SSH to Nginx proxy
ssh besuadmin@20.160.58.99
# Run setup script (credentials loaded automatically from .env)
wget https://raw.githubusercontent.com/your-repo/terraform/phases/phase1/scripts/setup-cloudflare-tunnel.sh
chmod +x setup-cloudflare-tunnel.sh
./setup-cloudflare-tunnel.sh rpc.yourdomain.com
Or use the automated setup script (runs locally, provides instructions):
cd terraform/phases/phase1
./scripts/automated-cloudflare-setup.sh rpc.yourdomain.com
Manual steps (if not using automated script):
- Install cloudflared (already in cloud-init)
- Login:
sudo cloudflared tunnel login(or use API token from .env) - Create tunnel:
sudo cloudflared tunnel create phase1-nginx-proxy - Configure
/etc/cloudflared/config.ymlwith tunnel ID - Create DNS route:
sudo cloudflared tunnel route dns phase1-nginx-proxy rpc.yourdomain.com- Note: DNS route creation will use Cloudflare API token from .env if available
- Start service:
sudo systemctl enable cloudflared && sudo systemctl start cloudflared
4. Configure Cross-Region Connectivity
Current Challenge: Nginx proxy (West Europe) cannot reach backend VMs (US regions) via private IPs.
Solution Options:
Option A: Azure VPN/ExpressRoute (Recommended for Production)
- Deploy VPN Gateway in each region
- Connect regions via VPN
- Update NSG rules to allow Nginx proxy subnet access
- Nginx can then reach backend VMs via private IPs
Option B: Cloudflare Tunnel on Each Backend VM
For each backend VM:
# SSH to backend VM
ssh besuadmin@<vm-private-ip>
# Run setup script
wget https://raw.githubusercontent.com/your-repo/terraform/phases/phase1/scripts/setup-cloudflare-tunnel-backend.sh
chmod +x setup-cloudflare-tunnel-backend.sh
./setup-cloudflare-tunnel-backend.sh <vm-name> <domain-prefix> <cloudflare-account-id>
Then update Nginx to use Cloudflare Tunnel endpoints instead of private IPs.
Option C: Temporary Public IPs (Testing Only)
For initial testing, you can temporarily:
- Add public IPs to backend VMs
- Restrict NSG rules to Nginx proxy IP only
- Update Nginx configuration with public IPs
⚠️ WARNING: This is not recommended for production!
5. Update Nginx Backend Configuration
Once connectivity is established, update Nginx with backend IPs:
# SSH to Nginx proxy
ssh besuadmin@20.160.58.99
# Update backend IPs
wget https://raw.githubusercontent.com/your-repo/terraform/phases/phase1/scripts/update-nginx-backends.sh
chmod +x update-nginx-backends.sh
./update-nginx-backends.sh "10.1.1.4,10.2.1.4,10.3.1.4,10.4.1.4,10.5.1.4"
Or manually edit /etc/nginx/nginx.conf and update the upstream blocks.
6. Configure Cloudflare DNS and SSL
-
DNS Configuration:
- Go to Cloudflare Dashboard → DNS
- Add CNAME record:
- Name:
rpc(or@for root) - Target:
<tunnel-id>.cfargotunnel.com - Proxy: Enabled (orange cloud)
- Name:
-
SSL/TLS Configuration:
- Go to SSL/TLS → Overview
- Set encryption mode to "Full" or "Full (strict)"
- Cloudflare will automatically provision SSL certificates
-
Additional Settings:
- Enable "Always Use HTTPS"
- Configure Security → WAF rules as needed
- Set up DDoS protection (automatic with Cloudflare)
7. Verify End-to-End Connectivity
-
Test Besu RPC:
curl -X POST https://rpc.yourdomain.com/rpc \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' -
Test WebSocket:
wscat -c wss://rpc.yourdomain.com/ws -
Check Nginx Logs:
sudo tail -f /var/log/nginx/access.log sudo tail -f /var/log/nginx/error.log -
Check Cloudflare Tunnel:
sudo cloudflared tunnel info <tunnel-id> sudo journalctl -u cloudflared -f
🔧 Troubleshooting
Backend VMs Unreachable
Issue: Nginx proxy cannot reach backend VMs.
Solutions:
- Deploy VPN/ExpressRoute for cross-region connectivity
- Install Cloudflare Tunnel on each backend VM
- Temporarily use public IPs (testing only)
Cloudflare Tunnel Not Connecting
Issue: Tunnel shows as disconnected.
Solutions:
- Check tunnel status:
sudo cloudflared tunnel info <tunnel-id> - Verify credentials:
ls -la /root/.cloudflared/ - Check logs:
sudo journalctl -u cloudflared -f - Re-authenticate:
sudo cloudflared tunnel login
Besu Node Not Starting
Issue: Besu service fails to start.
Solutions:
- Check logs:
sudo journalctl -u besu.service -f - Verify Docker:
sudo systemctl status docker - Check configuration:
cat /opt/besu/config/besu-config.toml - Verify genesis file:
cat /opt/besu/config/genesis.json
Nginx Configuration Errors
Issue: Nginx fails to reload.
Solutions:
- Test configuration:
sudo nginx -t - Check syntax:
sudo nginx -T - View error log:
sudo tail -f /var/log/nginx/error.log - Restore backup:
sudo cp /etc/nginx/nginx.conf.backup.* /etc/nginx/nginx.conf
📊 Monitoring
Key Metrics to Monitor
-
Besu Nodes:
- Block height synchronization
- Peer connections
- RPC request latency
- Memory and CPU usage
-
Nginx Proxy:
- Request rate and latency
- Backend health status
- Error rates
- Connection pool usage
-
Cloudflare Tunnel:
- Connection status
- Data transfer
- Error rates
Log Locations
- Besu:
/opt/besu/logs/besu.logordocker logs besu-<node-type>-<index> - Nginx:
/var/log/nginx/access.logand/var/log/nginx/error.log - Cloudflare Tunnel:
journalctl -u cloudflared -f - System:
journalctl -u besu.service -f
🔐 Security Checklist
- Restrict NSG rules to specific IP ranges
- Configure Key Vault network ACLs
- Enable Cloudflare WAF rules
- Set up SSL/TLS (Full or Full strict)
- Configure firewall rules on VMs
- Enable Azure Monitor and alerts
- Set up backup verification
- Configure log retention policies
📝 Scripts Provided
All setup scripts are available in terraform/phases/phase1/scripts/:
setup-cloudflare-tunnel.sh- Cloudflare Tunnel on Nginx proxysetup-besu-node.sh- Besu node configurationupdate-nginx-backends.sh- Update Nginx backend IPssetup-cloudflare-tunnel-backend.sh- Cloudflare Tunnel on backend VMs
🎯 Success Criteria
Phase 1 setup is complete when:
- All VMs are deployed and accessible
- Besu nodes are running on all backend VMs
- Cloudflare Tunnel is connected and routing traffic
- Nginx proxy is routing to backend VMs
- DNS is configured and resolving
- SSL/TLS is enabled and working
- RPC endpoints are accessible via domain
- Monitoring and logging are configured
- Backups are configured and tested
For detailed instructions, see:
CLOUDFLARE_TUNNEL_SETUP.md- Cloudflare Tunnel configurationDEPLOYMENT_COMPLETE.md- Deployment summary- Scripts in
scripts/directory