- Resolve stash: merge load_deployment_env path with secure-secrets and CR/LF RPC strip - create-pmm-full-mesh-chain138.sh delegates to sync-chain138-pmm-pools-from-json.sh - env.additions.example: canonical PMM pool defaults (cUSDT/USDT per crosscheck) - Include Chain138 scripts, official mirror deploy scaffolding, and prior staged changes Made-with: Cursor
52 lines
1.9 KiB
Bash
Executable File
52 lines
1.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Generate static-nodes.json from deployed node information
|
|
# Run this after nodes are deployed to get their enode addresses
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "$SCRIPT_DIR/../lib/init.sh"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
cd "$PROJECT_ROOT"
|
|
# Load .env via dotenv (RPC CR/LF trim). Fallback: raw source.
|
|
if [[ -f "$SCRIPT_DIR/../lib/deployment/dotenv.sh" ]]; then
|
|
# shellcheck disable=SC1090
|
|
source "$SCRIPT_DIR/../lib/deployment/dotenv.sh"
|
|
load_deployment_env --repo-root "${PROJECT_ROOT:-$REPO_ROOT}"
|
|
elif [[ -n "${PROJECT_ROOT:-}" && -f "$PROJECT_ROOT/.env" ]]; then
|
|
set -a
|
|
# shellcheck disable=SC1090
|
|
source "$PROJECT_ROOT/.env"
|
|
set +a
|
|
elif [[ -n "${REPO_ROOT:-}" && -f "$REPO_ROOT/.env" ]]; then
|
|
set -a
|
|
# shellcheck disable=SC1090
|
|
source "$REPO_ROOT/.env"
|
|
set +a
|
|
fi
|
|
|
|
CONFIG_DIR="$PROJECT_ROOT/config"
|
|
|
|
echo "=== Generating static-nodes.json ==="
|
|
echo "This script generates static-nodes.json from deployed nodes."
|
|
echo "For now, creating template with placeholders."
|
|
|
|
cat > "$CONFIG_DIR/static-nodes.json" << 'EOF'
|
|
[
|
|
"enode://<validator-1-public-key>@<validator-1-ip>:30303",
|
|
"enode://<validator-2-public-key>@<validator-2-ip>:30303",
|
|
"enode://<validator-3-public-key>@<validator-3-ip>:30303",
|
|
"enode://<validator-4-public-key>@<validator-4-ip>:30303",
|
|
"enode://<sentry-1-public-key>@<sentry-1-ip>:30303",
|
|
"enode://<sentry-2-public-key>@<sentry-2-ip>:30303",
|
|
"enode://<sentry-3-public-key>@<sentry-3-ip>:30303"
|
|
]
|
|
EOF
|
|
|
|
echo "✅ Created static-nodes.json template"
|
|
echo "After deployment, update with actual:"
|
|
echo " 1. Node public keys (from keys/validators and keys/sentries)"
|
|
echo " 2. Node IP addresses (from kubectl get pods -n besu-network)"
|
|
echo "To extract enode addresses from running nodes:"
|
|
echo " kubectl exec -n besu-network besu-validator-0 -- besu public-key export --node-private-key-file=/keys/key.priv"
|