Harden deployment env flows and surface external blockers
Some checks failed
Deploy to Phoenix / validate (push) Failing after 10s
Deploy to Phoenix / deploy (push) Has been skipped
Deploy to Phoenix / deploy-atomic-swap-dapp (push) Has been skipped
Deploy to Phoenix / cloudflare (push) Has been skipped

This commit is contained in:
defiQUG
2026-04-22 14:47:52 -07:00
parent dc123ff647
commit d9a3053a58
19 changed files with 318 additions and 51 deletions

View File

@@ -38,6 +38,7 @@ RPC_DEFAULTS = {
or "https://rpc-core.d-bis.org",
"651940": os.environ.get("CHAIN_651940_RPC")
or os.environ.get("CHAIN_651940_RPC_URL")
or os.environ.get("ALL_MAINNET_RPC")
or os.environ.get("ALLTRA_MAINNET_RPC")
or "https://mainnet-rpc.alltra.global",
"1": os.environ.get("ETHEREUM_MAINNET_RPC") or "https://eth.llamarpc.com",
@@ -335,13 +336,15 @@ class PoolBuilder:
quote_symbol = venue.get("quote")
notes = list(venue.get("notes", []))
if any(note in PLACEHOLDER_NOTES for note in notes):
status = "planned_reference_placeholder"
status = "documented_reference_surface"
elif venue.get("live"):
status = "live"
elif venue.get("protocol") == "1inch" and venue.get("supported"):
status = "documented_aggregator_surface"
elif venue.get("supported"):
status = "supported_not_live"
status = "documented_reference_surface"
else:
status = "unsupported"
status = "documented_unsupported_surface"
return {
"chainId": int(chain_id),
"network": chain_data["name"],

View File

@@ -8,7 +8,20 @@
set -euo pipefail
DEPLOYER="${DEPLOYER_ADDRESS:-0x4A666F96fC8764181194447A7dFdb7d471b301C8}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
cd "$PROJECT_ROOT"
if [[ -f "$PROJECT_ROOT/scripts/lib/load-project-env.sh" ]]; then
# shellcheck disable=SC1090
source "$PROJECT_ROOT/scripts/lib/load-project-env.sh" >/dev/null 2>&1 || true
fi
DEPLOYER="${DEPLOYER_ADDRESS:-}"
if [[ -z "$DEPLOYER" && -n "${PRIVATE_KEY:-}" ]]; then
DEPLOYER="$(cast wallet address "$PRIVATE_KEY" 2>/dev/null || true)"
fi
DEPLOYER="${DEPLOYER:-0x4A666F96fC8764181194447A7dFdb7d471b301C8}"
RPC="${1:-${RPC_URL_138:-https://rpc-core.d-bis.org}}"
EXPLORER_API="${2:-https://explorer.d-bis.org/api/v2}"
@@ -67,11 +80,13 @@ fi
# --- 3. Compare ---
echo ""
if [ -n "$RPC_WEI" ] && [ -n "$BLOCKSCOUT_WEI" ]; then
if [ "$RPC_WEI" -ge "$BLOCKSCOUT_WEI" ]; then
DIFF=$((RPC_WEI - BLOCKSCOUT_WEI))
else
DIFF=$((BLOCKSCOUT_WEI - RPC_WEI))
fi
DIFF="$(python3 - "$RPC_WEI" "$BLOCKSCOUT_WEI" <<'PY'
import sys
rpc = int(sys.argv[1])
blockscout = int(sys.argv[2])
print(abs(rpc - blockscout))
PY
)"
if [ "$DIFF" -le 1 ]; then
echo "Match: RPC and Blockscout balances match (diff <= 1 wei)."
else

View File

@@ -0,0 +1,130 @@
#!/usr/bin/env bash
# Check external dependencies that cannot be satisfied by repo-only changes.
# Default: fail when any external blocker is unresolved.
# Use --advisory to always exit 0 while still printing blocker status.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
if [[ -f "$PROJECT_ROOT/scripts/lib/load-project-env.sh" ]]; then
# shellcheck disable=SC1091
source "$PROJECT_ROOT/scripts/lib/load-project-env.sh"
fi
ADVISORY=0
[[ "${1:-}" == "--advisory" ]] && ADVISORY=1
PASS_COUNT=0
FAIL_COUNT=0
log_ok() { printf '[OK] %s\n' "$1"; }
log_block() { printf '[BLOCKED] %s\n' "$1"; }
record_pass() {
PASS_COUNT=$((PASS_COUNT + 1))
log_ok "$1"
}
record_fail() {
FAIL_COUNT=$((FAIL_COUNT + 1))
log_block "$1"
}
http_ok() {
local url="$1"
curl -fsS -m 8 -o /dev/null "$url"
}
check_url_blocker() {
local blocker_id="$1"
local label="$2"
local url="${3:-}"
local hint="$4"
if [[ -z "$url" ]]; then
record_fail "$blocker_id $label: unresolved. $hint"
return 0
fi
if http_ok "$url"; then
record_pass "$blocker_id $label: reachable at $url"
else
record_fail "$blocker_id $label: configured but unreachable at $url"
fi
}
check_chain138_ci_rpc() {
local blocker_id="EXT-CHAIN138-CI-RPC"
local rpc="${CHAIN138_CI_RPC_URL:-${RPC_URL_138_PUBLIC:-${CHAIN138_PUBLIC_RPC_URL:-}}}"
if [[ -z "$rpc" ]]; then
record_fail "$blocker_id Chain 138 CI RPC: unresolved. Set CHAIN138_CI_RPC_URL (preferred) or RPC_URL_138_PUBLIC to a runner-reachable endpoint."
return 0
fi
if ! command -v cast >/dev/null 2>&1; then
record_fail "$blocker_id Chain 138 CI RPC: cast not available to verify $rpc"
return 0
fi
local block_number
block_number="$(cast block-number --rpc-url "$rpc" 2>/dev/null || true)"
if [[ -n "$block_number" ]]; then
record_pass "$blocker_id Chain 138 CI RPC: reachable at $rpc (block $block_number)"
else
record_fail "$blocker_id Chain 138 CI RPC: configured but unreachable at $rpc"
fi
}
echo "=== External Dependency Check ==="
echo ""
check_url_blocker \
"EXT-DBIS-CORE" \
"dbis_core deployment" \
"${DBIS_CORE_URL:-}" \
"Deploy dbis_core or set DBIS_CORE_URL to an existing reachable instance."
check_url_blocker \
"EXT-CC-PAYMENT-ADAPTERS" \
"cc-payment-adapters implementation" \
"${CC_PAYMENT_ADAPTERS_URL:-}" \
"Implement/host cc-payment-adapters and set CC_PAYMENT_ADAPTERS_URL."
check_url_blocker \
"EXT-CC-AUDIT-LEDGER" \
"cc-audit-ledger implementation" \
"${CC_AUDIT_LEDGER_URL:-}" \
"Implement/host cc-audit-ledger and set CC_AUDIT_LEDGER_URL."
check_url_blocker \
"EXT-CC-SHARED-EVENTS" \
"cc-shared-events implementation" \
"${CC_SHARED_EVENTS_URL:-}" \
"Implement/host cc-shared-events and set CC_SHARED_EVENTS_URL."
check_url_blocker \
"EXT-CC-SHARED-SCHEMAS" \
"cc-shared-schemas implementation" \
"${CC_SHARED_SCHEMAS_URL:-}" \
"Implement/host cc-shared-schemas and set CC_SHARED_SCHEMAS_URL."
check_url_blocker \
"EXT-FIN-GATEWAY" \
"FIN / Alliance Access gateway" \
"${FIN_GATEWAY_URL:-${ALLIANCE_ACCESS_URL:-}}" \
"Provision a real FIN / Alliance Access gateway and set FIN_GATEWAY_URL or ALLIANCE_ACCESS_URL."
check_chain138_ci_rpc
echo ""
echo "Resolved: $PASS_COUNT"
echo "Blocked: $FAIL_COUNT"
if (( FAIL_COUNT > 0 )) && (( ADVISORY == 0 )); then
exit 1
fi
exit 0

View File

@@ -60,6 +60,15 @@ else
fi
echo ""
echo "3c. External dependency blockers..."
EXT_CHECK="$SCRIPT_DIR/check-external-dependencies.sh"
if [[ -x "$EXT_CHECK" ]]; then
bash "$EXT_CHECK" --advisory || true
else
echo " (skip: $EXT_CHECK missing)"
fi
echo ""
if [[ "$SKIP_GENESIS" == true ]]; then
echo "4. Genesis — skipped (--skip-genesis)"
else