fix: use admin_addPeer for op-geth peer reconciliation
op-geth does not support admin_addStaticPeer; classify op-geth via compose path (admin_nodeInfo often still says Geth) and fall back on go-ethereum-style "does not exist/is not available" errors so reinject and connect-peers restore peers (e.g. hashkey-mainnet).
This commit is contained in:
@@ -78,16 +78,21 @@ CLIENT_NAME="$(echo "$INFO" | jq -r '.result.name // empty' 2>/dev/null || true)
|
||||
PEERS_JSON="$(rpc admin_peers)"
|
||||
PEER_COUNT="$(echo "$PEERS_JSON" | jq -r '.result | length' 2>/dev/null || echo 0)"
|
||||
|
||||
# Detect client type (connect-peers.sh logic)
|
||||
# Detect client type (connect-peers.sh logic).
|
||||
# op-geth often still reports as "Geth/…" — prefer compose path for op-geth.
|
||||
NAME_LC="$(echo "$CLIENT_NAME" | tr '[:upper:]' '[:lower:]')"
|
||||
CLIENT_TYPE="unknown"
|
||||
case "$NAME_LC" in
|
||||
*op-geth*) CLIENT_TYPE="op-geth" ;;
|
||||
*geth*) CLIENT_TYPE="geth" ;;
|
||||
*reth*) CLIENT_TYPE="reth" ;;
|
||||
*erigon*) CLIENT_TYPE="erigon" ;;
|
||||
*nethermind*) CLIENT_TYPE="nethermind" ;;
|
||||
*besu*) CLIENT_TYPE="besu" ;;
|
||||
esac
|
||||
case "$COMPOSE_PATH" in
|
||||
*op-geth*) CLIENT_TYPE="op-geth" ;;
|
||||
esac
|
||||
|
||||
TS="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||
echo "$PEERS_JSON" | jq -c --arg path "$COMPOSE_PATH" --arg ts "$TS" \
|
||||
|
||||
Reference in New Issue
Block a user