mirror of
https://github.com/hanzoai/bootnode.git
synced 2026-10-25 02:31:30 +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).
Hanzo Nodes API
Multi-chain blockchain infrastructure platform providing RPC, APIs, WebSockets, Webhooks, and ERC-4337 bundling.
Features
- Multi-Chain RPC: 100+ EVM chains with load balancing
- Token API: ERC-20 balances, transfers, prices
- NFT API: ERC-721/1155 ownership, metadata, transfers
- Wallet API: Portfolio tracking, activity history
- WebSocket Subscriptions: Real-time blockchain events
- Webhooks: Event notifications with delivery tracking
- ERC-4337 Bundler: Account abstraction with gasless transactions
- Gas API: Real-time gas estimates and EIP-1559 data
Quick Start
# Start dependencies
docker compose up -d postgres redis clickhouse
# Run API locally
uv run uvicorn bootnode.main:app --reload
# Or with Docker
docker compose up -d
API Endpoints
GET /health- Health checkPOST /v1/rpc/{chain}/{network}- JSON-RPC proxyGET /v1/tokens/{chain}/balance/{address}- Token balancesGET /v1/nfts/{chain}/owner/{address}- NFT ownershipPOST /v1/webhooks- Create webhookWS /v1/ws/{chain}/{network}- WebSocket subscriptions
Environment Variables
DATABASE_URL=postgresql+asyncpg://...
REDIS_URL=redis://...
DATASTORE_URL=clickhouse://...
JWT_SECRET=...
Documentation
- API Docs: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
License
BSD-3-Clause