Fix MEV backend and token-aggregation deployment wiring
All checks were successful
Deploy to Phoenix / deploy (push) Successful in 12s

This commit is contained in:
defiQUG
2026-04-15 03:25:30 -07:00
parent 382e776599
commit 59006f520a
12 changed files with 264 additions and 15 deletions

View File

@@ -19,6 +19,8 @@ set -euo pipefail
BUNDLE_ROOT="${1:?Usage: $0 /path/to/token-aggregation-build}"
SERVICE_SRC="$BUNDLE_ROOT/smom-dbis-138/services/token-aggregation"
CONFIG_SRC="$BUNDLE_ROOT/config"
PMM_CONFIG_SRC="$BUNDLE_ROOT/cross-chain-pmm-lps/config"
EXPLORER_SSH="${EXPLORER_SSH:-root@192.168.11.140}"
REMOTE_DIR="${REMOTE_DIR:-/opt/token-aggregation}"
REMOTE_SERVICE="${REMOTE_SERVICE:-token-aggregation}"
@@ -28,6 +30,10 @@ if [[ ! -d "$SERVICE_SRC" || ! -f "$SERVICE_SRC/dist/index.js" ]]; then
echo "Expected built service at $SERVICE_SRC (run deploy-token-aggregation-for-publication.sh first)." >&2
exit 1
fi
if [[ ! -d "$CONFIG_SRC" || ! -d "$PMM_CONFIG_SRC" ]]; then
echo "Expected bundle config directories at $CONFIG_SRC and $PMM_CONFIG_SRC." >&2
exit 1
fi
echo "Rsync $SERVICE_SRC/ → ${EXPLORER_SSH}:${REMOTE_DIR}/"
rsync_args=(
@@ -46,6 +52,16 @@ fi
RSYNC_RSH="ssh -o BatchMode=yes" rsync "${rsync_args[@]}" \
"$SERVICE_SRC/" "${EXPLORER_SSH}:${REMOTE_DIR}/"
echo "Rsync $CONFIG_SRC/ → ${EXPLORER_SSH}:${REMOTE_DIR}/config/"
RSYNC_RSH="ssh -o BatchMode=yes" rsync -avz --delete \
"$CONFIG_SRC/" "${EXPLORER_SSH}:${REMOTE_DIR}/config/"
echo "Rsync $PMM_CONFIG_SRC/ → ${EXPLORER_SSH}:${REMOTE_DIR}/cross-chain-pmm-lps/config/"
ssh -o BatchMode=yes "$EXPLORER_SSH" \
"mkdir -p '${REMOTE_DIR}/cross-chain-pmm-lps/config'"
RSYNC_RSH="ssh -o BatchMode=yes" rsync -avz --delete \
"$PMM_CONFIG_SRC/" "${EXPLORER_SSH}:${REMOTE_DIR}/cross-chain-pmm-lps/config/"
if [[ -n "$REMOTE_SERVICE" ]]; then
echo "Restart ${REMOTE_SERVICE} on ${EXPLORER_SSH}..."
ssh -o BatchMode=yes "$EXPLORER_SSH" "systemctl restart '${REMOTE_SERVICE}'" || {

View File

@@ -380,6 +380,19 @@ if [[ -z "$tx_hash" ]]; then
exit 1
fi
receipt_output="$(cast receipt "$tx_hash" --rpc-url "$RPC_URL" 2>&1 || true)"
receipt_status="$(printf '%s\n' "$receipt_output" | awk '/^status[[:space:]]/ {print $2; exit}')"
if [[ -z "$receipt_status" ]]; then
echo "[fail] could not determine transaction receipt status for $tx_hash" >&2
printf '%s\n' "$receipt_output" >&2
exit 1
fi
if [[ "$receipt_status" != "1" ]]; then
echo "[fail] transaction reverted on-chain for ${tx_mode}: txHash=$tx_hash status=$receipt_status" >&2
printf '%s\n' "$receipt_output" >&2
exit 1
fi
balance_in_after="$(cast call "$TOKEN_IN" 'balanceOf(address)(uint256)' "$DEPLOYER" --rpc-url "$RPC_URL" | awk '{print $1}')"
balance_out_after="$(cast call "$TOKEN_OUT" 'balanceOf(address)(uint256)' "$DEPLOYER" --rpc-url "$RPC_URL" | awk '{print $1}')"
amount_out_delta=$((balance_out_after - balance_out_before))
@@ -409,6 +422,7 @@ echo "minOut=$MIN_OUT"
echo "tokenIn=$TOKEN_IN"
echo "tokenOut=$TOKEN_OUT"
echo "txHash=$tx_hash"
echo "txReceiptStatus=$receipt_status"
echo "tokenInBalanceBefore=$balance_in_before"
echo "tokenInBalanceAfter=$balance_in_after"
echo "tokenOutBalanceBefore=$balance_out_before"

View File

@@ -157,7 +157,7 @@ PATCH_CMD+=(--apply)
CT_VERIFY_CMD=$(cat <<EOF
set -euo pipefail
printf '== env ==\n'
grep -E '^(MEV_CONFIG|MEV_ADMIN_PORT|MEV_SUPERVISOR_PORT|MEV_SUBMIT_DISABLED|MEV_ADMIN_API_KEY|MEV_EXECUTOR_PRIVATE_KEY)=' /etc/mev-platform/backend.env || true
grep -E '^(MEV_CONFIG|MEV_ADMIN_PORT|MEV_SUPERVISOR_PORT|MEV_SUPERVISOR_URL|MEV_SUBMIT_DISABLED|MEV_ADMIN_API_KEY|MEV_EXECUTOR_PRIVATE_KEY)=' /etc/mev-platform/backend.env || true
printf '\n== services ==\n'
systemctl restart mev-supervisor.service
systemctl restart mev-admin-api.service
@@ -166,6 +166,9 @@ systemctl --no-pager --full status mev-supervisor.service mev-admin-api.service
printf '\n== local api ==\n'
curl -fsS http://127.0.0.1:9090/api/health | jq .
curl -fsS http://127.0.0.1:9090/api/auth/check | jq .
if [ -n "${API_KEY:-}" ]; then
curl -fsS -H "X-API-Key: ${API_KEY}" http://127.0.0.1:9090/api/control/status | jq .
fi
if [ -n "${API_KEY:-}" ]; then
curl -fsS -H "X-API-Key: ${API_KEY}" http://127.0.0.1:9090/api/infra | jq .
curl -fsS -H "X-API-Key: ${API_KEY}" http://127.0.0.1:9090/api/safety/signer | jq .