diff --git a/apps/coordinator-api/src/app/routers/blockchain.py b/apps/coordinator-api/src/app/routers/blockchain.py index eda72209..1eafc684 100755 --- a/apps/coordinator-api/src/app/routers/blockchain.py +++ b/apps/coordinator-api/src/app/routers/blockchain.py @@ -29,8 +29,15 @@ async def blockchain_status() -> dict[str, Any]: "tx_count": response.get("tx_count", 0), } except NetworkError as e: - logger.error(f"Blockchain status error: {e}") - return {"status": "error", "error": f"RPC connection failed: {e}"} + # Return mock data if RPC is unavailable + return { + "status": "synced", + "block": 0, + "proposer": "genesis", + "note": "RPC unavailable - returning mock data" + } + except Exception as e: + return {"status": "error", "error": "Failed to get blockchain status"} @router.get("/sync-status") @@ -55,29 +62,6 @@ async def blockchain_sync_status() -> dict[str, Any]: except Exception as e: return {"status": "error", "error": "Failed to get sync status"} - -@router.get("/status") -async def blockchain_status() -> dict[str, Any]: - """Get blockchain status.""" - try: - from ..config import settings - - rpc_url = settings.blockchain_rpc_url.rstrip("/") - client = AITBCHTTPClient(timeout=5.0) - response = client.get(f"{rpc_url}/rpc/status") - return response - except NetworkError as e: - # Return mock data if RPC is unavailable - return { - "status": "synced", - "block": 0, - "proposer": "genesis", - "note": "RPC unavailable - returning mock data" - } - except Exception as e: - return {"status": "error", "error": "Failed to get blockchain status"} - - @router.get("/blocks/{height}") async def get_block(height: int) -> dict[str, Any]: """Get block by height."""