Files
aitbc/website/docs/pool-hub.html
oib 15427c96c0 chore: update file permissions to executable across repository
- Change file mode from 644 to 755 for all project files
- Add chain_id parameter to get_balance RPC endpoint with default "ait-devnet"
- Rename Miner.extra_meta_data to extra_metadata for consistency
2026-03-06 22:17:54 +01:00

265 lines
8.4 KiB
HTML
Executable File
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" data-theme="dark">
<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="css/docs.css">
<link rel="stylesheet" href="/assets/css/site-header.css">
<link rel="preload" href="/assets/css/font-awesome.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="/assets/css/font-awesome.min.css"></noscript>
<!-- Font Awesome CDN fallback -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" crossorigin="anonymous" media="print" onload="this.media='all'; this.onload=null;">
</head>
<body>
<div data-global-header></div>
<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>
<script src="/assets/js/global-header.js"></script>
</body>
</html>