Files
proxmox/scripts/besu-verify-peers.sh.bak
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

63 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# Check peer connections on Besu node
# Usage: bash besu-verify-peers.sh <rpc-url>
# Example: bash besu-verify-peers.sh http://192.168.11.13:8545
set -euo pipefail
RPC_URL="${1:-http://localhost:8545}"
echo "Checking peers on: $RPC_URL"
echo ""
# Get node info
NODE_INFO=$(curl -s -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":1}' \
"${RPC_URL}")
ENODE=$(echo "$NODE_INFO" | python3 -c "import sys, json; print(json.load(sys.stdin).get('result', {}).get('enode', 'ERROR'))" 2>/dev/null)
if [[ "$ENODE" == "ERROR" ]] || [[ -z "$ENODE" ]]; then
echo "ERROR: Could not get node info. Is RPC enabled with ADMIN API?" >&2
exit 1
fi
echo "This node's enode:"
echo "$ENODE"
echo ""
# Get peers
PEERS_RESPONSE=$(curl -s -X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"admin_peers","params":[],"id":2}' \
"${RPC_URL}")
PEERS=$(echo "$PEERS_RESPONSE" | python3 -c "import sys, json; peers=json.load(sys.stdin).get('result', []); print(len(peers))" 2>/dev/null)
PEERS_LIST=$(echo "$PEERS_RESPONSE" | python3 -c "import sys, json; peers=json.load(sys.stdin).get('result', []); [print(f\" - {p.get('enode', 'unknown')}\") for p in peers]" 2>/dev/null)
echo "Connected peers: $PEERS"
echo ""
if [[ "$PEERS" == "0" ]]; then
echo "⚠️ NO PEERS CONNECTED"
echo ""
echo "Possible causes:"
echo "1. Other nodes not running"
echo "2. Firewall blocking port 30303"
echo "3. Malformed enodes in allowlist"
echo "4. Discovery disabled and static-nodes.json incorrect"
echo "5. Permissions enabled but allowlist missing this node"
echo "6. Network connectivity issues"
else
echo "Peer list:"
echo "$PEERS_LIST"
fi
# Check peer details if jq available
if [[ "$PEERS" != "0" ]] && command -v jq >/dev/null 2>&1; then
echo ""
echo "Peer details:"
echo "$PEERS_RESPONSE" | jq -r '.result[] | " - \(.id): \(.name) @ \(.network.remoteAddress)"'
fi