mirror of
https://github.com/hanzoai/bootnode.git
synced 2026-09-30 20:46:32 +00:00
Bootnode could only see nodes it launched as Docker containers; real Lux/Zoo
validators run as K8s workloads behind operator CRDs and were invisible to
GET /v1/nodes. Add a detector that scans a cluster's kubeconfig and adopts
its running validators into the DB.
- core/k8s_nodes.py: K8sNodeDetector scans LuxNetwork (lux.network/v1alpha1
luxnetworks) + ZooChain (zoo.network/v1alpha1 zoochains) CRs across all
namespaces via CustomObjectsApi, enriches each with its luxd/zood pods for
live status, and upserts Cluster + Node rows. Adoption, not recreation:
existing rows (keyed on (cluster_id, pod_name)) are updated in place, so
re-scans are idempotent. New operator chains are one descriptor row.
- db/models.py: add Cluster + Node models (portable JSON/Uuid types, matching
the existing db_nodes.py / seed_nodes.py consumers that imported them).
- api/nodes: merge DB-adopted k8s nodes into list_nodes() alongside Docker
discovery; add POST /v1/nodes/detect and POST /v1/nodes/clusters/{id}/scan
(kubeconfig resolved via the shared fleets path). Reuses existing get_db.
- pyproject: add aiosqlite (config.database_url now defaults to
sqlite+aiosqlite; the driver was missing).
Detector adopt/idempotency + model mapping verified against in-memory SQLite
with faked LuxNetwork/ZooChain CRs and pods; full app OpenAPI builds with the
new routes; 112 existing tests pass (pre-existing test_lux_fleet /
test_chain_config failures unchanged).
127 lines
3.3 KiB
TOML
127 lines
3.3 KiB
TOML
[project]
|
|
name = "bootnode"
|
|
version = "2.0.0"
|
|
description = "Blockchain Development Platform - Multi-chain RPC, Token API, NFT API, Smart Wallets, and more"
|
|
readme = "README.md"
|
|
license = { text = "BSD-3-Clause" }
|
|
requires-python = ">=3.12"
|
|
authors = [{ name = "Hanzo AI", email = "[email protected]" }]
|
|
keywords = ["blockchain", "ethereum", "web3", "rpc", "nft", "erc4337"]
|
|
classifiers = [
|
|
"Development Status :: 4 - Beta",
|
|
"Framework :: FastAPI",
|
|
"Intended Audience :: Developers",
|
|
"License :: OSI Approved :: BSD License",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13",
|
|
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
|
|
]
|
|
|
|
dependencies = [
|
|
"fastapi>=0.115.0",
|
|
"uvicorn[standard]>=0.32.0",
|
|
"pydantic[email]>=2.10.0",
|
|
"pydantic-settings>=2.6.0",
|
|
"sqlalchemy[asyncio]>=2.0.36",
|
|
"asyncpg>=0.30.0",
|
|
"aiosqlite>=0.20.0",
|
|
"alembic>=1.14.0",
|
|
"redis>=5.2.0",
|
|
"httpx>=0.28.0",
|
|
"websockets>=14.0",
|
|
"web3>=7.6.0",
|
|
"eth-abi>=5.0.0",
|
|
"eth-account>=0.13.0",
|
|
"python-jose[cryptography]>=3.3.0",
|
|
"bcrypt>=4.0.0",
|
|
"pyjwt>=2.8.0",
|
|
"python-multipart>=0.0.18",
|
|
"orjson>=3.10.0",
|
|
"structlog>=24.4.0",
|
|
"tenacity>=9.0.0",
|
|
"cachetools>=5.5.0",
|
|
# DataStore
|
|
"aiochclient>=2.6.0",
|
|
# Message Queue (Redis-based, @hanzo/mq compatible)
|
|
"arq>=0.26.0",
|
|
# Infrastructure Management
|
|
"kubernetes>=31.0.0",
|
|
"pydo>=0.8.0",
|
|
"docker>=7.0.0",
|
|
# ZAP Protocol (native Cap'n Proto RPC)
|
|
"pycapnp>=2.0.0",
|
|
# Hanzo O11y — full OTEL stack (traces + metrics + logs → Datastore)
|
|
"opentelemetry-api>=1.27.0",
|
|
"opentelemetry-sdk>=1.27.0",
|
|
"opentelemetry-exporter-otlp-proto-grpc>=1.27.0",
|
|
"opentelemetry-instrumentation-fastapi>=0.48b0",
|
|
"opentelemetry-instrumentation-httpx>=0.48b0",
|
|
"opentelemetry-instrumentation-sqlalchemy>=0.48b0",
|
|
"opentelemetry-instrumentation-redis>=0.48b0",
|
|
]
|
|
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=8.3.0",
|
|
"pytest-asyncio>=0.24.0",
|
|
"pytest-cov>=6.0.0",
|
|
"httpx>=0.28.0",
|
|
"ruff>=0.8.0",
|
|
"mypy>=1.13.0",
|
|
"pre-commit>=4.0.0",
|
|
]
|
|
# Hanzo SDKs - optional, for direct KMS access outside K8s
|
|
# In K8s, External Secrets Operator syncs secrets from KMS automatically
|
|
# Install with: pip install bootnode[hanzo]
|
|
hanzo = [
|
|
"hanzo-kms>=1.0.0",
|
|
"hanzo-iam>=1.0.0",
|
|
]
|
|
|
|
[project.scripts]
|
|
bootnode = "bootnode.cli:main"
|
|
|
|
[project.urls]
|
|
Homepage = "https://bootno.de"
|
|
Documentation = "https://docs.bootno.de"
|
|
Repository = "https://github.com/hanzoai/bootnode"
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["bootnode"]
|
|
|
|
[tool.ruff]
|
|
target-version = "py312"
|
|
line-length = 100
|
|
|
|
[tool.ruff.lint]
|
|
select = [
|
|
"E", # pycodestyle errors
|
|
"W", # pycodestyle warnings
|
|
"F", # pyflakes
|
|
"I", # isort
|
|
"B", # flake8-bugbear
|
|
"C4", # flake8-comprehensions
|
|
"UP", # pyupgrade
|
|
"ARG", # flake8-unused-arguments
|
|
"SIM", # flake8-simplify
|
|
]
|
|
ignore = ["E501", "B008", "B904"]
|
|
|
|
[tool.ruff.lint.isort]
|
|
known-first-party = ["bootnode"]
|
|
|
|
[tool.mypy]
|
|
python_version = "3.12"
|
|
strict = true
|
|
plugins = ["pydantic.mypy"]
|
|
|
|
[tool.pytest.ini_options]
|
|
asyncio_mode = "auto"
|
|
testpaths = ["tests"]
|
|
addopts = "-v --tb=short"
|