- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains - Omit embedded publish git dirs and empty placeholders from index Made-with: Cursor
60 lines
2.2 KiB
Bash
Executable File
60 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Deployer nonce + Besu txpool snapshot on Chain 138 Core RPC.
|
|
# Usage: bash scripts/verify/check-pending-transactions-chain138.sh
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
# shellcheck source=scripts/lib/load-project-env.sh
|
|
source "${PROJECT_ROOT}/scripts/lib/load-project-env.sh" 2>/dev/null || true
|
|
|
|
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
|
|
RPC_URL="${RPC_URL_138:-http://${RPC_CORE_1:-192.168.11.211}:8545}"
|
|
DEPLOYER="${DEPLOYER_ADDRESS:-0x4A666F96fC8764181194447A7dFdb7d471b301C8}"
|
|
DEPLOYER_LC=$(echo "$DEPLOYER" | tr '[:upper:]' '[:lower:]')
|
|
|
|
echo "=== Chain 138 pending / mempool (Core) ==="
|
|
echo "RPC_URL=$RPC_URL"
|
|
echo "DEPLOYER=$DEPLOYER"
|
|
echo ""
|
|
|
|
if ! command -v cast >/dev/null 2>&1; then
|
|
echo "cast (foundry) required for nonce checks" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! timeout 8 cast chain-id --rpc-url "$RPC_URL" >/dev/null 2>&1; then
|
|
echo "RPC not reachable" >&2
|
|
exit 1
|
|
fi
|
|
|
|
LATEST_HEX=$(cast rpc eth_getTransactionCount "$DEPLOYER_LC" latest --rpc-url "$RPC_URL" 2>/dev/null | tr -d '"')
|
|
PENDING_HEX=$(cast rpc eth_getTransactionCount "$DEPLOYER_LC" pending --rpc-url "$RPC_URL" 2>/dev/null | tr -d '"')
|
|
LATEST_DEC=$(cast --to-dec "$LATEST_HEX" 2>/dev/null || echo "0")
|
|
PENDING_DEC=$(cast --to-dec "$PENDING_HEX" 2>/dev/null || echo "0")
|
|
echo "Deployer latest nonce (next mined): $LATEST_DEC"
|
|
echo "Deployer pending nonce view: $PENDING_DEC"
|
|
echo "Delta (pending - latest): $((PENDING_DEC - LATEST_DEC))"
|
|
echo ""
|
|
|
|
echo "--- txpool_besuStatistics ---"
|
|
cast rpc txpool_besuStatistics --rpc-url "$RPC_URL" 2>/dev/null || echo "(method missing or error)"
|
|
echo ""
|
|
|
|
echo "--- txpool_besuPendingTransactions (count) ---"
|
|
PT=$(cast rpc txpool_besuPendingTransactions --rpc-url "$RPC_URL" 2>/dev/null || echo "[]")
|
|
if command -v jq >/dev/null 2>&1; then
|
|
echo "$PT" | jq 'if type == "array" then length else . end'
|
|
if echo "$PT" | jq -e 'type == "array" and length > 0' >/dev/null 2>&1; then
|
|
echo ""
|
|
echo "--- pending summary (hash, from, nonce, gasPrice) ---"
|
|
echo "$PT" | jq '[.[] | {hash, from, nonce, gasPrice}]'
|
|
fi
|
|
else
|
|
echo "$PT" | head -c 500
|
|
echo ""
|
|
fi
|
|
|
|
echo ""
|
|
echo "=== Done ==="
|