11 Commits
Author SHA1 Message Date
zeekay 1a534203ca chore(repo): merge bootnode-org/main back into the Hanzo-side work
These two repos share root commit 8999f3c3 ("Initial commit") but
diverged long ago — hanzoai/bootnode evolved the recent stack
(api-go, brand package, etc.) while bootnode-org/main retained the
mainline 2026 history (175 commits we don't have).

Brand-leak fix: this work belongs in github.com/bootnode/bootnode,
not github.com/hanzoai/bootnode. Per the no-cross-brand-leak policy,
merge both histories together and push the result back to
bootnode/bootnode as the canonical home.

After this lands:
- bootnode/bootnode is the canonical repo
- hanzoai/bootnode gets archived with a redirect notice
- @bootnode-io/brand npm package's `repository.url` already points at
  bootnode/bootnode (set in the earlier package.json scaffold)

# Conflicts:
#	.github/workflows/ci.yml
#	api/bootnode/api/__init__.py
#	api/bootnode/api/billing/__init__.py
#	api/bootnode/config.py
#	api/bootnode/core/billing/__init__.py
#	api/bootnode/db/models.py
#	api/bootnode/main.py
#	api/tests/test_billing.py
#	web/app/dashboard/infrastructure/page.tsx
#	web/app/dashboard/organization/billing/page.tsx
#	web/app/dashboard/organization/page.tsx
#	web/app/dashboard/page.tsx
#	web/app/layout.tsx
#	web/components/navbar.tsx
#	web/components/unified-navigation.tsx
#	web/lib/brand.ts
#	web/public/logo/zoo-icon.svg
#	web/public/logo/zoo-logo-white.svg
#	web/public/logo/zoo-logo.svg
#	web/tsconfig.tsbuildinfo
2026-05-19 10:23:43 -07:00
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 05a14c1f6b Merge remote-tracking branch 'hanzo/main'
# Conflicts:
#	api/bootnode/api/__init__.py
#	api/bootnode/api/billing/__init__.py
#	api/bootnode/core/billing/unified.py
#	infra/cloud/deploy.sh
#	infra/compose.yml
#	infra/k8s/api-deployment.yaml
#	infra/k8s/bootnode-deployment.yaml
#	infra/k8s/bootnode-operator.yaml
#	infra/k8s/hanzo-web3-deployment.yaml
#	infra/k8s/indexer-deployment.yaml
#	web/app/auth/callback/page.tsx
#	web/app/dashboard/infrastructure/nodes/page.tsx
#	web/app/dashboard/layout.tsx
#	web/app/login/page.tsx
#	web/components/unified-navigation.tsx
#	web/lib/auth.tsx
#	web/lib/brand.ts
#	web/public/logo/lux-icon.svg
#	web/tsconfig.tsbuildinfo
2026-02-10 20:51:48 -08:00
zeekay ad6dc4e6eb feat: migrate billing from Stripe to Hanzo Commerce + Square
Remove all direct Stripe integration. Bootnode now uses Hanzo Commerce
API as its payment gateway (Commerce handles Square internally).

- Remove stripe dependency from pyproject.toml
- Rewrite commerce.py client with correct Commerce API paths:
  /api/v1/user (customers), /api/v1/subscribe (subscriptions),
  /api/v1/checkout/* (payments), /api/v1/order (orders/invoices)
- Add unified.py: IAM + Commerce customer linking (hanzo.id SSO)
- Rewrite webhooks.py: Commerce event handler with HMAC verification
- Update sync.py: usage metering via Commerce (not Stripe)
- Update billing API endpoints: checkout, account, webhooks
- Config uses COMMERCE_* prefix (not HANZO_COMMERCE_*)
- Add test_billing.py: 46 tests covering CU, tiers, Commerce client,
  webhooks, and unified billing
2026-02-10 20:50:18 -08:00
zeekay 67797d69b4 Update to latest K8S Operator 2026-02-10 14:57:33 -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