7 Commits
Author SHA1 Message Date
zeekay 1ce1924c41 fix: convert DATABASE_URL to asyncpg scheme for async SQLAlchemy engine
The K8s DATABASE_URL env var uses postgresql:// which makes
create_async_engine try to load psycopg2 (sync driver). Add
_ensure_async_dsn() to convert postgresql:// and postgres:// to
postgresql+asyncpg:// at engine creation time. asyncpg is already
in dependencies.
2026-03-03 08:13:33 -08:00
zeekay 8edcaa614f fix: production billing hardening + Stripe→Commerce migration
- Replace eval() with json.loads() in usage tracker (security fix)
- Webhook verification fails-closed in production when secret missing
- Add Commerce env vars to K8s deployment (URL, API key, webhook secret)
- Expose ZAP port 9999 in Dockerfile and K8s service
- Replace Stripe env vars with Square in compose.yml
- Update privacy/terms pages: Stripe→Square via Hanzo Commerce
- Add full billing API client module to web/lib/api.ts (17 endpoints)
- Fix hardcoded localhost URLs in dashboard/analytics/organization pages
- Add production webhook rejection test (57 tests passing)
2026-02-12 11:22:03 -08:00
zeekay fa2bcb0455 fix: unified billing error handling + add billing tests
unified.py: _create_customer now raises CommerceError instead of
returning fake local_ customer IDs that mask failures.
create_subscription raises CommerceError instead of bare Exception.
report_usage raises CommerceError so callers know when usage wasn't
reported.

Added 12 new tests: config AliasChoices regression (P0), commerce
client error paths, unified client error propagation, and webhook
handler edge cases. All 56 billing tests pass.
2026-02-12 10:47:45 -08:00
zeekay fb1e5d96c5 feat: add Lux validator fleet management system
Full-stack fleet lifecycle management for Lux blockchain validators
deployed via Helm to DOKS clusters.

Backend (Python/FastAPI):
- HelmDeployer: async helm/kubectl CLI wrapper with temp file cleanup,
  per-release locking, and command injection protection
- LuxFleetManager: fleet CRUD, scale, rolling restart, node health
  probes via luxd RPC (health + C-chain block height)
- Fleet API: authenticated REST endpoints (ApiKeyDep) with RFC 1123
  input validation, kubeconfig error sanitization
- Pydantic models: 3 networks (mainnet/testnet/devnet), fleet status
  enums, helm values translation
- 110 unit tests (0.30s, all passing)

Frontend (TypeScript/Next.js):
- Fleet dashboard: cluster selector, stats banner, fleet cards with
  scale/restart/destroy operations, node status table, create dialog
- Interactive SVG world map: zero-dep Mercator projection with DOKS
  region markers, pulsing animations, P2P mesh lines, click-to-zoom
- DOKS region data: 11 regions with coordinates and API client
- Dark theme throughout
2026-02-10 13:40:28 -08:00
zeekay 51668b6dd3 fix: update image references from bootnode/ to ghcr.io/hanzoai/bootnode
Updated all container image references across compose, K8s manifests,
cloud deploy scripts, and tests to use the ghcr.io/hanzoai/bootnode
registry format.
2026-02-06 07:55:58 -08:00
zeekay e12b842f7d feat: implement Alchemy-style billing and pluggable deployments
Billing System:
- Add compute unit costs for 100+ RPC methods (1-100 CU)
- Implement pricing tiers: Free (30M CU), PAYG ($0.40/M), Enterprise
- Real-time usage tracking with Redis + ClickHouse analytics
- Subscription model with billing cycles
- Billing API endpoints: /usage, /subscription, /invoices, /tiers

Hanzo Commerce Integration:
- HanzoCommerceClient for subscriptions and invoices
- Usage sync worker for PAYG metered billing
- Webhook handler for subscription lifecycle events
- HMAC signature verification for webhooks

Pluggable Deployment Targets:
- Abstract DeployTarget interface
- DockerDeployer - Docker Compose management
- ProcessDeployer - Local dev with subprocesses
- KubernetesDeployer - K8s deployments via python client
- Factory pattern with caching
- Infrastructure API: /services, /scale, /logs

Pricing Page:
- Updated to match Alchemy pricing structure
- Three tiers with feature comparison table
- FAQ section with compute unit explanation

ClickHouse Schema:
- billing_usage_daily with SummingMergeTree
- billing_usage_monthly materialized view
- cu_by_method for analytics dashboard
- rate_limit_events tracking
2026-02-04 09:44:50 -08:00
zeekay 1dfd7a2e26 feat: initial Hanzo Nodes API
Modern blockchain infrastructure platform with:
- Multi-chain RPC endpoints (100+ chains)
- Token & NFT APIs (ERC-20, ERC-721, ERC-1155)
- Wallet API with portfolio tracking
- ERC-4337 Bundler for account abstraction
- WebSocket subscriptions
- Webhooks for chain events
- Hanzo IAM integration for multi-tenant auth (hanzo.id, zoo.id, lux.id, pars.id)
- ClickHouse datastore for analytics
- Redis MQ for background jobs

Pricing: $0.45/M CUs (Alchemy-competitive)
- Free: 300M CUs/month
- Growth: 400M CUs/month ($49/mo)
- Scale: 1.5B CUs/month ($199/mo)
2026-01-26 10:20:42 -08:00