mirror of
https://github.com/hanzoai/bootnode.git
synced 2026-09-30 20:46:32 +00:00
feat(api): pin to v1.0.0, sourced DRY from __version__
Never launched, so start at 1.0.0. All app/ZAP-server/OTEL version strings now read bootnode.__version__ (ZAP protocol version stays its own axis).
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
"""Bootnode - Blockchain Development Platform."""
|
||||
|
||||
__version__ = "2.0.0"
|
||||
__version__ = "1.0.0"
|
||||
|
||||
@@ -17,6 +17,7 @@ import structlog
|
||||
from fastapi import APIRouter
|
||||
from pydantic import BaseModel
|
||||
|
||||
from bootnode import __version__
|
||||
from bootnode.api.deps import ApiKeyDep
|
||||
from bootnode.config import get_settings
|
||||
|
||||
@@ -44,7 +45,7 @@ class ZapServerInfo(BaseModel):
|
||||
"""ZAP server capabilities."""
|
||||
|
||||
name: str = "bootnode"
|
||||
version: str = "2.0.0"
|
||||
version: str = __version__
|
||||
capabilities: dict[str, bool]
|
||||
tools_count: int
|
||||
resources_count: int
|
||||
@@ -388,7 +389,7 @@ async def get_zap_schema(_api_key: ApiKeyDep) -> dict[str, Any]:
|
||||
return {
|
||||
"schema": schema_content,
|
||||
"format": "zap",
|
||||
"version": "2.0.0",
|
||||
"version": __version__,
|
||||
"interfaces": ["Bootnode"],
|
||||
"compile": "zapc compile bootnode.zap --out=bootnode.capnp",
|
||||
}
|
||||
@@ -410,5 +411,5 @@ async def get_capnp_schema(_api_key: ApiKeyDep) -> dict[str, Any]:
|
||||
return {
|
||||
"schema": schema_content,
|
||||
"format": "capnp",
|
||||
"version": "2.0.0",
|
||||
"version": __version__,
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ from typing import Any
|
||||
|
||||
import structlog
|
||||
from fastapi import FastAPI, Request, Response
|
||||
|
||||
from bootnode import __version__
|
||||
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
|
||||
|
||||
logger = structlog.get_logger()
|
||||
@@ -166,7 +168,7 @@ def setup_otel(app: FastAPI) -> None:
|
||||
"http://otel-collector.hanzo.svc:4317",
|
||||
)
|
||||
service_name = os.getenv("OTEL_SERVICE_NAME", "bootnode-api")
|
||||
service_version = os.getenv("OTEL_SERVICE_VERSION", "2.0.0")
|
||||
service_version = os.getenv("OTEL_SERVICE_VERSION", __version__)
|
||||
|
||||
# Always add metrics middleware (no external deps)
|
||||
app.add_middleware(MetricsMiddleware)
|
||||
|
||||
@@ -8,6 +8,7 @@ from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import ORJSONResponse
|
||||
|
||||
from bootnode import __version__
|
||||
from bootnode.api import router as api_router
|
||||
from bootnode.config import get_settings
|
||||
from bootnode.core.cache import redis_client
|
||||
@@ -86,7 +87,7 @@ async def lifespan(_app: FastAPI) -> AsyncGenerator[None, None]:
|
||||
app = FastAPI(
|
||||
title="Bootnode API",
|
||||
description="Blockchain Development Platform - Multi-chain RPC, Token API, NFT API, Smart Wallets, and more",
|
||||
version="2.0.0",
|
||||
version=__version__,
|
||||
docs_url="/docs" if not settings.is_production else None,
|
||||
redoc_url="/redoc" if not settings.is_production else None,
|
||||
openapi_url="/openapi.json" if not settings.is_production else None,
|
||||
@@ -139,7 +140,7 @@ app.include_router(ws_router, prefix=f"{settings.api_prefix}/ws", tags=["WebSock
|
||||
@app.get("/health")
|
||||
async def health_check() -> dict:
|
||||
"""Health check endpoint."""
|
||||
return {"status": "healthy", "version": "2.0.0"}
|
||||
return {"status": "healthy", "version": __version__}
|
||||
|
||||
|
||||
@app.get("/")
|
||||
@@ -147,7 +148,7 @@ async def root() -> dict:
|
||||
"""Root endpoint."""
|
||||
return {
|
||||
"name": "Bootnode API",
|
||||
"version": "2.0.0",
|
||||
"version": __version__,
|
||||
"docs": "/docs",
|
||||
"status": "operational",
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ from typing import Any
|
||||
import capnp
|
||||
import structlog
|
||||
|
||||
from bootnode import __version__
|
||||
from bootnode.config import get_settings
|
||||
|
||||
logger = structlog.get_logger()
|
||||
@@ -219,7 +220,7 @@ class BootnodeZapImpl(bootnode_capnp.Bootnode.Server):
|
||||
|
||||
return bootnode_capnp.ServerInfo.new_message(
|
||||
name="bootnode",
|
||||
version="2.0.0",
|
||||
version=__version__,
|
||||
capabilities=bootnode_capnp.ServerInfo.Capabilities.new_message(
|
||||
tools=True,
|
||||
resources=True,
|
||||
@@ -385,7 +386,7 @@ class BootnodeZapImpl(bootnode_capnp.Bootnode.Server):
|
||||
mimeType="application/json",
|
||||
)
|
||||
content_msg.content.text = json.dumps({
|
||||
"version": "2.0.0",
|
||||
"version": __version__,
|
||||
"rate_limit": 1000,
|
||||
})
|
||||
return content_msg
|
||||
|
||||
Reference in New Issue
Block a user