Files
proxmox/scripts/deployment/unpause-mainnet-weth-relay-lane.sh
defiQUG dbd517b279 Sync workspace: config, docs, scripts, CI, operator rules, and submodule pointers.
- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains
- Omit embedded publish git dirs and empty placeholders from index

Made-with: Cursor
2026-04-12 06:12:20 -07:00

63 lines
1.9 KiB
Bash

#!/usr/bin/env bash
# Default: plan-only. Use --apply only after bridge inventory is restored.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
APPLY=0
MIN_BRIDGE_WEI="${MIN_BRIDGE_WETH_WEI:-10000000000000000}"
PROFILE_ENV="${RELAY_PROFILE_ENV_MAINNET_WETH:-${PROJECT_ROOT}/smom-dbis-138/services/relay/.env.mainnet-weth}"
SERVICE_NAME="${MAINNET_WETH_RELAY_SERVICE:-ccip-relay}"
while [[ $# -gt 0 ]]; do
case "$1" in
--apply) APPLY=1; shift ;;
--dry-run) APPLY=0; shift ;;
--min-bridge-weth-wei) MIN_BRIDGE_WEI="${2:-}"; shift 2 ;;
*)
echo "Usage: $0 [--apply|--dry-run] [--min-bridge-weth-wei WEI]" >&2
exit 1
;;
esac
done
[[ -f "$PROFILE_ENV" ]] || { echo "Profile env not found: $PROFILE_ENV" >&2; exit 1; }
if [[ "$APPLY" != "1" ]]; then
echo "Dry run only. This will NOT modify ${PROFILE_ENV}."
echo "Planned changes:"
echo " - set RELAY_SHEDDING=0"
echo " - ensure RELAY_DELIVERY_ENABLED=1"
echo " - restart service: $SERVICE_NAME"
echo
echo "Before apply, verify readiness:"
echo " bash scripts/verify/check-mainnet-weth-relay-lane.sh"
echo " bash scripts/bridge/fund-mainnet-relay-bridge.sh --target-bridge-balance-wei $MIN_BRIDGE_WEI --dry-run"
exit 0
fi
tmp_file="$(mktemp)"
trap 'rm -f "$tmp_file"' EXIT
cp "$PROFILE_ENV" "$tmp_file"
if grep -q '^RELAY_SHEDDING=' "$tmp_file"; then
sed -i 's/^RELAY_SHEDDING=.*/RELAY_SHEDDING=0/' "$tmp_file"
else
printf '\nRELAY_SHEDDING=0\n' >> "$tmp_file"
fi
if grep -q '^RELAY_DELIVERY_ENABLED=' "$tmp_file"; then
sed -i 's/^RELAY_DELIVERY_ENABLED=.*/RELAY_DELIVERY_ENABLED=1/' "$tmp_file"
else
printf 'RELAY_DELIVERY_ENABLED=1\n' >> "$tmp_file"
fi
cp "$tmp_file" "$PROFILE_ENV"
echo "Updated $PROFILE_ENV"
echo "Next step on the relay host:"
echo " sudo systemctl restart $SERVICE_NAME"
echo "Then verify:"
echo " bash scripts/verify/check-mainnet-weth-relay-lane.sh"