Files
proxmox/scripts/list-single-sided-pools-by-chain.sh
defiQUG e4c9dda0fd
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
chore: update submodule references and documentation
- Marked submodules ai-mcp-pmm-controller, explorer-monorepo, and smom-dbis-138 as dirty to reflect recent changes.
- Updated documentation to clarify operator script usage, including dotenv loading and task execution instructions.
- Enhanced the README and various index files to provide clearer navigation and task completion guidance.

Made-with: Cursor
2026-03-04 02:03:08 -08:00

56 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# List single-sided PMM pools to create per public chain (for aggregator and DEX routing).
# Reads cross-chain-pmm-lps/config/pool-matrix.json and prints poolsFirst + poolsOptional per chain.
# Usage: ./scripts/list-single-sided-pools-by-chain.sh [chain_id]
# If chain_id is omitted, lists all chains. If provided, lists only that chain.
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
MATRIX="${REPO_ROOT}/cross-chain-pmm-lps/config/pool-matrix.json"
if [[ ! -f "$MATRIX" ]]; then
echo "Not found: $MATRIX"
exit 1
fi
if ! command -v jq &>/dev/null; then
echo "jq is required. Install with: apt-get install jq / brew install jq"
exit 1
fi
CHAIN="${1:-}"
list_chain() {
local cid="$1"
local name name_hub first optional
name=$(jq -r --arg c "$cid" '.chains[$c].name // "Unknown"' "$MATRIX")
name_hub=$(jq -r --arg c "$cid" '.chains[$c].hubStable // "?"' "$MATRIX")
echo "Chain $cid$name (hub: $name_hub)"
echo " poolsFirst (create these first):"
jq -r --arg c "$cid" '.chains[$c].poolsFirst[]?' "$MATRIX" 2>/dev/null | while read -r p; do
[[ -n "$p" ]] && echo " - $p"
done
echo " poolsOptional:"
jq -r --arg c "$cid" '.chains[$c].poolsOptional[]?' "$MATRIX" 2>/dev/null | while read -r p; do
[[ -n "$p" ]] && echo " - $p"
done
echo ""
}
if [[ -n "$CHAIN" ]]; then
if ! jq -e --arg c "$CHAIN" '.chains[$c]' "$MATRIX" &>/dev/null; then
echo "Chain $CHAIN not found in pool-matrix.json"
exit 1
fi
list_chain "$CHAIN"
else
for cid in $(jq -r '.chains | keys[]' "$MATRIX"); do
list_chain "$cid"
done
fi
echo "---"
echo "Source: $MATRIX"
echo "Use SINGLE_SIDED_LPS_PUBLIC_NETWORKS_RUNBOOK.md for deployment steps."