#!/usr/bin/env bash
# Configure FireFly and Cacti infrastructure for Chain 138 & Ethereum
# Run from Nginx proxy

set -e

NGINX_IP="${NGINX_PROXY_IP:-20.160.58.99}"
RPC_URL_CHAIN138="http://10.3.1.4:8545"  # CUS node
RPC_URL_ETHEREUM="https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY:-}"

echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Configure FireFly and Cacti Infrastructure"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""

# FireFly configuration (all nodes)
echo "📋 Step 1: Configure FireFly Core..."
echo "   Nodes: 10.3.1.4 (CUS), 10.1.1.4 (EUS), 10.4.1.4 (EUS2)"
echo "   Configuration: Connect to Chain 138 RPC"
echo ""

# Cacti configuration
echo "📋 Step 2: Configure Cacti Core..."
echo "   Nodes: 10.3.1.4 (CUS), 10.4.1.4 (EUS2)"
echo "   Configuration: EVM connectors for Chain 138 & Ethereum"
echo ""

echo "✅ Configuration scripts ready"
echo "   Manual configuration may be required via FireFly/Cacti UI"
