#!/bin/bash # Complete setup script - Generates keys and configures allowlist # Usage: ./scripts/setup-complete.sh [key-count] [password] set -e KEY_COUNT="${1:-3}" PASSWORD="${2:-changeme}" echo "═══════════════════════════════════════════════════════════════" echo "🚀 COMPLETE SETUP - WEB3SIGNER KEYS AND ALLOWLIST" echo "═══════════════════════════════════════════════════════════════" echo "" echo "This script will:" echo " 1. Generate test keystore files" echo " 2. Copy keys to Web3Signer" echo " 3. Get public keys (addresses)" echo " 4. Configure wallet allowlist on all translators" echo "" # Generate keys echo "Step 1: Generating test keys..." TEMP_DIR=$(mktemp -d) trap "rm -rf $TEMP_DIR" EXIT cd "$TEMP_DIR" if command -v node &> /dev/null; then # Use Node.js if available node < \${address}\`); } NODEJS else echo "⚠️ Node.js not available - skipping key generation" echo " Install Node.js or provide keystore files manually" exit 1 fi # Setup Web3Signer keys echo "" echo "Step 2: Setting up Web3Signer keys..." cd /home/intlc/projects/proxmox/rpc-translator-138 ./scripts/setup-web3signer-keys.sh "$TEMP_DIR" 2>&1 | tail -20 # Get public keys echo "" echo "Step 3: Getting public keys..." sleep 3 PUBLIC_KEYS=$(curl -s http://192.168.11.111:9000/api/v1/eth1/publicKeys 2>/dev/null || echo "[]") if [ "$PUBLIC_KEYS" != "[]" ] && [ -n "$PUBLIC_KEYS" ]; then ADDRESSES=$(echo "$PUBLIC_KEYS" | jq -r '.[]' 2>/dev/null | tr '\n' ',' | sed 's/,$//') if [ -n "$ADDRESSES" ]; then echo "Found addresses: $ADDRESSES" echo "" echo "Step 4: Configuring wallet allowlist..." ./scripts/configure-wallet-allowlist.sh "$ADDRESSES" 2>&1 | tail -15 else echo "⚠️ Could not parse addresses from Web3Signer" fi else echo "⚠️ No keys found in Web3Signer" fi echo "" echo "═══════════════════════════════════════════════════════════════" echo "✅ SETUP COMPLETE" echo "═══════════════════════════════════════════════════════════════"