Files
aitbc/website/docs/pool-hub.html
oib 07f3a87328 docs: restructure website, optimize HTML, gitignore private files
Website docs (website/docs/):
- Delete 6 stale -md.html duplicates
- Rename docs-clients/miners/developers → clients/miners/developers.html
- Unify header/nav across all 15 pages (new .site-header pattern)
- Fix 34 dead href=# links with real targets
- Upgrade Font Awesome v4→v6 in index.html
- Replace search stub with live client-side search (15-page index)
- Extract all inline CSS into shared docs.css (+630 lines)
- Extract inline theme JS into shared theme.js
- Strip inline style= attributes from 10+ pages
- Add .announce-banner, .source-links, .search-results CSS classes
- Add Markdown Source links to clients/miners/developers pages
- Update components.html title to Architecture & Components
- Move browser-wallet.html to website/wallet/, leave redirect
- Update all dates to February 2026

Website root:
- Delete 6 root-level duplicate HTML files (160KB saved)
- Rewire index.html and 404.html links

Root README.md:
- Fix 8 broken doc links to new numbered folder structure
- Update copyright to 2026

.gitignore + .example files:
- Gitignore private files: .aitbc.yaml, .env, deploy scripts,
  GPU scripts, service scripts, infra configs, .windsurf/, website README
- Create 7 .example files for GitHub users with sanitized templates
- Untrack 47 previously committed private files

Live server:
- Push all website files to aitbc-cascade:/var/www/html/
- Clean stale admin.html and index.nginx-debian.html
2026-02-13 23:18:52 +01:00

276 lines
8.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pool Hub - AITBC Documentation</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link rel="stylesheet" href="css/docs.css">
</head>
<body>
<!-- Header -->
<header class="site-header">
<div class="container">
<div class="header-inner">
<a href="/" class="brand">
<i class="fas fa-cube"></i>
<span>AITBC</span>
</a>
<nav class="header-nav">
<a href="/">Home</a>
<a href="/explorer/">Explorer</a>
<a href="/Exchange/">Exchange</a>
<a href="/docs/index.html" class="active">Docs</a>
<button id="theme-toggle" class="theme-toggle" title="Toggle theme"><i class="fas fa-sun"></i></button>
</nav>
</div>
</div>
</header>
<main>
<div class="container">
<!-- Breadcrumb -->
<div class="breadcrumb">
<a href="index.html">Documentation</a>
<span></span>
<a href="components.html">Components</a>
<span></span>
<span>Pool Hub</span>
</div>
<!-- Back Button -->
<a href="components.html" class="back-button">
<i class="fas fa-arrow-left"></i>
Back to Components
</a>
<!-- Header -->
<div class="doc-header">
<h1><i class="fas fa-swimming-pool"></i> Pool Hub</h1>
<p>Miner registry with scoring engine, Redis/PostgreSQL backing, and comprehensive metrics. Live matching API deployed.</p>
<span class="status-badge">● Live</span>
</div>
<!-- Overview -->
<section class="content-section">
<h2>Overview</h2>
<p>The AITBC Pool Hub serves as the central coordination service for miners, providing efficient job matching, reputation scoring, and performance tracking.</p>
<h3>Key Features</h3>
<ul>
<li>Miner registry with comprehensive metadata</li>
<li>Dynamic scoring engine based on performance</li>
<li>Redis for fast caching and PostgreSQL for persistence</li>
<li>Real-time job matching API</li>
<li>Comprehensive metrics and monitoring</li>
<li>Load balancing and failover support</li>
</ul>
</section>
<!-- Architecture -->
<section class="content-section">
<h2>Architecture</h2>
<p>The Pool Hub is designed for high availability and performance:</p>
<div class="feature-grid">
<div class="feature-card">
<h4><i class="fas fa-database"></i> Data Layer</h4>
<p>Redis for hot data, PostgreSQL for historical records</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-chart-line"></i> Scoring Engine</h4>
<p>Dynamic scoring based on success rate, latency, and availability</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-exchange-alt"></i> Matching API</h4>
<p>RESTful API for real-time job-to-miner matching</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-tachometer-alt"></i> Monitoring</h4>
<p>Prometheus metrics and Grafana dashboards</p>
</div>
</div>
</section>
<!-- API Reference -->
<section class="content-section">
<h2>API Reference</h2>
<h3>Miner Registration</h3>
<pre><code># Register miner
POST /api/v1/miners/register
{
"address": "0x...",
"endpoint": "http://miner.example.com:8080",
"capabilities": {
"models": ["llama3.2", "mistral"],
"gpu_memory": 16384,
"max_concurrent_jobs": 4
},
"stake": 10000
}</code></pre>
<h3>Job Matching</h3>
<pre><code># Find suitable miners
POST /api/v1/match
{
"job_type": "inference",
"model": "llama3.2",
"requirements": {
"min_gpu_memory": 8192,
"max_latency": 5000
}
}
# Response
{
"miners": [
{
"address": "0x...",
"endpoint": "http://miner1.example.com",
"score": 0.95,
"estimated_time": 2000
}
]
}</code></pre>
<h3>Miner Status</h3>
<pre><code># Update miner status
POST /api/v1/miners/{address}/status
{
"available": true,
"current_load": 2,
"gpu_utilization": 0.75,
"temperature": 65
}</code></pre>
</section>
<!-- Scoring System -->
<section class="content-section">
<h2>Scoring System</h2>
<p>The scoring engine evaluates miners based on multiple factors:</p>
<h3>Scoring Factors</h3>
<ul>
<li><strong>Success Rate (40%)</strong>: Job completion success percentage</li>
<li><strong>Latency (25%)</strong>: Average response time</li>
<li><strong>Availability (20%)</strong>: Uptime percentage</li>
<li><strong>Reputation (15%)</strong>: Historical performance and stake amount</li>
</ul>
<h3>Score Calculation</h3>
<pre><code>score = (success_rate * 0.4) +
(latency_score * 0.25) +
(availability * 0.2) +
(reputation_score * 0.15)</code></pre>
</section>
<!-- Configuration -->
<section class="content-section">
<h2>Configuration</h2>
<h3>Environment Variables</h3>
<pre><code># Database
REDIS_URL=redis://localhost:6379
DATABASE_URL=postgresql://user:pass@localhost/poolhub
# API
API_HOST=0.0.0.0
API_PORT=8000
# Scoring
SCORE_UPDATE_INTERVAL=60
MAX_MINER_SCORE=1.0
MIN_SUCCESS_RATE=0.8
# Monitoring
METRICS_PORT=9090
LOG_LEVEL=info</code></pre>
<h3>Scoring Configuration</h3>
<pre><code># config/scoring.toml
[scoring]
update_interval = 60 # seconds
decay_factor = 0.95 # daily decay
[weights]
success_rate = 0.4
latency = 0.25
availability = 0.2
reputation = 0.15
[thresholds]
min_success_rate = 0.8
max_latency = 5000
min_availability = 0.95</code></pre>
</section>
<!-- Deployment -->
<section class="content-section">
<h2>Deployment</h2>
<h3>Docker Compose</h3>
<pre><code>version: '3.8'
services:
pool-hub:
image: aitbc/pool-hub:latest
ports:
- "8000:8000"
- "9090:9090"
environment:
- REDIS_URL=redis://redis:6379
- DATABASE_URL=postgresql://postgres:pass@db:5432/poolhub
depends_on:
- redis
- db
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
db:
image: postgres:15
environment:
- POSTGRES_DB=poolhub
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=pass
volumes:
- db_data:/var/lib/postgresql/data</code></pre>
</section>
<!-- Monitoring -->
<section class="content-section">
<h2>Monitoring</h2>
<h3>Key Metrics</h3>
<ul>
<li><code>poolhub_miners_total</code> - Total registered miners</li>
<li><code>poolhub_jobs_matched_total</code> - Total jobs matched</li>
<li><code>poolhub_match_duration</code> - Match operation duration</li>
<li><code>poolhub_miner_score</code> - Individual miner scores</li>
<li><code>poolhub_api_requests_total</code> - API request count</li>
</ul>
<h3>Health Checks</h3>
<pre><code># Health endpoint
GET /health
# Detailed status
GET /api/v1/status
# Metrics endpoint
GET /metrics</code></pre>
</section>
</div>
</main>
<footer>
<div class="container">
<p>&copy; 2026 AITBC. All rights reserved.</p>
</div>
</footer>
<script src="js/theme.js"></script>
</body>
</html>