fixes
This commit is contained in:
parent
82261671a1
commit
13dc4f39c8
|
|
@ -357,3 +357,58 @@ async def network_discover(request: Request):
|
|||
except Exception as e:
|
||||
logger.error(f"Discovery error: {e}")
|
||||
raise HTTPException(status_code=500, detail="Internal server error")
|
||||
|
||||
|
||||
# V3 API compatibility endpoints (без подписи для совместимости)
|
||||
@router.get("/v3/node/status")
|
||||
async def v3_node_status():
|
||||
"""
|
||||
V3 API: Статус ноды для совместимости со скриптами
|
||||
"""
|
||||
try:
|
||||
crypto_manager = get_ed25519_manager()
|
||||
|
||||
return {
|
||||
"status": "online",
|
||||
"node_id": crypto_manager.node_id,
|
||||
"version": "3.0.0",
|
||||
"network": "MY Network",
|
||||
"capabilities": [
|
||||
"content_upload",
|
||||
"content_sync",
|
||||
"decentralized_filtering",
|
||||
"ed25519_signatures"
|
||||
],
|
||||
"timestamp": datetime.utcnow().isoformat()
|
||||
}
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"V3 status error: {e}")
|
||||
raise HTTPException(status_code=500, detail="Internal server error")
|
||||
|
||||
|
||||
@router.get("/v3/network/stats")
|
||||
async def v3_network_stats():
|
||||
"""
|
||||
V3 API: Статистика сети для совместимости со скриптами
|
||||
"""
|
||||
try:
|
||||
# Заглушка для сетевой статистики
|
||||
return {
|
||||
"network_stats": {
|
||||
"total_nodes": 1,
|
||||
"active_nodes": 1,
|
||||
"total_content": 0,
|
||||
"network_health": "good"
|
||||
},
|
||||
"node_stats": {
|
||||
"uptime": "online",
|
||||
"connections": 0,
|
||||
"content_shared": 0
|
||||
},
|
||||
"timestamp": datetime.utcnow().isoformat()
|
||||
}
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"V3 network stats error: {e}")
|
||||
raise HTTPException(status_code=500, detail="Internal server error")
|
||||
Loading…
Reference in New Issue