Files
aitbc/dev/scripts/patches/patch_poa_internal.py
oib 3df0a9ed62 chore(cleanup): remove obsolete scripts and update paths for production deployment
- Remove dev/scripts/check-file-organization.sh (obsolete organization checker)
- Remove dev/scripts/community_onboarding.py (unused 559-line automation script)
- Update gpu_miner_host.py log path from /home/oib/windsurf/aitbc to /opt/aitbc
- Add service status and standardization badges to README.md
2026-03-04 13:24:38 +01:00

36 lines
1.3 KiB
Python

with open("/home/oib/windsurf/aitbc/apps/blockchain-node/src/aitbc_chain/consensus/poa.py", "r") as f:
content = f.read()
import re
# Remove httpx import and the try/except block that checks localhost:8082/metrics
content = content.replace("import httpx\n", "")
bad_code = """ # Check RPC mempool for transactions
try:
response = httpx.get("http://localhost:8082/metrics")
if response.status_code == 200:
has_transactions = False
for line in response.text.split("\\n"):
if line.startswith("mempool_size"):
size = float(line.split(" ")[1])
if size > 0:
has_transactions = True
break
if not has_transactions:
return
except Exception as exc:
self._logger.error(f"Error checking RPC mempool: {exc}")
return"""
good_code = """ # Check internal mempool
from ..mempool import get_mempool
if get_mempool().size(self._config.chain_id) == 0:
return"""
content = content.replace(bad_code, good_code)
with open("/home/oib/windsurf/aitbc/apps/blockchain-node/src/aitbc_chain/consensus/poa.py", "w") as f:
f.write(content)