Standardize deployment env and deployer handling

This commit is contained in:
defiQUG
2026-04-22 14:47:28 -07:00
parent 768168de5e
commit c3d4c786fa
51 changed files with 424 additions and 621 deletions

View File

@@ -28,7 +28,7 @@ fi
# Default values
MODE="${MODE:-ordered}" # ordered or parallel
RPC_URL="${RPC_URL:-http://localhost:8545}"
RPC_URL="${RPC_URL:-}"
PRIVATE_KEY="${PRIVATE_KEY:-}"
DRY_RUN="${DRY_RUN:-false}"
@@ -81,24 +81,19 @@ while [[ $# -gt 0 ]]; do
usage
;;
*)
echo "Unknown option: $1"
echo "ERROR: Unknown option: $1" >&2
usage
;;
esac
done
if [ -z "$PRIVATE_KEY" ]; then
if [ -f .env ]; then
source .env
fi
if [ -z "$PRIVATE_KEY" ]; then
log_error "Error: PRIVATE_KEY not set. Use --private-key or set in .env"
exit 1
fi
if ! require_private_key_env "Use --private-key or set PRIVATE_KEY in smom-dbis-138/.env, repo .env, or ~/.secure-secrets/private-keys.env."; then
exit 1
fi
RPC_URL="${RPC_URL:-${RPC_URL_138:-${CHAIN138_RPC_URL:-}}}"
if [ -z "$RPC_URL" ]; then
log_error "Error: RPC_URL not set. Use --rpc-url or set in .env"
log_error "ERROR: Chain 138 RPC not available. Use --rpc-url or set RPC_URL/RPC_URL_138/CHAIN138_RPC_URL."
exit 1
fi