Move blockchain app READMEs to centralized documentation
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Successful in 10s
Blockchain Synchronization Verification / sync-verification (push) Failing after 3s
CLI Tests / test-cli (push) Failing after 4s
Documentation Validation / validate-docs (push) Successful in 8s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Integration Tests / test-service-integration (push) Successful in 38s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 2s
P2P Network Verification / p2p-verification (push) Successful in 3s
Security Scanning / security-scan (push) Successful in 40s
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Successful in 15s
Smart Contract Tests / lint-solidity (push) Successful in 8s

- Relocate blockchain-event-bridge README content to docs/apps/blockchain/blockchain-event-bridge.md
- Relocate blockchain-explorer README content to docs/apps/blockchain/blockchain-explorer.md
- Replace app READMEs with redirect notices pointing to new documentation location
- Consolidate documentation in central docs/ directory for better organization
This commit is contained in:
aitbc
2026-04-23 12:24:48 +02:00
parent cd240485c6
commit 522655ef92
55 changed files with 7033 additions and 1536 deletions

View File

@@ -0,0 +1,15 @@
# Marketplace Applications
GPU marketplace and pool hub services.
## Applications
- [Marketplace](marketplace.md) - GPU marketplace for compute resources
- [Pool Hub](pool-hub.md) - Pool hub for resource pooling
## Features
- GPU resource marketplace
- Provider offers and bids
- Pool management
- Multi-chain support

View File

@@ -0,0 +1,41 @@
# Marketplace Web
Mock UI for exploring marketplace offers and submitting bids.
## Development
```bash
npm install
npm run dev
```
The dev server listens on `http://localhost:5173/` by default. Adjust via `--host`/`--port` flags in the `systemd` unit or `package.json` script.
## Data Modes
Marketplace web reuses the explorer pattern of mock vs. live data:
- Set `VITE_MARKETPLACE_DATA_MODE=mock` (default) to consume JSON fixtures under `public/mock/`.
- Set `VITE_MARKETPLACE_DATA_MODE=live` and point `VITE_MARKETPLACE_API` to the coordinator backend when integration-ready.
### Feature Flags & Auth
- `VITE_MARKETPLACE_ENABLE_BIDS` (default `true`) gates whether the bid form submits to the backend. Set to `false` to keep the UI read-only during phased rollouts.
- `VITE_MARKETPLACE_REQUIRE_AUTH` (default `false`) enforces a bearer token session before live bid submissions. Tokens are stored in `localStorage` by `src/lib/auth.ts`; the API helpers automatically attach the `Authorization` header when a session is present.
- Session JSON is expected to include `token` (string) and `expiresAt` (epoch ms). Expired or malformed entries are cleared automatically.
Document any backend expectations (e.g., coordinator accepting bearer tokens) alongside the environment variables in deployment manifests.
## Structure
- `public/mock/offers.json` sample marketplace offers.
- `public/mock/stats.json` summary dashboard statistics.
- `src/lib/api.ts` data-mode-aware fetch helpers.
- `src/main.ts` renders dashboard, offers table, and bid form.
- `src/style.css` layout and visual styling.
## Submitting Bids
When in mock mode, bid submissions simulate latency and always succeed.
When in live mode, ensure the coordinator exposes `/v1/marketplace/offers`, `/v1/marketplace/stats`, and `/v1/marketplace/bids` endpoints compatible with the JSON shapes defined in `src/lib/api.ts`.

View File

@@ -0,0 +1,95 @@
# Pool Hub
## Purpose & Scope
Matchmaking gateway between coordinator job requests and available miners. See `docs/bootstrap/pool_hub.md` for architectural guidance.
## Development Setup
- Create a Python virtual environment under `apps/pool-hub/.venv`.
- Install FastAPI, Redis (optional), and PostgreSQL client dependencies once requirements are defined.
- Implement routers and registry as described in the bootstrap document.
## SLA Monitoring and Billing Integration
Pool-Hub now includes comprehensive SLA monitoring and billing integration with coordinator-api:
### SLA Metrics
- **Miner Uptime**: Tracks miner availability based on heartbeat intervals
- **Response Time**: Monitors average response time from match results
- **Job Completion Rate**: Tracks successful vs failed job outcomes
- **Capacity Availability**: Monitors overall pool capacity utilization
### SLA Thresholds
Default thresholds (configurable in settings):
- Uptime: 95%
- Response Time: 1000ms
- Completion Rate: 90%
- Capacity Availability: 80%
### Billing Integration
Pool-Hub integrates with coordinator-api's billing system to:
- Record usage data (gpu_hours, api_calls, compute_hours)
- Sync miner usage to tenant billing
- Generate invoices via coordinator-api
- Track billing metrics and costs
### API Endpoints
SLA and billing endpoints are available under `/sla/`:
- `GET /sla/metrics/{miner_id}` - Get SLA metrics for a miner
- `GET /sla/metrics` - Get SLA metrics across all miners
- `GET /sla/violations` - Get SLA violations
- `POST /sla/metrics/collect` - Trigger SLA metrics collection
- `GET /sla/capacity/snapshots` - Get capacity planning snapshots
- `GET /sla/capacity/forecast` - Get capacity forecast
- `GET /sla/capacity/recommendations` - Get scaling recommendations
- `GET /sla/billing/usage` - Get billing usage data
- `POST /sla/billing/sync` - Trigger billing sync with coordinator-api
### Configuration
Add to `.env`:
```bash
# Coordinator-API Billing Integration
COORDINATOR_BILLING_URL=http://localhost:8011
COORDINATOR_API_KEY=your_api_key_here
# SLA Configuration
SLA_UPTIME_THRESHOLD=95.0
SLA_RESPONSE_TIME_THRESHOLD=1000.0
SLA_COMPLETION_RATE_THRESHOLD=90.0
SLA_CAPACITY_THRESHOLD=80.0
# Capacity Planning
CAPACITY_FORECAST_HOURS=168
CAPACITY_ALERT_THRESHOLD_PCT=80.0
# Billing Sync
BILLING_SYNC_INTERVAL_HOURS=1
# SLA Collection
SLA_COLLECTION_INTERVAL_SECONDS=300
```
### Database Migration
Run the database migration to add SLA and capacity tables:
```bash
cd apps/pool-hub
alembic upgrade head
```
### Testing
Run tests for SLA and billing integration:
```bash
cd apps/pool-hub
pytest tests/test_sla_collector.py
pytest tests/test_billing_integration.py
pytest tests/test_sla_endpoints.py
pytest tests/test_integration_coordinator.py
```