feat: restore operator WIP — PMM JSON sync entrypoint, dotenv RPC trim + secrets, pool env alignment

- 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
This commit is contained in:
defiQUG
2026-03-27 19:02:30 -07:00
parent c6e7bad15e
commit 2a4753eb2d
200 changed files with 5987 additions and 913 deletions

View File

@@ -1,29 +1,25 @@
#!/usr/bin/env bash
# Source the correct dotenv for smom-dbis-138 (single source for deploy, relay, token-aggregation).
# Uses repo-root .env unless ENV_FILE is already set. Export ENV_FILE so scripts using
# scripts/lib/deployment/dotenv.sh (load_deployment_env) use the same file.
# Source smom-dbis-138 dotenv with RPC CR/LF trimming (load_deployment_env).
# Uses repo-root .env unless ENV_FILE is set. Prefer this over raw `source .env` in new scripts.
# Usage: source scripts/load-env.sh (from smom-dbis-138)
# source smom-dbis-138/scripts/load-env.sh (from repo root)
# ENV_FILE=/path/to/.env source scripts/load-env.sh (override)
# Do not execute; source it so variables are in the current shell.
# ENV_FILE=/path/to/.env source scripts/load-env.sh
# Do not execute; source so variables apply to the current shell.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
[[ -z "${ENV_FILE:-}" ]] && ENV_FILE="${SCRIPT_DIR}/../.env"
export ENV_FILE
if [[ -f "$ENV_FILE" ]]; then
set -a
source "$ENV_FILE"
set +a
SECURE_SECRETS_FILE="${SECURE_SECRETS_FILE:-$HOME/.secure-secrets/private-keys.env}"
if [[ -f "$SECURE_SECRETS_FILE" ]]; then
set -a
source "$SECURE_SECRETS_FILE"
set +a
fi
if [[ -z "${PRIVATE_KEY:-}" && -n "${DEPLOYER_PRIVATE_KEY:-}" ]]; then
export PRIVATE_KEY="$DEPLOYER_PRIVATE_KEY"
fi
echo "Loaded: $ENV_FILE"
export ENV_FILE="${ENV_FILE:-${SCRIPT_DIR}/../.env}"
if [[ -f "$SCRIPT_DIR/lib/deployment/dotenv.sh" ]]; then
# shellcheck disable=SC1090
source "$SCRIPT_DIR/lib/deployment/dotenv.sh"
load_deployment_env --repo-root "$(cd "$SCRIPT_DIR/.." && pwd)"
echo "Loaded via load_deployment_env: ${ENV_FILE:-${SCRIPT_DIR}/../.env}"
else
echo "WARN: $ENV_FILE not found" >&2
if [[ -f "$ENV_FILE" ]]; then
set -a
# shellcheck disable=SC1090
source "$ENV_FILE"
set +a
echo "Loaded: $ENV_FILE (dotenv.sh missing — no RPC trim)"
else
echo "WARN: $ENV_FILE not found" >&2
fi
fi