Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- 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>
62 lines
1.4 KiB
Bash
Executable File
62 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Post-startup Validator Verification
|
|
# Verifies validator started successfully after ExecStart
|
|
|
|
set -euo pipefail
|
|
|
|
# Colors
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m'
|
|
|
|
log_error() { echo -e "${RED}[ERROR]${NC} $1" >&2; }
|
|
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
|
log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
|
|
|
|
check_process() {
|
|
if pgrep -f "besu.*validator" > /dev/null; then
|
|
log_info "Besu validator process is running"
|
|
return 0
|
|
else
|
|
log_error "Besu validator process is NOT running"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
check_logs() {
|
|
local error_count=$(journalctl -u besu-validator.service --no-pager -n 20 2>&1 | grep -iE "error|Error|ERROR|exception|Exception|failed|Failed" | wc -l || echo "0")
|
|
|
|
if [ "$error_count" -gt 0 ]; then
|
|
log_warn "Found $error_count error(s) in recent logs"
|
|
return 1
|
|
else
|
|
log_info "No errors in recent logs"
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
main() {
|
|
log_info "Verifying validator startup..."
|
|
|
|
local issues=0
|
|
|
|
if ! check_process; then
|
|
((issues++))
|
|
fi
|
|
|
|
if ! check_logs; then
|
|
((issues++))
|
|
fi
|
|
|
|
if [ "$issues" -eq 0 ]; then
|
|
log_info "Validator started successfully"
|
|
exit 0
|
|
else
|
|
log_error "Validator startup verification failed"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
main "$@"
|