docs: update documentation links to use relative paths and add system flow references

- Replace absolute aitbc.bubuit.net URLs with relative paths in documentation pages
- Update markdown documentation links from /main/ to /master/ branch
- Add system flow diagram references to component documentation pages
- Remove redundant "Also available in Markdown" notices from HTML docs
- Update Font Awesome CDN link in index.html
- Simplify quick links section and remove unused tutorial/video guide plac
This commit is contained in:
oib
2026-02-11 20:59:05 +01:00
parent 86e5c6f1a3
commit a9f9003ad1
25 changed files with 5146 additions and 655 deletions

158
SECURITY_CLEANUP_GUIDE.md Normal file
View File

@@ -0,0 +1,158 @@
# AITBC Security Cleanup & GitHub Setup Guide
## 🔐 SECURITY FINDINGS
### Files Currently Tracked That Should Be Removed
**High Priority - Remove Immediately:**
1. `.windsurf/` - Entire IDE configuration directory
- Contains local IDE settings, skills, and workflows
- Should never be in a public repository
2. **Infrastructure secrets files:**
- `infra/k8s/sealed-secrets.yaml` - Contains sealed secrets configuration
- `infra/terraform/environments/secrets.tf` - References AWS Secrets Manager
### Files With Hardcoded Credentials (Documentation/Examples)
**Low Priority - These are examples but should be cleaned:**
- `website/docs/coordinator-api.html` - Contains `SECRET_KEY=your-secret-key`
- `website/docs/wallet-daemon.html` - Contains `password="password"`
- `website/docs/pool-hub.html` - Contains `POSTGRES_PASSWORD=pass`
## 🚨 IMMEDIATE ACTIONS REQUIRED
### 1. Remove Sensitive Files from Git History
```bash
# Remove .windsurf directory completely
git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch .windsurf/' --prune-empty --tag-name-filter cat -- --all
# Remove infrastructure secrets files
git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch infra/k8s/sealed-secrets.yaml infra/terraform/environments/secrets.tf' --prune-empty --tag-name-filter cat -- --all
# Clean up
git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin
git reflog expire --expire=now --all && git gc --prune=now --aggressive
```
### 2. Update .gitignore
Add these lines to `.gitignore`:
```
# IDE configurations
.windsurf/
.snapshots/
.vscode/
.idea/
# Additional security
*.env
*.env.*
*.key
*.pem
*.crt
*.p12
secrets/
credentials/
infra/k8s/sealed-secrets.yaml
infra/terraform/environments/secrets.tf
```
### 3. Replace Hardcoded Examples
Replace documentation examples with placeholder variables:
- `SECRET_KEY=your-secret-key``SECRET_KEY=${SECRET_KEY}`
- `password="password"``password="${DB_PASSWORD}"`
- `POSTGRES_PASSWORD=pass``POSTGRES_PASSWORD=${POSTGRES_PASSWORD}`
## 🐙 GITHUB REPOSITORY SETUP
### Repository Description
```
AITBC - AI Trusted Blockchain Computing Platform
A comprehensive blockchain-based marketplace for AI computing services with zero-knowledge proof verification and confidential transaction support.
```
### Recommended Topics
```
blockchain ai-computing marketplace zero-knowledge-proofs confidential-transactions web3 python fastapi react typescript kubernetes terraform helm decentralized gpu-computing zk-proofs cryptography smart-contracts
```
### Repository Settings to Configure
**Security Settings:**
- ✅ Enable "Security advisories"
- ✅ Enable "Dependabot alerts"
- ✅ Enable "Dependabot security updates"
- ✅ Enable "Code security" (GitHub Advanced Security if available)
- ✅ Enable "Secret scanning"
**Branch Protection:**
- ✅ Require pull request reviews
- ✅ Require status checks to pass
- ✅ Require up-to-date branches
- ✅ Include administrators
- ✅ Require conversation resolution
**Integration Settings:**
- ✅ Enable "Issues"
- ✅ Enable "Projects"
- ✅ Enable "Wikis"
- ✅ Enable "Discussions"
- ✅ Enable "Packages"
## 📋 FINAL CHECKLIST
### Before Pushing to GitHub:
- [ ] Remove `.windsurf/` directory from git history
- [ ] Remove `infra/k8s/sealed-secrets.yaml` from git history
- [ ] Remove `infra/terraform/environments/secrets.tf` from git history
- [ ] Update `.gitignore` with all exclusions
- [ ] Replace hardcoded credentials in documentation
- [ ] Scan for any remaining sensitive files
- [ ] Test that the repository still builds/works
### After GitHub Setup:
- [ ] Configure repository settings
- [ ] Set up branch protection rules
- [ ] Enable security features
- [ ] Add README with proper setup instructions
- [ ] Add SECURITY.md for vulnerability reporting
- [ ] Add CONTRIBUTING.md for contributors
## 🔍 TOOLS FOR VERIFICATION
### Scan for Credentials:
```bash
# Install truffleHog
pip install trufflehog
# Scan repository
trufflehog filesystem --directory /path/to/repo
# Alternative: git-secrets
git secrets --scan -r
```
### Git History Analysis:
```bash
# Check for large files
git rev-list --objects --all | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | sed -n 's/^blob //p' | sort -n --key=2 | tail -20
# Check for sensitive patterns
git log -p --all | grep -E "(password|secret|key|token)" | head -20
```
## ⚠️ IMPORTANT NOTES
1. **Force Push Required**: After removing files from history, you'll need to force push:
```bash
git push origin --force --all
git push origin --force --tags
```
2. **Team Coordination**: Notify all team members before force pushing as they'll need to re-clone the repository.
3. **Backup**: Create a backup of the current repository before making these changes.
4. **CI/CD Updates**: Update any CI/CD pipelines that might reference the removed files.
5. **Documentation**: Update deployment documentation to reflect the changes in secrets management.

View File

@@ -0,0 +1,87 @@
#!/bin/bash
# Start mock blockchain nodes for testing
# This script sets up the required mock servers on ports 8081 and 8082
set -e
echo "🚀 Starting Mock Blockchain Nodes for Testing"
echo "============================================="
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
print_status() {
echo -e "${GREEN}[INFO]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
# Check if required ports are available
check_port() {
local port=$1
if curl -s "http://127.0.0.1:$port/health" >/dev/null 2>&1; then
print_warning "Port $port is already in use"
return 1
fi
return 0
}
# Stop any existing mock servers
stop_existing_servers() {
print_status "Stopping existing mock servers..."
pkill -f "mock_blockchain_node.py" 2>/dev/null || true
sleep 1
}
# Start mock servers
start_mock_servers() {
print_status "Starting mock blockchain node on port 8081..."
cd "$(dirname "$0")/.."
python3 tests/mock_blockchain_node.py 8081 > /tmp/mock_node_8081.log 2>&1 &
local pid1=$!
print_status "Starting mock blockchain node on port 8082..."
python3 tests/mock_blockchain_node.py 8082 > /tmp/mock_node_8082.log 2>&1 &
local pid2=$!
# Wait for servers to start
sleep 2
# Verify servers are running
if curl -s "http://127.0.0.1:8081/health" >/dev/null 2>&1 && \
curl -s "http://127.0.0.1:8082/health" >/dev/null 2>&1; then
print_status "✅ Mock blockchain nodes are running!"
echo ""
echo "Node 1: http://127.0.0.1:8082"
echo "Node 2: http://127.0.0.1:8081"
echo ""
echo "To run tests:"
echo " python -m pytest tests/test_blockchain_nodes.py -v"
echo ""
echo "To stop servers:"
echo " pkill -f 'mock_blockchain_node.py'"
echo ""
echo "Log files:"
echo " Node 1: /tmp/mock_node_8082.log"
echo " Node 2: /tmp/mock_node_8081.log"
else
print_warning "❌ Failed to start mock servers"
echo "Check log files:"
echo " Node 1: /tmp/mock_node_8082.log"
echo " Node 2: /tmp/mock_node_8081.log"
exit 1
fi
}
# Main execution
main() {
stop_existing_servers
start_mock_servers
}
# Run main function
main "$@"

View File

@@ -0,0 +1,96 @@
#!/usr/bin/env python3
"""
Mock blockchain node server for testing purposes.
Implements the minimal API endpoints required by the test suite.
"""
import json
import threading
import time
from typing import Dict, Any
from fastapi import FastAPI
from fastapi.responses import JSONResponse
import uvicorn
# Create FastAPI app
app = FastAPI(title="Mock Blockchain Node", version="0.1.0")
# Mock state
mock_chain_state = {
"height": 100,
"hash": "0xabcdef1234567890",
"balances": {
"aitbc1alice00000000000000000000000000000000000": 1000,
"aitbc1bob0000000000000000000000000000000000000": 500,
"aitbc1charl0000000000000000000000000000000000": 100
},
"transactions": []
}
@app.get("/openapi.json")
async def openapi():
"""Return OpenAPI spec"""
return {
"openapi": "3.0.0",
"info": {
"title": "AITBC Blockchain API",
"version": "0.1.0"
},
"paths": {}
}
@app.get("/rpc/head")
async def get_chain_head():
"""Get current chain head"""
return JSONResponse(mock_chain_state)
@app.get("/rpc/getBalance/{address}")
async def get_balance(address: str):
"""Get balance for an address"""
balance = mock_chain_state["balances"].get(address, 0)
return JSONResponse({"balance": balance})
@app.post("/rpc/admin/mintFaucet")
async def mint_faucet(request: Dict[str, Any]):
"""Mint tokens to an address (devnet only)"""
address = request.get("address")
amount = request.get("amount", 0)
if address in mock_chain_state["balances"]:
mock_chain_state["balances"][address] += amount
else:
mock_chain_state["balances"][address] = amount
return JSONResponse({"success": True, "new_balance": mock_chain_state["balances"][address]})
@app.post("/rpc/sendTx")
async def send_transaction(request: Dict[str, Any]):
"""Send a transaction"""
# Generate mock transaction hash
tx_hash = f"0x{hash(str(request)) % 1000000000000000000000000000000000000000000000000000000000000000:x}"
# Add to transactions list
mock_chain_state["transactions"].append({
"hash": tx_hash,
"type": request.get("type", "TRANSFER"),
"sender": request.get("sender"),
"timestamp": time.time()
})
return JSONResponse({"tx_hash": tx_hash, "status": "pending"})
@app.get("/health")
async def health():
"""Health check endpoint"""
return JSONResponse({"status": "ok", "height": mock_chain_state["height"]})
def run_mock_server(port: int):
"""Run the mock server on specified port"""
uvicorn.run(app, host="127.0.0.1", port=port, log_level="warning")
if __name__ == "__main__":
import sys
port = int(sys.argv[1]) if len(sys.argv) > 1 else 8081
print(f"Starting mock blockchain node on port {port}")
run_mock_server(port)

375
website/docs/api.html Normal file
View File

@@ -0,0 +1,375 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API Documentation - AITBC</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
:root {
--primary-color: #2563eb;
--secondary-color: #1e40af;
--success-color: #10b981;
--text-dark: #1f2937;
--text-light: #6b7280;
--bg-light: #f9fafb;
--bg-white: #ffffff;
--border-color: #e5e7eb;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: var(--text-dark);
background: var(--bg-white);
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
header {
background: var(--text-dark);
color: white;
padding: 1rem 0;
position: sticky;
top: 0;
z-index: 100;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: white;
text-decoration: none;
}
.nav-links {
display: flex;
gap: 2rem;
list-style: none;
margin: 0;
padding: 0;
}
.nav-links a {
color: white;
text-decoration: none;
transition: color 0.3s;
}
.nav-links a:hover {
color: var(--primary-color);
}
.doc-header {
padding: 3rem 0;
background: var(--bg-light);
margin-bottom: 2rem;
}
.doc-header h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
color: var(--text-dark);
}
.doc-header p {
font-size: 1.2rem;
color: var(--text-light);
max-width: 800px;
}
.api-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
margin: 2rem 0;
}
.api-card {
background: var(--bg-white);
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 2rem;
transition: all 0.3s;
}
.api-card:hover {
box-shadow: 0 8px 25px rgba(0,0,0,0.1);
transform: translateY(-5px);
}
.api-card h3 {
margin-top: 0;
color: var(--primary-color);
font-size: 1.5rem;
}
.api-card .endpoint {
font-family: monospace;
background: var(--bg-light);
padding: 0.5rem 1rem;
border-radius: 4px;
margin: 1rem 0;
color: var(--text-dark);
}
.method {
display: inline-block;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.875rem;
font-weight: 600;
margin-right: 0.5rem;
}
.method.get { background: #10b981; color: white; }
.method.post { background: #3b82f6; color: white; }
.method.put { background: #f59e0b; color: white; }
.method.delete { background: #ef4444; color: white; }
.back-button {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: var(--primary-color);
text-decoration: none;
margin-bottom: 2rem;
font-weight: 600;
}
.back-button:hover {
color: var(--secondary-color);
}
footer {
background: var(--text-dark);
color: white;
padding: 2rem 0;
text-align: center;
margin-top: 4rem;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.doc-header h1 {
font-size: 2rem;
}
}
</style>
</head>
<body>
<header>
<nav class="container">
<a href="../index.html" class="logo">AITBC</a>
<ul class="nav-links">
<li><a href="../index.html">Home</a></li>
<li><a href="../docs/index.html">Documentation</a></li>
<li><a href="mailto:aitbc@bubuit.net">Contact</a></li>
</ul>
</nav>
</header>
<main>
<div class="container">
<!-- Back Button -->
<a href="../docs/index.html" class="back-button">
<i class="fas fa-arrow-left"></i>
Back to Documentation
</a>
<!-- Header -->
<div class="doc-header">
<h1><i class="fas fa-code"></i> API Documentation</h1>
<p>Complete API reference for the AITBC platform. All APIs are RESTful and use JSON for request/response format.</p>
</div>
<!-- API Endpoints -->
<div class="api-grid">
<!-- Client API -->
<div class="api-card">
<h3><i class="fas fa-users"></i> Client API</h3>
<p>Endpoints for job submission, status checking, and receipt retrieval.</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/jobs
</div>
<p>Submit a new AI compute job</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/jobs/{job_id}
</div>
<p>Get job status and results</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/jobs/{job_id}/receipt
</div>
<p>Get computation receipt</p>
</div>
<!-- Miner API -->
<div class="api-card">
<h3><i class="fas fa-hammer"></i> Miner API</h3>
<p>Endpoints for miner registration, job assignment, and result submission.</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/miners/register
</div>
<p>Register as a miner</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/miners/{address}/heartbeat
</div>
<p>Send miner heartbeat</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/jobs/{job_id}/complete
</div>
<p>Submit job results</p>
</div>
<!-- Admin API -->
<div class="api-card">
<h3><i class="fas fa-shield-alt"></i> Admin API</h3>
<p>Administrative endpoints for system management and monitoring.</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/admin/miners
</div>
<p>List all registered miners</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/admin/jobs
</div>
<p>List all jobs in system</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/admin/stats
</div>
<p>Get system statistics</p>
</div>
<!-- Marketplace API -->
<div class="api-card">
<h3><i class="fas fa-store"></i> Marketplace API</h3>
<p>Endpoints for the compute marketplace and trading functionality.</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/marketplace/offers
</div>
<p>List available compute offers</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/marketplace/offers
</div>
<p>Create a new compute offer</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/marketplace/trades
</div>
<p>Execute a trade</p>
</div>
<!-- Exchange API -->
<div class="api-card">
<h3><i class="fas fa-exchange-alt"></i> Exchange API</h3>
<p>Endpoints for token exchange and trading operations.</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/exchange/ticker
</div>
<p>Get current ticker prices</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/exchange/orderbook
</div>
<p>Get order book</p>
<div class="endpoint">
<span class="method post">POST</span>/v1/exchange/orders
</div>
<p>Place a new order</p>
</div>
<!-- Explorer API -->
<div class="api-card">
<h3><i class="fas fa-search"></i> Explorer API</h3>
<p>Endpoints for blockchain exploration and data retrieval.</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/explorer/blocks
</div>
<p>List recent blocks</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/explorer/transactions
</div>
<p>List recent transactions</p>
<div class="endpoint">
<span class="method get">GET</span>/v1/explorer/address/{address}
</div>
<p>Get address details</p>
</div>
</div>
<!-- Authentication -->
<section style="margin-top: 3rem;">
<h2>Authentication</h2>
<p>All API requests must include an API key in the header:</p>
<pre style="background: #1f2937; color: #f9fafb; padding: 1rem; border-radius: 8px; overflow-x: auto;"><code>X-Api-Key: your_api_key_here</code></pre>
<h3 style="margin-top: 2rem;">Getting API Keys</h3>
<ul>
<li>Clients: Register through the web interface or contact support</li>
<li>Miners: Generated upon registration</li>
<li>Admin: Pre-configured secure keys</li>
</ul>
</section>
<!-- Base URL -->
<section style="margin-top: 3rem;">
<h2>Base URL</h2>
<p>All API endpoints are relative to the base URL:</p>
<pre style="background: #1f2937; color: #f9fafb; padding: 1rem; border-radius: 8px; overflow-x: auto;"><code>https://aitbc.bubuit.net/api</code></pre>
<p>For development:</p>
<pre style="background: #1f2937; color: #f9fafb; padding: 1rem; border-radius: 8px; overflow-x: auto;"><code>http://localhost:18000</code></pre>
</section>
<!-- WebSocket -->
<section style="margin-top: 3rem;">
<h2>WebSocket API</h2>
<p>Real-time updates are available through WebSocket connections:</p>
<pre style="background: #1f2937; color: #f9fafb; padding: 1rem; border-radius: 8px; overflow-x: auto;"><code>ws://aitbc.bubuit.net:18001/ws</code></pre>
<p>Subscribe to events:</p>
<pre style="background: #1f2937; color: #f9fafb; padding: 1rem; border-radius: 8px; overflow-x: auto;"><code>{
"method": "subscribe",
"params": ["job_updates", "miner_heartbeats"]
}</code></pre>
</section>
</div>
</main>
<footer>
<div class="container">
<p>&copy; 2025 AITBC. All rights reserved.</p>
</div>
</footer>
</body>
</html>

View File

@@ -300,9 +300,9 @@
<!-- Overview -->
<section class="content-section">
<div class="alert alert-info" style="margin-bottom: 2rem;">
<strong>📚 Also available in Markdown:</strong>
<a href="https://gitea.bubuit.net/oib/aitbc/src/branch/main/docs/blockchain-node.md" target="_blank" style="color: inherit; text-decoration: underline;">View this documentation in markdown format</a> for easier contribution and version control.
<div class="alert alert-info">
<i class="fas fa-info-circle"></i>
<strong>System Flow:</strong> See the <a href="flowchart.html">complete system flow diagram</a> to understand how the blockchain node interacts with other AITBC components.
</div>
<h2>Overview</h2>

View File

@@ -106,11 +106,7 @@
<!-- Features Section -->
<section class="py-20">
<div class="container mx-auto px-4">
<div class="alert alert-info" style="background: #dbeafe; border-color: #3b82f6; color: #1e40af; margin-bottom: 2rem; padding: 1rem; border-radius: 8px;">
<strong>📚 Also available in Markdown:</strong>
<a href="https://gitea.bubuit.net/oib/aitbc/src/branch/main/docs/wallet-documentation.md" target="_blank" style="color: #1e40af; text-decoration: underline;">View this documentation in markdown format</a> for easier contribution and version control.
</div>
<h2 class="text-3xl font-bold text-center mb-12">Why Choose AITBC Wallet?</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<div class="feature-card bg-white p-8 rounded-xl text-center">

View File

@@ -333,7 +333,7 @@ chmod +x aitbc-cli.sh
./aitbc-cli.sh submit "Your prompt here" --model llama3.2</code></pre>
<h3>Web Interface</h3>
<p>Visit <a href="https://aitbc.bubuit.net/marketplace/" target="_blank">aitbc.bubuit.net/marketplace</a> to access the web interface.</p>
<p>Visit the <a href="../marketplace/">marketplace</a> to access the web interface.</p>
</section>
<!-- Python SDK -->
@@ -554,7 +554,7 @@ curl -X GET https://aitbc.bubuit.net/api/v1/jobs/JOB_ID \
<li><strong>Documentation</strong>: <a href="full-documentation.html">Full API reference</a></li>
<li><strong>Community</strong>: <a href="https://discord.gg/aitbc">Join our Discord</a></li>
<li><strong>Email</strong>: <a href="mailto:aitbc@bubuit.net">aitbc@bubuit.net</a></li>
<li><strong>Status</strong>: <a href="https://status.aitbc.bubuit.net">System status</a></li>
<li><strong>Status</strong>: System status available in monitoring dashboard</li>
</ul>
<h3>Tutorials</h3>

View File

@@ -430,19 +430,19 @@
<section class="content-section">
<h2>Quick Links</h2>
<div class="quick-links">
<a href="https://aitbc.bubuit.net/Exchange/" target="_blank" class="quick-link">
<a href="../Exchange/" class="quick-link">
<i class="fas fa-exchange-alt"></i>
<span>Trade Exchange</span>
</a>
<a href="https://aitbc.bubuit.net/marketplace/" target="_blank" class="quick-link">
<a href="../marketplace/" class="quick-link">
<i class="fas fa-store"></i>
<span>Marketplace</span>
</a>
<a href="https://aitbc.bubuit.net/explorer/" target="_blank" class="quick-link">
<a href="../explorer/" class="quick-link">
<i class="fas fa-search"></i>
<span>Explorer</span>
</a>
<a href="https://aitbc.bubuit.net/api/docs" target="_blank" class="quick-link">
<a href="../api/docs" class="quick-link">
<i class="fas fa-code"></i>
<span>API Docs</span>
</a>
@@ -480,7 +480,6 @@ docker-compose logs -f</pre>
<p>For component-specific issues:</p>
<ul>
<li>Check individual documentation pages</li>
<li>Visit the <a href="https://gitea.bubuit.net/oib/aitbc" target="_blank">GitHub repository</a></li>
<li>Contact: <a href="mailto:aitbc@bubuit.net">aitbc@bubuit.net</a></li>
</ul>
</section>

View File

@@ -291,11 +291,12 @@
<!-- Component Cards -->
<div class="components-grid">
<div class="alert alert-info" style="grid-column: 1 / -1; background: #dbeafe; border-color: #3b82f6; color: #1e40af; margin-bottom: 2rem; padding: 1rem; border-radius: 8px;">
<strong>📚 Also available in Markdown:</strong>
<a href="https://gitea.bubuit.net/oib/aitbc/src/branch/main/docs/components.md" target="_blank" style="color: #1e40af; text-decoration: underline;">View this documentation in markdown format</a> for easier contribution and version control.
<div class="alert alert-info">
<i class="fas fa-info-circle"></i>
<strong>System Flow:</strong> See the <a href="flowchart.html">complete system flow diagram</a> to understand how all components interact in the AITBC architecture.
</div>
<!-- Blockchain Node -->
<div class="component-card">
<div class="component-icon">
@@ -429,16 +430,16 @@
<section class="section">
<h2>Quick Links</h2>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.5rem;">
<a href="https://aitbc.bubuit.net/Exchange/" target="_blank" style="padding: 1rem; background: var(--bg-light); border-radius: 8px; text-decoration: none; color: var(--text-dark); transition: all 0.3s;" onmouseover="this.style.background='var(--primary-color)'; this.style.color='white';" onmouseout="this.style.background='var(--bg-light)'; this.style.color='var(--text-dark)';">
<a href="../Exchange/" style="padding: 1rem; background: var(--bg-light); border-radius: 8px; text-decoration: none; color: var(--text-dark); transition: all 0.3s;" onmouseover="this.style.background='var(--primary-color)'; this.style.color='white';" onmouseout="this.style.background='var(--bg-light)'; this.style.color='var(--text-dark)';">
<i class="fas fa-exchange-alt"></i> Trade Exchange
</a>
<a href="https://aitbc.bubuit.net/marketplace/" target="_blank" style="padding: 1rem; background: var(--bg-light); border-radius: 8px; text-decoration: none; color: var(--text-dark); transition: all 0.3s;" onmouseover="this.style.background='var(--primary-color)'; this.style.color='white';" onmouseout="this.style.background='var(--bg-light)'; this.style.color='var(--text-dark)';">
<a href="../marketplace/" style="padding: 1rem; background: var(--bg-light); border-radius: 8px; text-decoration: none; color: var(--text-dark); transition: all 0.3s;" onmouseover="this.style.background='var(--primary-color)'; this.style.color='white';" onmouseout="this.style.background='var(--bg-light)'; this.style.color='var(--text-dark)';">
<i class="fas fa-store"></i> Marketplace
</a>
<a href="https://aitbc.bubuit.net/explorer/" target="_blank" style="padding: 1rem; background: var(--bg-light); border-radius: 8px; text-decoration: none; color: var(--text-dark); transition: all 0.3s;" onmouseover="this.style.background='var(--primary-color)'; this.style.color='white';" onmouseout="this.style.background='var(--bg-light)'; this.style.color='var(--text-dark)';">
<a href="../explorer/" style="padding: 1rem; background: var(--bg-light); border-radius: 8px; text-decoration: none; color: var(--text-dark); transition: all 0.3s;" onmouseover="this.style.background='var(--primary-color)'; this.style.color='white';" onmouseout="this.style.background='var(--bg-light)'; this.style.color='var(--text-dark)';">
<i class="fas fa-search"></i> Explorer
</a>
<a href="https://aitbc.bubuit.net/api/docs" target="_blank" style="padding: 1rem; background: var(--bg-light); border-radius: 8px; text-decoration: none; color: var(--text-dark); transition: all 0.3s;" onmouseover="this.style.background='var(--primary-color)'; this.style.color='white';" onmouseout="this.style.background='var(--bg-light)'; this.style.color='var(--text-dark)';">
<a href="../api/docs" style="padding: 1rem; background: var(--bg-light); border-radius: 8px; text-decoration: none; color: var(--text-dark); transition: all 0.3s;" onmouseover="this.style.background='var(--primary-color)'; this.style.color='white';" onmouseout="this.style.background='var(--bg-light)'; this.style.color='var(--text-dark)';">
<i class="fas fa-code"></i> API Docs
</a>
</div>

View File

@@ -300,9 +300,9 @@
<!-- Overview -->
<section class="content-section">
<div class="alert alert-info" style="margin-bottom: 2rem;">
<strong>📚 Also available in Markdown:</strong>
<a href="https://gitea.bubuit.net/oib/aitbc/src/branch/main/docs/coordinator-api.md" target="_blank" style="color: inherit; text-decoration: underline;">View this documentation in markdown format</a> for easier contribution and version control.
<div class="alert alert-info">
<i class="fas fa-info-circle"></i>
<strong>System Flow:</strong> See the <a href="flowchart.html">complete system flow diagram</a> to understand how the coordinator API fits into the overall AITBC architecture.
</div>
<h2>Overview</h2>

View File

@@ -1074,6 +1074,8 @@ footer p {
.reader-card.client::before { background: var(--success-color); }
.reader-card.developer::before { background: var(--warning-color); }
.reader-card.full-doc::before { background: var(--danger-color); }
.reader-card.components::before { background: #8b5cf6; }
.reader-card.flow::before { background: #06b6d4; }
.reader-card:hover {
transform: translateY(-10px);
@@ -1096,6 +1098,8 @@ footer p {
.reader-card.client .reader-icon { background: var(--success-color); }
.reader-card.developer .reader-icon { background: var(--warning-color); }
.reader-card.full-doc .reader-icon { background: var(--danger-color); }
.reader-card.components .reader-icon { background: #8b5cf6; }
.reader-card.flow .reader-icon { background: #06b6d4; }
.reader-card h3 {
font-size: 1.8rem;
@@ -1137,6 +1141,8 @@ footer p {
.reader-card.client .btn { background: var(--success-color); }
.reader-card.developer .btn { background: var(--warning-color); }
.reader-card.full-doc .btn { background: var(--danger-color); }
.reader-card.components .btn { background: #8b5cf6; }
.reader-card.flow .btn { background: #06b6d4; }
/* ============================================
Page-Specific: Search Bar (Index)

View File

@@ -0,0 +1,633 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Developer Documentation - AITBC</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
:root {
--primary-color: #2563eb;
--secondary-color: #1e40af;
--success-color: #10b981;
--warning-color: #f59e0b;
--danger-color: #ef4444;
--text-dark: #1f2937;
--text-light: #6b7280;
--bg-light: #f9fafb;
--bg-white: #ffffff;
--border-color: #e5e7eb;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: var(--text-dark);
background: var(--bg-white);
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
header {
background: var(--text-dark);
color: white;
padding: 1rem 0;
position: sticky;
top: 0;
z-index: 100;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: white;
text-decoration: none;
}
.nav-links {
display: flex;
gap: 2rem;
list-style: none;
margin: 0;
padding: 0;
}
.nav-links a {
color: white;
text-decoration: none;
transition: color 0.3s;
}
.nav-links a:hover {
color: var(--primary-color);
}
.breadcrumb {
padding: 1rem 0;
color: var(--text-light);
font-size: 0.9rem;
}
.breadcrumb a {
color: var(--text-light);
text-decoration: none;
}
.breadcrumb a:hover {
color: var(--primary-color);
}
.doc-header {
padding: 3rem 0;
background: var(--bg-light);
margin-bottom: 2rem;
}
.doc-header h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
color: var(--text-dark);
}
.doc-header p {
font-size: 1.2rem;
color: var(--text-light);
max-width: 800px;
}
.content-section {
margin-bottom: 3rem;
}
.content-section h2 {
font-size: 1.8rem;
margin-bottom: 1.5rem;
color: var(--text-dark);
border-bottom: 2px solid var(--border-color);
padding-bottom: 0.5rem;
}
.content-section h3 {
font-size: 1.4rem;
margin: 2rem 0 1rem;
color: var(--text-dark);
}
.content-section h4 {
font-size: 1.2rem;
margin: 1.5rem 0 0.5rem;
color: var(--text-dark);
}
.content-section p {
margin-bottom: 1rem;
color: var(--text-dark);
}
.content-section ul {
margin-bottom: 1rem;
padding-left: 2rem;
}
.content-section li {
margin-bottom: 0.5rem;
}
.tech-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 1rem;
margin: 2rem 0;
}
.tech-item {
background: var(--bg-light);
padding: 1rem;
border-radius: 8px;
text-align: center;
font-weight: 600;
}
.tech-icon {
font-size: 2rem;
color: var(--primary-color);
margin-bottom: 0.5rem;
}
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
}
.feature-card {
background: var(--bg-white);
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.feature-card h4 {
margin-top: 0;
color: var(--primary-color);
}
pre {
background: #1f2937;
color: #f9fafb;
padding: 1.5rem;
border-radius: 8px;
overflow-x: auto;
margin: 1rem 0;
}
code {
font-family: 'Courier New', Courier, monospace;
font-size: 0.9rem;
}
pre code {
background: none;
padding: 0;
}
.inline-code {
background: var(--bg-light);
padding: 0.2rem 0.4rem;
border-radius: 4px;
font-size: 0.9rem;
}
.back-button {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: var(--primary-color);
text-decoration: none;
margin-bottom: 2rem;
font-weight: 600;
}
.back-button:hover {
color: var(--secondary-color);
}
.alert {
padding: 1rem;
border-radius: 8px;
margin: 1rem 0;
}
.alert-info {
background: #dbeafe;
border-left: 4px solid var(--primary-color);
color: #1e40af;
}
.alert-success {
background: #d1fae5;
border-left: 4px solid var(--success-color);
color: #065f46;
}
.bounty-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
}
.bounty-card {
background: var(--bg-white);
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
border-top: 4px solid var(--warning-color);
}
.bounty-amount {
font-size: 1.5rem;
font-weight: bold;
color: var(--warning-color);
}
footer {
background: var(--text-dark);
color: white;
padding: 2rem 0;
text-align: center;
margin-top: 4rem;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.doc-header h1 {
font-size: 2rem;
}
}
</style>
</head>
<body>
<header>
<nav class="container">
<a href="../index.html" class="logo">AITBC</a>
<ul class="nav-links">
<li><a href="../index.html">Home</a></li>
<li><a href="index.html">Documentation</a></li>
<li><a href="mailto:aitbc@bubuit.net">Contact</a></li>
</ul>
</nav>
</header>
<main>
<div class="container">
<!-- Breadcrumb -->
<div class="breadcrumb">
<a href="index.html">Documentation</a>
<span></span>
<span>Developer Documentation</span>
</div>
<!-- Back Button -->
<a href="index.html" class="back-button">
<i class="fas fa-arrow-left"></i>
Back to Documentation
</a>
<!-- Header -->
<div class="doc-header">
<h1><i class="fa fa-code"></i> Developer Documentation</h1>
<p>Build on AITBC and contribute to the protocol. Designed for developers wanting to extend the platform or integrate with it.</p>
</div>
<!-- Technology Stack -->
<section class="content-section">
<h2>Technology Stack</h2>
<p>AITBC is built with modern technologies to ensure performance, security, and developer productivity.</p>
<div class="tech-grid">
<div class="tech-item">
<div class="tech-icon">
<i class="fab fa-python"></i>
</div>
<div>Python</div>
</div>
<div class="tech-item">
<div class="tech-icon">
<i class="fab fa-rust"></i>
</div>
<div>Rust</div>
</div>
<div class="tech-item">
<div class="tech-icon">
<i class="fab fa-js"></i>
</div>
<div>TypeScript</div>
</div>
<div class="tech-item">
<div class="tech-icon">
<i class="fas fa-database"></i>
</div>
<div>PostgreSQL</div>
</div>
<div class="tech-item">
<div class="tech-icon">
<i class="fas fa-cube"></i>
</div>
<div>Docker</div>
</div>
<div class="tech-item">
<div class="tech-icon">
<i class="fas fa-project-diagram"></i>
</div>
<div>Kubernetes</div>
</div>
</div>
</section>
<!-- Getting Started -->
<section class="content-section">
<h2>Getting Started</h2>
<p>Ready to contribute? Here's how to get started with AITBC development.</p>
<h3>Development Environment Setup</h3>
<div class="alert alert-info">
<strong>Prerequisites:</strong> Python 3.9+, Node.js 18+, Docker, Git
</div>
<pre><code># Fork & Clone
git clone https://gitea.bubuit.net/YOUR_USERNAME/aitbc.git
cd aitbc
# Set up Python environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Set up frontend
cd website
npm install
npm run dev</code></pre>
<h3>Project Structure</h3>
<pre><code>aitbc/
├── blockchain/ # Blockchain node (Rust)
├── coordinator/ # Coordinator API (Python/FastAPI)
├── miner/ # Miner daemon (Python)
├── wallet/ # Wallet daemon (Python)
├── website/ # Frontend applications
│ ├── marketplace/ # Marketplace UI (React/TypeScript)
│ ├── explorer/ # Blockchain explorer
│ └── exchange/ # Trade exchange
├── docker-compose.yml # Development environment
└── docs/ # Documentation</code></pre>
</section>
<!-- Contributing -->
<section class="content-section">
<h2>Contributing</h2>
<p>We welcome contributions from the community! Here's how you can help:</p>
<h3>Contribution Areas</h3>
<div class="feature-grid">
<div class="feature-card">
<h4><i class="fas fa-bug"></i> Bug Fixes</h4>
<p>Find and fix bugs in any component</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-plus"></i> New Features</h4>
<p>Implement new functionality</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-book"></i> Documentation</h4>
<p>Improve documentation and examples</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-vial"></i> Testing</h4>
<p>Write tests and improve coverage</p>
</div>
</div>
<h3>Pull Request Process</h3>
<ol>
<li>Create an issue describing your proposed change</li>
<li>Fork the repository and create a feature branch</li>
<li>Make your changes with proper tests</li>
<li>Ensure all tests pass and code follows style guidelines</li>
<li>Submit a pull request with detailed description</li>
<li>Respond to code review feedback</li>
</ol>
</section>
<!-- Bounty Program -->
<section class="content-section">
<h2>Bounty Program</h2>
<p>Earn AITBC tokens by contributing to the platform through our bounty program.</p>
<div class="bounty-grid">
<div class="bounty-card">
<h4>Critical Bug</h4>
<div class="bounty-amount">1000-5000 AITBC</div>
<p>Security vulnerabilities or critical issues</p>
</div>
<div class="bounty-card">
<h4>Feature Implementation</h4>
<div class="bounty-amount">500-2000 AITBC</div>
<p>New features as outlined in issues</p>
</div>
<div class="bounty-card">
<h4>Documentation</h4>
<div class="bounty-amount">100-500 AITBC</div>
<p>Comprehensive guides and tutorials</p>
</div>
<div class="bounty-card">
<h4>Performance</h4>
<div class="bounty-amount">300-1500 AITBC</div>
<p>Optimizations and improvements</p>
</div>
</div>
<h3>How to Participate</h3>
<ul>
<li>Check the <a href="full-documentation-md.html">Issues page</a> for bounty-labeled items</li>
<li>Claim an issue by commenting on it</li>
<li>Complete the work and submit a PR</li>
<li>Receive bounty upon merge</li>
</ul>
</section>
<!-- APIs -->
<section class="content-section">
<h2>APIs & SDKs</h2>
<p>Integrate AITBC into your applications using our APIs and SDKs.</p>
<h3>REST APIs</h3>
<ul>
<li><strong>Coordinator API</strong>: Job submission and management</li>
<li><strong>Blockchain RPC</strong>: Blockchain interaction</li>
<li><strong>Wallet API</strong>: Wallet operations</li>
<li><strong>Pool Hub API</strong>: Miner coordination</li>
</ul>
<h3>SDKs</h3>
<ul>
<li><strong>Python SDK</strong>: <code>pip install aitbc-client</code></li>
<li><strong>JavaScript SDK</strong>: <code>npm install @aitbc/client</code></li>
<li><strong>Rust Crate</strong>: <code>cargo add aitbc-rust</code></li>
<li><strong>Go Client</strong>: <code>go get github.com/aitbc/go-client</code></li>
</ul>
<h3>Example: Submitting a Job</h3>
<pre><code>from aitbc import AITBCClient
client = AITBCClient(api_key="your-key")
# Submit inference job
job = client.submit_job(
type="inference",
model="llama3.2",
prompt="Explain AI in simple terms",
max_tokens=500
)
# Wait for result
result = client.wait_for_job(job.id)
print(result.output)</code></pre>
</section>
<!-- Example: Adding an API Endpoint -->
<section class="content-section">
<h2>Example: Adding an API Endpoint</h2>
<p>Here's how to add a new endpoint to the Coordinator API:</p>
<h3>1. Define the Endpoint</h3>
<pre><code># coordinator/api/endpoints/jobs.py
from fastapi import APIRouter, Depends
from ..dependencies import get_current_user
from ..schemas import JobResponse
router = APIRouter(prefix="/jobs", tags=["jobs"])
@router.get("/stats", response_model=JobStats)
async def get_job_stats(
current_user: User = Depends(get_current_user)
):
"""Get job statistics for current user"""
stats = await job_service.get_user_stats(current_user.id)
return stats</code></pre>
<h3>2. Add Tests</h3>
<pre><code># tests/api/test_jobs.py
async def test_get_job_stats(client, auth_headers):
response = await client.get(
"/api/jobs/stats",
headers=auth_headers
)
assert response.status_code == 200
assert "total_jobs" in response.json()</code></pre>
<h3>3. Update Documentation</h3>
<pre><code># docs/api/jobs.md
## Job Statistics
Get statistics about your submitted jobs.
### Request
```
GET /api/jobs/stats
Authorization: Bearer YOUR_TOKEN
```
### Response
```json
{
"total_jobs": 42,
"completed_jobs": 38,
"failed_jobs": 2,
"pending_jobs": 2
}
```</code></pre>
</section>
<!-- Development Tools -->
<section class="content-section">
<h2>Development Tools</h2>
<h3>Local Development</h3>
<pre><code># Start all services
docker-compose up -d
# View logs
docker-compose logs -f coordinator
# Run tests
pytest tests/
# Lint code
flake8 coordinator/
black coordinator/</code></pre>
<h3>Debugging</h3>
<ul>
<li>Use VS Code with Python and Rust extensions</li>
<li>Enable debug mode: <code>DEBUG=true python -m coordinator.main</code></li>
<li>Use the built-in admin dashboard at <code>/admin</code></li>
</ul>
</section>
<!-- Community -->
<section class="content-section">
<h2>Community & Support</h2>
<h3>Get in Touch</h3>
<ul>
<li><strong>Discord</strong>: <a href="#">#dev channel</a></li>
<li><strong>GitHub</strong>: <a href="full-documentation-md.html">Create issues</a></li>
<li><strong>Email</strong>: <a href="mailto:aitbc@bubuit.net">aitbc@bubuit.net</a></li>
</ul>
<h3>Developer Events</h3>
<ul>
<li>Weekly dev standups - Tuesdays 14:00 UTC</li>
<li>Monthly hackathons - First weekend of each month</li>
<li>Quarterly roadmap reviews</li>
</ul>
</section>
<!-- Resources -->
<section class="content-section">
<h2>Additional Resources</h2>
<ul>
<li><a href="blockchain-node-md.html">Blockchain Node Documentation</a></li>
<li><a href="coordinator-api-md.html">Coordinator API Reference</a></li>
<li><a href="full-documentation-md.html">Full Technical Documentation</a></li>
<li><a href="full-documentation-md.html">Developer Wiki</a></li>
<li><a href="full-documentation-md.html">Release Notes</a></li>
</ul>
</section>
</div>
</main>
<footer>
<div class="container">
<p>&copy; 2025 AITBC. All rights reserved.</p>
</div>
</footer>
</body>
</html>

View File

@@ -67,9 +67,9 @@
<!-- Getting Started -->
<section class="content-section">
<div class="alert alert-info" style="margin-bottom: 2rem;">
<strong>📚 Also available in Markdown:</strong>
<a href="https://gitea.bubuit.net/oib/aitbc/src/branch/main/docs/client-documentation.md" target="_blank" style="color: inherit; text-decoration: underline;">View this documentation in markdown format</a> for easier contribution and version control.
<div class="alert alert-info">
<i class="fas fa-info-circle"></i>
<strong>System Flow:</strong> See the <a href="flowchart.html">complete system flow diagram</a> to understand how client requests flow through the AITBC system.
</div>
<h2>Getting Started</h2>

View File

@@ -95,10 +95,6 @@
<!-- Getting Started -->
<section class="content-section">
<div class="alert alert-info" style="margin-bottom: 2rem;">
<strong>📚 Also available in Markdown:</strong>
<a href="https://gitea.bubuit.net/oib/aitbc/src/branch/main/docs/developer-documentation.md" target="_blank" style="color: inherit; text-decoration: underline;">View this documentation in markdown format</a> for easier contribution and version control.
</div>
<h2>Getting Started</h2>
<p>Ready to contribute? Here's how to get started with AITBC development.</p>

View File

@@ -58,9 +58,9 @@
<!-- Getting Started -->
<section class="content-section">
<div class="alert alert-info" style="margin-bottom: 2rem;">
<strong>📚 Also available in Markdown:</strong>
<a href="https://gitea.bubuit.net/oib/aitbc/src/branch/main/docs/miner-documentation.md" target="_blank" style="color: inherit; text-decoration: underline;">View this documentation in markdown format</a> for easier contribution and version control.
<div class="alert alert-info">
<i class="fas fa-info-circle"></i>
<strong>System Flow:</strong> See the <a href="flowchart.html">complete system flow diagram</a> to understand how miners receive and process jobs in the AITBC system.
</div>
<h2>Getting Started</h2>

View File

@@ -0,0 +1,422 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explorer Web - AITBC Documentation</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
:root {
--primary-color: #2563eb;
--secondary-color: #1e40af;
--success-color: #10b981;
--text-dark: #1f2937;
--text-light: #6b7280;
--bg-light: #f9fafb;
--bg-white: #ffffff;
--border-color: #e5e7eb;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: var(--text-dark);
background: var(--bg-white);
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
header {
background: var(--text-dark);
color: white;
padding: 1rem 0;
position: sticky;
top: 0;
z-index: 100;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: white;
text-decoration: none;
}
.nav-links {
display: flex;
gap: 2rem;
list-style: none;
margin: 0;
padding: 0;
}
.nav-links a {
color: white;
text-decoration: none;
transition: color 0.3s;
}
.nav-links a:hover {
color: var(--primary-color);
}
.breadcrumb {
padding: 1rem 0;
color: var(--text-light);
font-size: 0.9rem;
}
.breadcrumb a {
color: var(--text-light);
text-decoration: none;
}
.breadcrumb a:hover {
color: var(--primary-color);
}
.doc-header {
padding: 3rem 0;
background: var(--bg-light);
margin-bottom: 2rem;
}
.doc-header h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
color: var(--text-dark);
}
.doc-header p {
font-size: 1.2rem;
color: var(--text-light);
max-width: 800px;
}
.status-badge {
display: inline-block;
padding: 0.25rem 0.75rem;
background: #10b98120;
color: var(--success-color);
border-radius: 20px;
font-size: 0.875rem;
font-weight: 600;
margin-top: 1rem;
}
.content-section {
margin-bottom: 3rem;
}
.content-section h2 {
font-size: 1.8rem;
margin-bottom: 1.5rem;
color: var(--text-dark);
border-bottom: 2px solid var(--border-color);
padding-bottom: 0.5rem;
}
.content-section h3 {
font-size: 1.4rem;
margin: 2rem 0 1rem;
color: var(--text-dark);
}
.content-section p {
margin-bottom: 1rem;
color: var(--text-dark);
}
.content-section ul {
margin-bottom: 1rem;
padding-left: 2rem;
}
.content-section li {
margin-bottom: 0.5rem;
}
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
}
.feature-card {
background: var(--bg-white);
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.feature-card h4 {
margin-top: 0;
color: var(--primary-color);
}
pre {
background: #1f2937;
color: #f9fafb;
padding: 1.5rem;
border-radius: 8px;
overflow-x: auto;
margin: 1rem 0;
}
code {
font-family: 'Courier New', Courier, monospace;
font-size: 0.9rem;
}
pre code {
background: none;
padding: 0;
}
.back-button {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: var(--primary-color);
text-decoration: none;
margin-bottom: 2rem;
font-weight: 600;
}
.back-button:hover {
color: var(--secondary-color);
}
footer {
background: var(--text-dark);
color: white;
padding: 2rem 0;
text-align: center;
margin-top: 4rem;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.doc-header h1 {
font-size: 2rem;
}
}
</style>
</head>
<body>
<header>
<nav class="container">
<a href="../index.html" class="logo">AITBC</a>
<ul class="nav-links">
<li><a href="../index.html">Home</a></li>
<li><a href="index.html">Documentation</a></li>
<li><a href="mailto:aitbc@bubuit.net">Contact</a></li>
</ul>
</nav>
</header>
<main>
<div class="container">
<!-- Breadcrumb -->
<div class="breadcrumb">
<a href="index.html">Documentation</a>
<span></span>
<a href="#">Components</a>
<span></span>
<span>Explorer Web</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-search"></i> Explorer Web</h1>
<p>Full-featured blockchain explorer with blocks, transactions, addresses, and receipts tracking. Responsive design with live data.</p>
<span class="status-badge">● Live</span>
</div>
<!-- Overview -->
<section class="content-section">
<h2>Overview</h2>
<p>The AITBC Explorer Web provides a comprehensive view of the blockchain, allowing users to track blocks, transactions, addresses, and AI computation receipts in real-time.</p>
<h3>Key Features</h3>
<ul>
<li>Real-time block and transaction tracking</li>
<li>Address balance and transaction history</li>
<li>AI computation receipt verification</li>
<li>Search functionality for blocks, transactions, and addresses</li>
<li>Responsive design for all devices</li>
<li>Live data updates via WebSocket</li>
</ul>
</section>
<!-- Architecture -->
<section class="content-section">
<h2>Architecture</h2>
<p>The explorer is built as a modern single-page application:</p>
<div class="feature-grid">
<div class="feature-card">
<h4><i class="fas fa-paint-brush"></i> Frontend</h4>
<p>React with TypeScript for type safety</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-plug"></i> API Integration</h4>
<p>Direct blockchain RPC API connection</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-sync"></i> Real-time Updates</h4>
<p>WebSocket for live block updates</p>
</div>
<div class="feature-card">
<i class="fas fa-mobile-alt"></i> Responsive</h4>
<p>Mobile-first responsive design</p>
</div>
</div>
</section>
<!-- Features -->
<section class="content-section">
<h2>Features</h2>
<h3>Block Explorer</h3>
<ul>
<li>Latest blocks list with timestamps</li>
<li>Detailed block view with transactions</li>
<li>Block validation status</li>
<li>Block size and gas metrics</li>
</ul>
<h3>Transaction Tracker</h3>
<ul>
<li>Transaction details and status</li>
<li>Input/output addresses</li>
<li>Gas fees and confirmations</li>
<li>Transaction mempool status</li>
</ul>
<h3>Address Viewer</h3>
<ul>
<li>Address balance and history</li>
<li>Transaction list per address</li>
<li>QR code generation</li>
<li>Address labeling</li>
</ul>
<h3>AI Receipt Explorer</h3>
<ul>
<li>Computation receipt details</li>
<li>ZK-proof verification</li>
<li>Job metadata and results</li>
<li>Miner rewards tracking</li>
</ul>
</section>
<!-- API Integration -->
<section class="content-section">
<h2>API Integration</h2>
<p>The explorer connects directly to the blockchain node RPC API:</p>
<pre><code>// Get latest blocks
GET /rpc/get_latest_blocks?limit=50
// Get block by height
GET /rpc/get_block/{height}
// Get transaction by hash
GET /rpc/get_transaction/{hash}
// Get address info
GET /rpc/get_address/{address}
// WebSocket subscription
ws://localhost:9081/ws
{
"method": "subscribe",
"params": ["new_blocks", "new_transactions"]
}</code></pre>
</section>
<!-- Deployment -->
<section class="content-section">
<h2>Deployment</h2>
<h3>Docker Deployment</h3>
<pre><code># Build explorer image
docker build -t aitbc/explorer-web .
# Run with nginx
docker run -d \
-p 80:80 \
-e API_URL=http://blockchain-node:9080 \
-e WS_URL=ws://blockchain-node:9081 \
aitbc/explorer-web</code></pre>
<h3>Configuration</h3>
<pre><code># Environment variables
API_URL=http://localhost:9080
WS_URL=ws://localhost:9081
NETWORK_NAME=mainnet
CACHE_TTL=300</code></pre>
</section>
<!-- Development -->
<section class="content-section">
<h2>Development</h2>
<h3>Local Development</h3>
<pre><code># Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Run tests
npm test</code></pre>
<h3>Project Structure</h3>
<pre><code>explorer-web/
├── src/
│ ├── components/ # React components
│ ├── pages/ # Page components
│ ├── hooks/ # Custom hooks
│ ├── services/ # API services
│ └── utils/ # Utilities
├── public/
├── package.json
└── Dockerfile</code></pre>
</section>
</div>
</main>
<footer>
<div class="container">
<p>&copy; 2025 AITBC. All rights reserved.</p>
</div>
</footer>
</body>
</html>

753
website/docs/flowchart.html Normal file
View File

@@ -0,0 +1,753 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>System Flow - AITBC Documentation</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
:root {
--primary-color: #2563eb;
--secondary-color: #1e40af;
--success-color: #10b981;
--warning-color: #f59e0b;
--danger-color: #ef4444;
--text-dark: #1f2937;
--text-light: #6b7280;
--bg-light: #f9fafb;
--bg-white: #ffffff;
--border-color: #e5e7eb;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: var(--text-dark);
background: var(--bg-white);
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
header {
background: var(--text-dark);
color: white;
padding: 1rem 0;
position: sticky;
top: 0;
z-index: 100;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: white;
text-decoration: none;
}
.nav-links {
display: flex;
gap: 2rem;
list-style: none;
margin: 0;
padding: 0;
}
.nav-links a {
color: white;
text-decoration: none;
transition: color 0.3s;
}
.nav-links a:hover {
color: var(--primary-color);
}
.breadcrumb {
padding: 1rem 0;
color: var(--text-light);
font-size: 0.9rem;
}
.breadcrumb a {
color: var(--text-light);
text-decoration: none;
}
.breadcrumb a:hover {
color: var(--primary-color);
}
.doc-header {
padding: 3rem 0;
background: var(--bg-light);
margin-bottom: 2rem;
}
.doc-header h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
color: var(--text-dark);
}
.doc-header p {
font-size: 1.2rem;
color: var(--text-light);
max-width: 800px;
}
.content-section {
margin-bottom: 3rem;
}
.content-section h2 {
font-size: 1.8rem;
margin-bottom: 1.5rem;
color: var(--text-dark);
border-bottom: 2px solid var(--border-color);
padding-bottom: 0.5rem;
}
.content-section h3 {
font-size: 1.4rem;
margin: 2rem 0 1rem;
color: var(--text-dark);
}
.content-section h4 {
font-size: 1.2rem;
margin: 1.5rem 0 0.5rem;
color: var(--text-dark);
}
.content-section p {
margin-bottom: 1rem;
color: var(--text-dark);
}
.content-section ul {
margin-bottom: 1rem;
padding-left: 2rem;
}
.content-section li {
margin-bottom: 0.5rem;
}
pre {
background: #1f2937;
color: #f9fafb;
padding: 1.5rem;
border-radius: 8px;
overflow-x: auto;
margin: 1rem 0;
font-size: 0.9rem;
}
code {
font-family: 'Courier New', Courier, monospace;
}
pre code {
background: none;
padding: 0;
}
.inline-code {
background: var(--bg-light);
padding: 0.2rem 0.4rem;
border-radius: 4px;
font-size: 0.9rem;
}
.back-button {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: var(--primary-color);
text-decoration: none;
margin-bottom: 2rem;
font-weight: 600;
}
.back-button:hover {
color: var(--secondary-color);
}
.flow-diagram {
background: var(--bg-light);
padding: 2rem;
border-radius: 8px;
margin: 2rem 0;
overflow-x: auto;
font-family: monospace;
font-size: 0.9rem;
}
.http-request {
background: #e0f2fe;
border-left: 4px solid var(--primary-color);
padding: 1rem;
margin: 1rem 0;
border-radius: 4px;
}
.http-request h4 {
margin-top: 0;
color: var(--primary-color);
}
.timeline {
background: var(--bg-light);
padding: 1.5rem;
border-radius: 8px;
margin: 2rem 0;
font-family: monospace;
white-space: pre;
line-height: 1.4;
}
table {
width: 100%;
border-collapse: collapse;
margin: 2rem 0;
}
th, td {
padding: 0.75rem;
text-align: left;
border-bottom: 1px solid var(--border-color);
}
th {
background: var(--bg-light);
font-weight: 600;
}
.error-box {
background: #fef2f2;
border: 1px solid #fecaca;
border-radius: 8px;
padding: 1rem;
margin: 1rem 0;
}
.error-box h4 {
color: var(--danger-color);
margin-top: 0;
}
footer {
background: var(--text-dark);
color: white;
padding: 2rem 0;
text-align: center;
margin-top: 4rem;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.doc-header h1 {
font-size: 2rem;
}
}
</style>
</head>
<body>
<header>
<nav class="container">
<a href="../index.html" class="logo">AITBC</a>
<ul class="nav-links">
<li><a href="../index.html">Home</a></li>
<li><a href="index.html">Documentation</a></li>
<li><a href="mailto:aitbc@bubuit.net">Contact</a></li>
</ul>
</nav>
</header>
<main>
<div class="container">
<!-- Breadcrumb -->
<div class="breadcrumb">
<a href="index.html">Documentation</a>
<span></span>
<span>System Flow</span>
</div>
<!-- Back Button -->
<a href="index.html" class="back-button">
<i class="fas fa-arrow-left"></i>
Back to Documentation
</a>
<!-- Header -->
<div class="doc-header">
<h1><i class="fas fa-sitemap"></i> AITBC System Flow</h1>
<p>Complete flow of a job submission through the CLI client, detailing each system component, message, RPC call, and port involved.</p>
</div>
<!-- Overview Diagram -->
<section class="content-section">
<h2>Overview Diagram</h2>
<div style="background: #f8fafc; padding: 2rem; border-radius: 8px; overflow-x: auto;">
<div style="display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; font-family: monospace;">
<div style="background: #3b82f6; color: white; padding: 0.5rem 1rem; border-radius: 4px; white-space: nowrap;">CLI Wrapper</div>
<div style="color: #64748b;"></div>
<div style="background: #10b981; color: white; padding: 0.5rem 1rem; border-radius: 4px; white-space: nowrap;">Client Python</div>
<div style="color: #64748b;"></div>
<div style="background: #f59e0b; color: white; padding: 0.5rem 1rem; border-radius: 4px; white-space: nowrap;">Coordinator</div>
<div style="color: #64748b;"></div>
<div style="background: #ef4444; color: white; padding: 0.5rem 1rem; border-radius: 4px; white-space: nowrap;">Blockchain</div>
<div style="color: #64748b;"></div>
<div style="background: #8b5cf6; color: white; padding: 0.5rem 1rem; border-radius: 4px; white-space: nowrap;">Miner</div>
<div style="color: #64748b;"></div>
<div style="background: #06b6d4; color: white; padding: 0.5rem 1rem; border-radius: 4px; white-space: nowrap;">Ollama</div>
</div>
<div style="font-size: 0.85rem; color: #64748b; text-align: center; margin-top: 1rem;">
<div>(aitbc-cli.sh) → (client.py) → (port 18000) → (RPC:26657) → (port 18001) → (port 11434)</div>
</div>
</div>
<h3 style="margin-top: 2rem;">Component Interactions</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 1.5rem;">
<div style="background: #f1f5f9; padding: 1.5rem; border-radius: 8px; border-left: 4px solid #3b82f6;">
<h4 style="margin-top: 0; color: #1e40af;">1. Job Submission</h4>
<p style="margin-bottom: 0; color: #475569;">User submits CLI command → Python client formats request → HTTP POST to Coordinator</p>
</div>
<div style="background: #f1f5f9; padding: 1.5rem; border-radius: 8px; border-left: 4px solid #f59e0b;">
<h4 style="margin-top: 0; color: #92400e;">2. Job Processing</h4>
<p style="margin-bottom: 0; color: #475569;">Coordinator validates → Creates blockchain transaction → Queues for miner</p>
</div>
<div style="background: #f1f5f9; padding: 1.5rem; border-radius: 8px; border-left: 4px solid #8b5cf6;">
<h4 style="margin-top: 0; color: #5b21b6;">3. AI Inference</h4>
<p style="margin-bottom: 0; color: #475569;">Miner receives job → Sends to Ollama → Processes on GPU → Returns result</p>
</div>
<div style="background: #f1f5f9; padding: 1.5rem; border-radius: 8px; border-left: 4px solid #ef4444;">
<h4 style="margin-top: 0; color: #991b1b;">4. Verification</h4>
<p style="margin-bottom: 0; color: #475569;">Result verified → Receipt generated → Recorded on blockchain → Client notified</p>
</div>
</div>
</section>
<!-- Detailed Flow Sequence -->
<section class="content-section">
<h2>Detailed Flow Sequence</h2>
<h3>1. CLI Wrapper Execution</h3>
<p><strong>User Command:</strong></p>
<pre><code>./scripts/aitbc-cli.sh submit inference --prompt "What is machine learning?" --model llama3.2:latest</code></pre>
<p><strong>Internal Process:</strong></p>
<ol>
<li>Bash script (<span class="inline-code">aitbc-cli.sh</span>) parses arguments</li>
<li>Sets environment variables:
<ul>
<li><span class="inline-code">AITBC_URL=http://127.0.0.1:18000</span></li>
<li><span class="inline-code">CLIENT_KEY=REDACTED_CLIENT_KEY</span></li>
</ul>
</li>
<li>Calls Python client: <span class="inline-code">python3 cli/client.py --url $AITBC_URL --api-key $CLIENT_KEY submit inference --prompt "..."</span></li>
</ol>
<h3>2. Python Client Processing</h3>
<p><strong>File:</strong> <span class="inline-code">/cli/client.py</span></p>
<p><strong>Steps:</strong></p>
<ol>
<li>Parse command-line arguments</li>
<li>Prepare job submission payload:
<pre><code>{
"type": "inference",
"prompt": "What is machine learning?",
"model": "llama3.2:latest",
"client_key": "REDACTED_CLIENT_KEY",
"timestamp": "2025-01-29T14:50:00Z"
}</code></pre>
</li>
</ol>
<h3>3. Coordinator API Call</h3>
<div class="http-request">
<h4>HTTP Request:</h4>
<pre><code>POST /v1/jobs
Host: 127.0.0.1:18000
Content-Type: application/json
X-Api-Key: REDACTED_CLIENT_KEY
{
"type": "inference",
"prompt": "What is machine learning?",
"model": "llama3.2:latest"
}</code></pre>
</div>
<p><strong>Coordinator Service (Port 18000):</strong></p>
<ol>
<li>Receives HTTP request</li>
<li>Validates API key and job parameters</li>
<li>Generates unique job ID: <span class="inline-code">job_123456</span></li>
<li>Creates job record in database</li>
<li>Returns initial response:
<pre><code>{
"job_id": "job_123456",
"status": "pending",
"submitted_at": "2025-01-29T14:50:01Z"
}</code></pre>
</li>
</ol>
<h3>4. Blockchain Transaction</h3>
<p><strong>Coordinator → Blockchain Node (RPC Port 26657):</strong></p>
<ol>
<li>Coordinator creates blockchain transaction:
<pre><code>{
"type": "submit_job",
"job_id": "job_123456",
"client": "REDACTED_CLIENT_KEY",
"payload_hash": "abc123...",
"reward": "100aitbc"
}</code></pre>
</li>
<li>RPC Call to blockchain node:
<pre><code>curl -X POST http://127.0.0.1:26657 \
-d '{
"jsonrpc": "2.0",
"method": "broadcast_tx_sync",
"params": {"tx": "base64_encoded_transaction"}
}'</code></pre>
</li>
<li>Blockchain validates and includes transaction in next block</li>
<li>Transaction hash returned: <span class="inline-code">0xdef456...</span></li>
</ol>
<h3>5. Job Queue and Miner Assignment</h3>
<p><strong>Coordinator Internal Processing:</strong></p>
<ol>
<li>Job added to pending queue (Redis/Database)</li>
<li>Miner selection algorithm runs:
<ul>
<li>Check available miners</li>
<li>Select based on stake, reputation, capacity</li>
</ul>
</li>
<li>Selected miner: <span class="inline-code">REDACTED_MINER_KEY</span></li>
</ol>
<div class="http-request">
<h4>Coordinator → Miner Daemon (Port 18001):</h4>
<pre><code>POST /v1/jobs/assign
Host: 127.0.0.1:18001
Content-Type: application/json
X-Api-Key: REDACTED_ADMIN_KEY
{
"job_id": "job_123456",
"job_data": {
"type": "inference",
"prompt": "What is machine learning?",
"model": "llama3.2:latest"
},
"reward": "100aitbc"
}</code></pre>
</div>
<h3>6. Miner Processing</h3>
<p><strong>Miner Daemon (Port 18001):</strong></p>
<ol>
<li>Receives job assignment</li>
<li>Updates job status to <span class="inline-code">running</span></li>
<li>Notifies coordinator:
<pre><code>POST /v1/jobs/job_123456/status
{"status": "running", "started_at": "2025-01-29T14:50:05Z"}</code></pre>
</li>
</ol>
<h3>7. Ollama Inference Request</h3>
<div class="http-request">
<h4>Miner → Ollama Server (Port 11434):</h4>
<pre><code>POST /api/generate
Host: 127.0.0.1:11434
Content-Type: application/json
{
"model": "llama3.2:latest",
"prompt": "What is machine learning?",
"stream": false,
"options": {
"temperature": 0.7,
"num_predict": 500
}
}</code></pre>
</div>
<p><strong>Ollama Processing:</strong></p>
<ol>
<li>Loads model into GPU memory</li>
<li>Processes prompt through neural network</li>
<li>Generates response text</li>
<li>Returns result:
<pre><code>{
"model": "llama3.2:latest",
"response": "Machine learning is a subset of artificial intelligence...",
"done": true,
"total_duration": 12500000000,
"prompt_eval_count": 15,
"eval_count": 150
}</code></pre>
</li>
</ol>
<h3>8. Result Submission to Coordinator</h3>
<div class="http-request">
<h4>Miner → Coordinator (Port 18000):</h4>
<pre><code>POST /v1/jobs/job_123456/complete
Host: 127.0.0.1:18000
Content-Type: application/json
X-Miner-Key: REDACTED_MINER_KEY
{
"job_id": "job_123456",
"result": "Machine learning is a subset of artificial intelligence...",
"metrics": {
"compute_time": 12.5,
"tokens_generated": 150,
"gpu_utilization": 0.85
},
"proof": {
"hash": "hash_of_result",
"signature": "miner_signature"
}
}</code></pre>
</div>
<h3>9. Receipt Generation</h3>
<p><strong>Coordinator Processing:</strong></p>
<ol>
<li>Verifies miner's proof</li>
<li>Calculates payment: <span class="inline-code">12.5 seconds × 0.02 AITBC/second = 0.25 AITBC</span></li>
<li>Creates receipt:
<pre><code>{
"receipt_id": "receipt_789",
"job_id": "job_123456",
"client": "REDACTED_CLIENT_KEY",
"miner": "REDACTED_MINER_KEY",
"amount_paid": "0.25aitbc",
"result_hash": "hash_of_result",
"block_height": 12345,
"timestamp": "2025-01-29T14:50:18Z"
}</code></pre>
</li>
</ol>
<h3>10. Blockchain Receipt Recording</h3>
<pre><code>Coordinator → Blockchain (RPC Port 26657):
{
"type": "record_receipt",
"receipt": {
"receipt_id": "receipt_789",
"job_id": "job_123456",
"payment": "0.25aitbc"
}
}</code></pre>
<h3>11. Client Polling for Result</h3>
<p><strong>CLI Client Status Check:</strong></p>
<pre><code>./scripts/aitbc-cli.sh status job_123456</code></pre>
<div class="http-request">
<h4>HTTP Request:</h4>
<pre><code>GET /v1/jobs/job_123456
Host: 127.0.0.1:18000
X-Api-Key: REDACTED_CLIENT_KEY</code></pre>
<h4>Response:</h4>
<pre><code>{
"job_id": "job_123456",
"status": "completed",
"result": "Machine learning is a subset of artificial intelligence...",
"receipt_id": "receipt_789",
"completed_at": "2025-01-29T14:50:18Z"
}</code></pre>
</div>
<h3>12. Final Output to User</h3>
<p><strong>CLI displays:</strong></p>
<pre><code>Job ID: job_123456
Status: completed
Result: Machine learning is a subset of artificial intelligence...
Receipt: receipt_789
Completed in: 17 seconds
Cost: 0.25 AITBC</code></pre>
</section>
<!-- System Components Summary -->
<section class="content-section">
<h2>System Components Summary</h2>
<table>
<thead>
<tr>
<th>Component</th>
<th>Port</th>
<th>Protocol</th>
<th>Responsibility</th>
</tr>
</thead>
<tbody>
<tr>
<td>CLI Wrapper</td>
<td>N/A</td>
<td>Bash</td>
<td>User interface, argument parsing</td>
</tr>
<tr>
<td>Client Python</td>
<td>N/A</td>
<td>Python</td>
<td>HTTP client, job formatting</td>
</tr>
<tr>
<td>Coordinator</td>
<td>18000</td>
<td>HTTP/REST</td>
<td>Job management, API gateway</td>
</tr>
<tr>
<td>Blockchain Node</td>
<td>26657</td>
<td>JSON-RPC</td>
<td>Transaction processing, consensus</td>
</tr>
<tr>
<td>Miner Daemon</td>
<td>18001</td>
<td>HTTP/REST</td>
<td>Job execution, GPU management</td>
</tr>
<tr>
<td>Ollama Server</td>
<td>11434</td>
<td>HTTP/REST</td>
<td>AI model inference</td>
</tr>
</tbody>
</table>
</section>
<!-- Message Flow Timeline -->
<section class="content-section">
<h2>Message Flow Timeline</h2>
<div class="timeline">0s: User submits CLI command
└─> 0.1s: Python client called
└─> 0.2s: HTTP POST to Coordinator (port 18000)
└─> 0.3s: Coordinator validates and creates job
└─> 0.4s: RPC to Blockchain (port 26657)
└─> 0.5s: Transaction in mempool
└─> 1.0s: Job queued for miner
└─> 2.0s: Miner assigned (port 18001)
└─> 2.1s: Miner accepts job
└─> 2.2s: Ollama request (port 11434)
└─> 14.7s: Inference complete (12.5s processing)
└─> 14.8s: Result to Coordinator
└─> 15.0s: Receipt generated
└─> 15.1s: Receipt on Blockchain
└─> 17.0s: Client polls and gets result</div>
</section>
<!-- Error Handling Paths -->
<section class="content-section">
<h2>Error Handling Paths</h2>
<div class="error-box">
<h4>1. Invalid Prompt</h4>
<ul>
<li>Coordinator returns 400 error</li>
<li>CLI displays error message</li>
</ul>
</div>
<div class="error-box">
<h4>2. Miner Unavailable</h4>
<ul>
<li>Job stays in queue</li>
<li>Timeout after 60 seconds</li>
<li>Job marked as failed</li>
</ul>
</div>
<div class="error-box">
<h4>3. Ollama Error</h4>
<ul>
<li>Miner reports failure to Coordinator</li>
<li>Job marked as failed</li>
<li>No payment deducted</li>
</ul>
</div>
<div class="error-box">
<h4>4. Network Issues</h4>
<ul>
<li>Client retries with exponential backoff</li>
<li>Maximum 3 retries before giving up</li>
</ul>
</div>
</section>
<!-- Security Considerations -->
<section class="content-section">
<h2>Security Considerations</h2>
<ul>
<li><strong>API Keys</strong>: Each request authenticated with X-Api-Key header</li>
<li><strong>Proof of Work</strong>: Miner provides cryptographic proof of computation</li>
<li><strong>Payment Escrow</strong>: Tokens held in smart contract until completion</li>
<li><strong>Rate Limiting</strong>: Coordinator limits requests per client</li>
</ul>
</section>
<!-- Additional Resources -->
<section class="content-section">
<h2>Related Documentation</h2>
<ul>
<li><a href="coordinator-api.html">Coordinator API Documentation</a> - Detailed API reference for the coordinator service</li>
<li><a href="blockchain-node.html">Blockchain Node Documentation</a> - Learn about the blockchain node and RPC API</li>
<li><a href="miner-documentation-md.html">Miner Documentation</a> - Guide to setting up and running a miner</li>
<li><a href="client-documentation-md.html">Client Documentation</a> - Using the CLI and Python client</li>
<li><a href="components.html">System Components</a> - Overview of all AITBC components</li>
<li><a href="full-documentation.html">Full Documentation</a> - Complete technical documentation</li>
</ul>
</section>
<!-- Monitoring Points -->
<section class="content-section">
<h2>Monitoring Points</h2>
<ul>
<li>Coordinator logs all API calls to <span class="inline-code">/var/log/aitbc/coordinator.log</span></li>
<li>Miner logs GPU utilization to <span class="inline-code">/var/log/aitbc/miner.log</span></li>
<li>Blockchain logs all transactions to <span class="inline-code">/var/log/aitbc/node.log</span></li>
<li>Prometheus metrics available at <span class="inline-code">http://localhost:9090/metrics</span></li>
</ul>
</section>
</div>
</main>
<footer>
<div class="container">
<p>&copy; 2025 AITBC. All rights reserved.</p>
</div>
</footer>
</body>
</html>

View File

@@ -0,0 +1,643 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Full Documentation - AITBC</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
:root {
--primary-color: #2563eb;
--secondary-color: #1e40af;
--success-color: #10b981;
--warning-color: #f59e0b;
--danger-color: #ef4444;
--text-dark: #1f2937;
--text-light: #6b7280;
--bg-light: #f9fafb;
--bg-white: #ffffff;
--border-color: #e5e7eb;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: var(--text-dark);
background: var(--bg-white);
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
header {
background: var(--text-dark);
color: white;
padding: 1rem 0;
position: sticky;
top: 0;
z-index: 100;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: white;
text-decoration: none;
}
.nav-links {
display: flex;
gap: 2rem;
list-style: none;
margin: 0;
padding: 0;
}
.nav-links a {
color: white;
text-decoration: none;
transition: color 0.3s;
}
.nav-links a:hover {
color: var(--primary-color);
}
.breadcrumb {
padding: 1rem 0;
color: var(--text-light);
font-size: 0.9rem;
}
.breadcrumb a {
color: var(--text-light);
text-decoration: none;
}
.breadcrumb a:hover {
color: var(--primary-color);
}
.doc-header {
padding: 3rem 0;
background: var(--bg-light);
margin-bottom: 2rem;
}
.doc-header h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
color: var(--text-dark);
}
.doc-header p {
font-size: 1.2rem;
color: var(--text-light);
max-width: 800px;
}
.content-section {
margin-bottom: 3rem;
}
.content-section h2 {
font-size: 1.8rem;
margin-bottom: 1.5rem;
color: var(--text-dark);
border-bottom: 2px solid var(--border-color);
padding-bottom: 0.5rem;
}
.content-section h3 {
font-size: 1.4rem;
margin: 2rem 0 1rem;
color: var(--text-dark);
}
.content-section h4 {
font-size: 1.2rem;
margin: 1.5rem 0 0.5rem;
color: var(--text-dark);
}
.content-section p {
margin-bottom: 1rem;
color: var(--text-dark);
}
.content-section ul {
margin-bottom: 1rem;
padding-left: 2rem;
}
.content-section li {
margin-bottom: 0.5rem;
}
.toc {
background: var(--bg-light);
padding: 2rem;
border-radius: 8px;
margin-bottom: 3rem;
}
.toc h3 {
margin-top: 0;
color: var(--text-dark);
}
.toc ul {
list-style: none;
padding-left: 0;
}
.toc li {
margin-bottom: 0.5rem;
}
.toc a {
color: var(--primary-color);
text-decoration: none;
}
.toc a:hover {
text-decoration: underline;
}
.component-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
margin: 2rem 0;
}
.component-card {
background: var(--bg-white);
padding: 2rem;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.component-card h3 {
margin-top: 0;
color: var(--primary-color);
}
pre {
background: #1f2937;
color: #f9fafb;
padding: 1.5rem;
border-radius: 8px;
overflow-x: auto;
margin: 1rem 0;
}
code {
font-family: 'Courier New', Courier, monospace;
font-size: 0.9rem;
}
pre code {
background: none;
padding: 0;
}
.inline-code {
background: var(--bg-light);
padding: 0.2rem 0.4rem;
border-radius: 4px;
font-size: 0.9rem;
}
.back-button {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: var(--primary-color);
text-decoration: none;
margin-bottom: 2rem;
font-weight: 600;
}
.back-button:hover {
color: var(--secondary-color);
}
.alert {
padding: 1rem;
border-radius: 8px;
margin: 1rem 0;
}
.alert-info {
background: #dbeafe;
border-left: 4px solid var(--primary-color);
color: #1e40af;
}
.alert-warning {
background: #fef3c7;
border-left: 4px solid var(--warning-color);
color: #92400e;
}
.alert-success {
background: #d1fae5;
border-left: 4px solid var(--success-color);
color: #065f46;
}
footer {
background: var(--text-dark);
color: white;
padding: 2rem 0;
text-align: center;
margin-top: 4rem;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.doc-header h1 {
font-size: 2rem;
}
}
</style>
</head>
<body>
<header>
<nav class="container">
<a href="../index.html" class="logo">AITBC</a>
<ul class="nav-links">
<li><a href="../index.html">Home</a></li>
<li><a href="index.html">Documentation</a></li>
<li><a href="mailto:aitbc@bubuit.net">Contact</a></li>
</ul>
</nav>
</header>
<main>
<div class="container">
<!-- Breadcrumb -->
<div class="breadcrumb">
<a href="index.html">Documentation</a>
<span></span>
<span>Full Documentation</span>
</div>
<!-- Back Button -->
<a href="index.html" class="back-button">
<i class="fas fa-arrow-left"></i>
Back to Documentation
</a>
<!-- Header -->
<div class="doc-header">
<h1><i class="fas fa-file-alt"></i> AITBC Full Documentation</h1>
<p>Complete technical documentation for the AI Training & Blockchain Computing platform</p>
</div>
<!-- Table of Contents -->
<div class="toc">
<h3>Table of Contents</h3>
<ul>
<li><a href="#introduction">1. Introduction</a></li>
<li><a href="#architecture">2. Architecture</a></li>
<li><a href="#installation">3. Installation</a></li>
<li><a href="#apis">4. APIs</a></li>
<li><a href="#components">5. Components</a></li>
<li><a href="#guides">6. Guides</a></li>
<li><a href="#advanced">7. Advanced Topics</a></li>
<li><a href="#troubleshooting">8. Troubleshooting</a></li>
<li><a href="#security">9. Security</a></li>
</ul>
</div>
<!-- Introduction -->
<section class="content-section" id="introduction">
<h2>1. Introduction</h2>
<p>AITBC (AI Training & Blockchain Computing) is a decentralized platform that combines blockchain technology with AI/ML computing resources. It enables privacy-preserving AI computations with verifiable results on the blockchain.</p>
<h3>Key Features</h3>
<ul>
<li>Privacy-preserving AI computations with zero-knowledge proofs</li>
<li>Decentralized GPU marketplace for AI/ML workloads</li>
<li>Blockchain-based verification and receipt system</li>
<li>Hybrid Proof-of-Authority/Proof-of-Stake consensus</li>
<li>Native token (AITBC) for payments and staking</li>
</ul>
<h3>Use Cases</h3>
<ul>
<li>Private AI inference without data exposure</li>
<li>Verifiable ML model training</li>
<li>Decentralized GPU resource sharing</li>
<li>Cryptographic proof of computation</li>
</ul>
</section>
<!-- Architecture -->
<section class="content-section" id="architecture">
<h2>2. Architecture</h2>
<p>AITBC consists of multiple components working together to provide a complete AI blockchain computing solution.</p>
<h3>System Architecture</h3>
<pre><code>┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Clients │────▶│ Coordinator │────▶│ Blockchain │
│ │ │ API │ │ Node │
└─────────────┘ └──────────────┘ └─────────────┘
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Wallet │ │ Pool Hub │ │ Miners │
│ Daemon │ │ │ │ │
└─────────────┘ └──────────────┘ └─────────────┘</code></pre>
<h3>Core Components</h3>
<ul>
<li><strong>Blockchain Node</strong>: Distributed ledger with PoA/PoS consensus</li>
<li><strong>Coordinator API</strong>: Job orchestration and management</li>
<li><strong>Wallet Daemon</strong>: Secure wallet management</li>
<li><strong>Miner Daemon</strong>: GPU compute provider</li>
<li><strong>Pool Hub</strong>: Miner coordination and matching</li>
<li><strong>Marketplace Web</strong>: GPU compute marketplace UI</li>
<li><strong>Trade Exchange</strong>: Token trading platform</li>
</ul>
</section>
<!-- Installation -->
<section class="content-section" id="installation">
<h2>3. Installation</h2>
<h3>Prerequisites</h3>
<ul>
<li>Docker & Docker Compose</li>
<li>Python 3.9+ (for development)</li>
<li>Node.js 18+ (for frontend development)</li>
<li>Rust 1.70+ (for blockchain node)</li>
</ul>
<h3>Quick Start with Docker</h3>
<pre><code># Clone the repository
git clone https://gitea.bubuit.net/oib/aitbc.git
cd aitbc
# Start all services
docker-compose up -d
# Check status
docker-compose ps</code></pre>
<h3>Development Setup</h3>
<pre><code># Backend services
cd coordinator
pip install -r requirements.txt
python -m coordinator.main
# Frontend
cd website/marketplace
npm install
npm run dev
# Blockchain node
cd blockchain
cargo run</code></pre>
</section>
<!-- APIs -->
<section class="content-section" id="apis">
<h2>4. APIs</h2>
<h3>Coordinator API</h3>
<p>RESTful API for job submission and management</p>
<pre><code># Submit a job
POST /api/v1/jobs
{
"type": "inference",
"model": "llama3.2",
"input": {
"prompt": "Hello, AITBC!"
}
}
# Get job status
GET /api/v1/jobs/{job_id}
# Get job result
GET /api/v1/jobs/{job_id}/result</code></pre>
<h3>Blockchain RPC</h3>
<p>JSON-RPC API for blockchain interaction</p>
<pre><code># Get latest block
curl -X POST http://localhost:9080 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"get_head","params":[],"id":1}'
# Submit transaction
curl -X POST http://localhost:9080 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"send_tx","params":[tx],"id":1}'</code></pre>
<h3>WebSocket API</h3>
<p>Real-time updates for blocks, transactions, and jobs</p>
<pre><code># Connect to WebSocket
ws://localhost:9081/ws
# Subscribe to events
{
"method": "subscribe",
"params": ["new_blocks", "job_updates"]
}</code></pre>
</section>
<!-- Components -->
<section class="content-section" id="components">
<h2>5. Components</h2>
<div class="component-grid">
<div class="component-card">
<h3>Blockchain Node</h3>
<p>PoA/PoS consensus blockchain with REST/WebSocket RPC, real-time gossip layer, and comprehensive observability.</p>
<a href="blockchain-node-md.html" style="color: var(--primary-color);">Learn more →</a>
</div>
<div class="component-card">
<h3>Coordinator API</h3>
<p>FastAPI service for job submission, miner registration, and receipt management with SQLite persistence.</p>
<a href="coordinator-api-md.html" style="color: var(--primary-color);">Learn more →</a>
</div>
<div class="component-card">
<h3>Marketplace Web</h3>
<p>Vite/TypeScript marketplace with offer/bid functionality, stats dashboard, and mock/live data toggle.</p>
<a href="marketplace-web-md.html" style="color: var(--primary-color);">Learn more →</a>
</div>
<div class="component-card">
<h3>Wallet Daemon</h3>
<p>Encrypted keystore with Argon2id + XChaCha20-Poly1305, REST/JSON-RPC APIs, and receipt verification.</p>
<a href="wallet-documentation-md.html" style="color: var(--primary-color);">Learn more →</a>
</div>
<div class="component-card">
<h3>Trade Exchange</h3>
<p>Bitcoin-to-AITBC exchange with QR payments, user management, and real-time trading capabilities.</p>
<a href="trade-exchange-md.html" style="color: var(--primary-color);">Learn more →</a>
</div>
<div class="component-card">
<h3>Pool Hub</h3>
<p>Miner registry with scoring engine, Redis/PostgreSQL backing, and comprehensive metrics.</p>
<a href="pool-hub.html" style="color: var(--primary-color);">Learn more →</a>
</div>
</div>
</section>
<!-- Guides -->
<section class="content-section" id="guides">
<h2>6. Guides</h2>
<h3>Client Guide</h3>
<p>Learn how to use AITBC as a client:</p>
<ul>
<li><a href="client-documentation-md.html">Client Documentation</a></li>
<li>Job submission workflow</li>
<li>Privacy features</li>
<li>Result verification</li>
</ul>
<h3>Miner Guide</h3>
<p>Learn how to become a miner:</p>
<ul>
<li><a href="miner-documentation-md.html">Miner Documentation</a></li>
<li>Hardware requirements</li>
<li>Setup and configuration</li>
<li>Earning rewards</li>
</ul>
<h3>Developer Guide</h3>
<p>Learn how to build on AITBC:</p>
<ul>
<li><a href="developer-documentation-md.html">Developer Documentation</a></li>
<li>API integration</li>
<li>SDK usage</li>
<li>Contributing</li>
</ul>
</section>
<!-- Advanced Topics -->
<section class="content-section" id="advanced">
<h2>7. Advanced Topics</h2>
<h3>Zero-Knowledge Proofs</h3>
<p>AITBC uses zk-SNARKs to provide privacy-preserving computations:</p>
<ul>
<li>Input privacy: Your data never leaves your device</li>
<li>Computation verification: Proofs are verified on-chain</li>
<li>Efficient verification: Sub-second proof verification</li>
</ul>
<h3>Consensus Mechanism</h3>
<p>Hybrid PoA/PoS consensus provides:</p>
<ul>
<li>Fast finality: Blocks confirmed in seconds</li>
<li>Energy efficiency: No proof-of-work mining</li>
<li>Security: Multi-layer validation</li>
</ul>
<h3>Tokenomics</h3>
<p>AITBC token utilities:</p>
<ul>
<li>Payment for AI computations</li>
<li>Staking for network security</li>
<li>Governance voting rights</li>
<li>Reward distribution</li>
</ul>
</section>
<!-- Troubleshooting -->
<section class="content-section" id="troubleshooting">
<h2>8. Troubleshooting</h2>
<h3>Common Issues</h3>
<div class="alert alert-warning">
<strong>Node not syncing?</strong> Check peer connections and network connectivity.
</div>
<ol>
<li><strong>Connection Issues</strong>
<ul>
<li>Verify all services are running: <code>docker-compose ps</code></li>
<li>Check logs: <code>docker-compose logs [service]</code></li>
<li>Ensure ports are not blocked by firewall</li>
</ul>
</li>
<li><strong>Job Submission Fails</strong>
<ul>
<li>Check API key is valid</li>
<li>Verify model is available</li>
<li>Check wallet balance</li>
</ul>
</li>
<li><strong>GPU Mining Issues</strong>
<ul>
<li>Install latest NVIDIA drivers</li>
<li>Verify CUDA installation</li>
<li>Check GPU memory availability</li>
</ul>
</li>
</ol>
</section>
<!-- Security -->
<section class="content-section" id="security">
<h2>9. Security</h2>
<h3>Security Features</h3>
<ul>
<li>End-to-end encryption for all data</li>
<li>Zero-knowledge proofs for privacy</li>
<li>Multi-signature wallet support</li>
<li>Hardware wallet integration</li>
<li>Audited smart contracts</li>
</ul>
<h3>Best Practices</h3>
<ul>
<li>Keep private keys secure</li>
<li>Use hardware wallets for large amounts</li>
<li>Enable two-factor authentication</li>
<li>Regular security updates</li>
</ul>
<h3>Reporting Issues</h3>
<div class="alert alert-info">
For security issues, please email: <a href="mailto:aitbc@bubuit.net">aitbc@bubuit.net</a>
</div>
</section>
</div>
</main>
<footer>
<div class="container">
<p>&copy; 2025 AITBC. All rights reserved.</p>
</div>
</footer>
</body>
</html>

View File

@@ -471,10 +471,6 @@
<main>
<div class="container">
<div class="doc-header">
<div class="alert alert-info" style="background: #dbeafe; border-color: #3b82f6; color: #1e40af; margin-bottom: 2rem; padding: 1rem; border-radius: 8px;">
<strong>📚 Also available in Markdown:</strong>
<a href="https://gitea.bubuit.net/oib/aitbc/src/branch/main/docs/full-documentation.md" target="_blank" style="color: #1e40af; text-decoration: underline;">View this documentation in markdown format</a> for easier contribution and version control.
</div>
<h1>AITBC Full Documentation</h1>
<p>Complete technical documentation for the AI Training & Blockchain Computing platform</p>

View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/docs.css">
<title>Documentation - AITBC</title>
<link rel="stylesheet" href="/fonts-font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<!-- Header -->
@@ -42,7 +42,7 @@
<!-- Search Bar -->
<div class="search-container">
<input type="text" class="search-bar" placeholder="Search documentation..." id="searchInput">
<i class="fas fa-search search-icon"></i>
<i class="fa fa-search search-icon"></i>
</div>
<!-- Reader Level Cards -->
@@ -50,7 +50,7 @@
<!-- Miners Card -->
<div class="reader-card miner">
<div class="reader-icon">
<i class="fas fa-hammer"></i>
<i class="fa fa-hammer"></i>
</div>
<h3>Miners</h3>
<p>Learn how to mine AITBC tokens and contribute to network security. Perfect for those looking to earn rewards through staking or providing compute power.</p>
@@ -101,7 +101,7 @@
<!-- Full Documentation Card -->
<div class="reader-card full-doc">
<div class="reader-icon">
<i class="fas fa-file-alt"></i>
<i class="fa fa-file-alt"></i>
</div>
<h3>Full Documentation</h3>
<p>Complete technical documentation covering all aspects of the AITBC platform including architecture, APIs, deployment, and advanced features.</p>
@@ -114,6 +114,42 @@
</ul>
<a href="full-documentation.html" class="btn">View Full Documentation</a>
</div>
<!-- Components Card -->
<div class="reader-card components">
<div class="reader-icon">
<i class="fa fa-cube"></i>
</div>
<h3>System Components</h3>
<p>Explore the 7 core components that make up the AITBC platform. Understand how each part works together to create a complete AI blockchain computing solution.</p>
<ul class="reader-features">
<li>Blockchain Node with PoA/PoS consensus</li>
<li>Coordinator API for job orchestration</li>
<li>Wallet Daemon for secure key management</li>
<li>Miner Daemon for GPU compute</li>
<li>Marketplace Web for compute trading</li>
<li>Explorer Web for blockchain viewing</li>
<li>Pool Hub for miner coordination</li>
</ul>
<a href="components.html" class="btn">View Components</a>
</div>
<!-- System Flow Card -->
<div class="reader-card flow">
<div class="reader-icon">
<i class="fa fa-sitemap"></i>
</div>
<h3>System Flow</h3>
<p>Visualize the complete flow of a job submission through the CLI client, detailing each system component, message, RPC call, and port involved.</p>
<ul class="reader-features">
<li>End-to-end job submission flow</li>
<li>Component interaction diagrams</li>
<li>API call sequences</li>
<li>Error handling paths</li>
<li>Performance monitoring points</li>
</ul>
<a href="flowchart.html" class="btn">View System Flow</a>
</div>
</div>
<!-- Quick Links -->
@@ -124,7 +160,7 @@
<i class="fa fa-book"></i>
<span>Full Documentation</span>
</a>
<a href="https://gitea.bubuit.net/oib/aitbc/src/branch/main/docs" class="link-item" target="_blank">
<a href="https://gitea.bubuit.net/oib/aitbc/src/branch/master/docs" class="link-item" target="_blank">
<i class="fa fa-file-alt"></i>
<span>Markdown Docs</span>
</a>
@@ -144,51 +180,7 @@
<i class="fa fa-envelope"></i>
<span>Support</span>
</a>
<a href="#" class="link-item">
<i class="fa fa-graduation-cap"></i>
<span>Tutorials</span>
</a>
<a href="#" class="link-item">
<i class="fa fa-video-camera"></i>
<span>Video Guides</span>
</a>
</div>
</section>
<!-- Markdown Documentation Notice -->
<section class="help-section" style="background: #f0f9ff; border: 2px solid #0ea5e9; border-radius: 15px; margin-top: 3rem;">
<h2 style="color: #0c4a6e;">📚 Documentation Formats</h2>
<p style="color: #0c4a6e;">Choose your preferred documentation format:</p>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.5rem;">
<a href="client-documentation.html" class="btn" style="background: #0ea5e9; color: white; text-decoration: none; padding: 0.75rem 1.5rem; border-radius: 8px; display: inline-block; text-align: center;">
<i class="fa fa-users"></i> Client Docs (HTML)
</a>
<a href="client-documentation-md.html" class="btn" style="background: #10b981; color: white; text-decoration: none; padding: 0.75rem 1.5rem; border-radius: 8px; display: inline-block; text-align: center;">
<i class="fa fa-users"></i> Client Docs (Web)
</a>
<a href="docs-miners.html" class="btn" style="background: #0ea5e9; color: white; text-decoration: none; padding: 0.75rem 1.5rem; border-radius: 8px; display: inline-block; text-align: center;">
<i class="fa fa-hammer"></i> Miner Docs (HTML)
</a>
<a href="miner-documentation-md.html" class="btn" style="background: #10b981; color: white; text-decoration: none; padding: 0.75rem 1.5rem; border-radius: 8px; display: inline-block; text-align: center;">
<i class="fa fa-hammer"></i> Miner Docs (Web)
</a>
<a href="docs-developers.html" class="btn" style="background: #0ea5e9; color: white; text-decoration: none; padding: 0.75rem 1.5rem; border-radius: 8px; display: inline-block; text-align: center;">
<i class="fa fa-code"></i> Developer Docs (HTML)
</a>
<a href="developer-documentation-md.html" class="btn" style="background: #10b981; color: white; text-decoration: none; padding: 0.75rem 1.5rem; border-radius: 8px; display: inline-block; text-align: center;">
<i class="fa fa-code"></i> Developer Docs (Web)
</a>
<a href="components.html" class="btn" style="background: #0ea5e9; color: white; text-decoration: none; padding: 0.75rem 1.5rem; border-radius: 8px; display: inline-block; text-align: center;">
<i class="fa fa-cube"></i> Components (HTML)
</a>
<a href="components-md.html" class="btn" style="background: #10b981; color: white; text-decoration: none; padding: 0.75rem 1.5rem; border-radius: 8px; display: inline-block; text-align: center;">
<i class="fa fa-cube"></i> Components (Web)
</a>
</div>
<p style="color: #0c4a6e; margin-top: 1rem; font-size: 0.9rem;">
<strong>HTML:</strong> Original documentation with interactive features |
<strong>Web:</strong> Clean, fast-loading web format
</p>
</div>
</section>
<!-- Help Section -->

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,585 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Miner Documentation - AITBC</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
:root {
--primary-color: #2563eb;
--secondary-color: #1e40af;
--success-color: #10b981;
--warning-color: #f59e0b;
--danger-color: #ef4444;
--text-dark: #1f2937;
--text-light: #6b7280;
--bg-light: #f9fafb;
--bg-white: #ffffff;
--border-color: #e5e7eb;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: var(--text-dark);
background: var(--bg-white);
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
header {
background: var(--text-dark);
color: white;
padding: 1rem 0;
position: sticky;
top: 0;
z-index: 100;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: white;
text-decoration: none;
}
.nav-links {
display: flex;
gap: 2rem;
list-style: none;
margin: 0;
padding: 0;
}
.nav-links a {
color: white;
text-decoration: none;
transition: color 0.3s;
}
.nav-links a:hover {
color: var(--primary-color);
}
.breadcrumb {
padding: 1rem 0;
color: var(--text-light);
font-size: 0.9rem;
}
.breadcrumb a {
color: var(--text-light);
text-decoration: none;
}
.breadcrumb a:hover {
color: var(--primary-color);
}
.doc-header {
padding: 3rem 0;
background: var(--bg-light);
margin-bottom: 2rem;
}
.doc-header h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
color: var(--text-dark);
}
.doc-header p {
font-size: 1.2rem;
color: var(--text-light);
max-width: 800px;
}
.content-section {
margin-bottom: 3rem;
}
.content-section h2 {
font-size: 1.8rem;
margin-bottom: 1.5rem;
color: var(--text-dark);
border-bottom: 2px solid var(--border-color);
padding-bottom: 0.5rem;
}
.content-section h3 {
font-size: 1.4rem;
margin: 2rem 0 1rem;
color: var(--text-dark);
}
.content-section h4 {
font-size: 1.2rem;
margin: 1.5rem 0 0.5rem;
color: var(--text-dark);
}
.content-section p {
margin-bottom: 1rem;
color: var(--text-dark);
}
.content-section ul {
margin-bottom: 1rem;
padding-left: 2rem;
}
.content-section li {
margin-bottom: 0.5rem;
}
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
}
.feature-card {
background: var(--bg-white);
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.feature-card h4 {
margin-top: 0;
color: var(--primary-color);
}
.requirements-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
margin: 2rem 0;
}
.requirement-card {
background: var(--bg-light);
padding: 1.5rem;
border-radius: 8px;
text-align: center;
}
.requirement-card h4 {
margin-top: 0;
color: var(--primary-color);
}
pre {
background: #1f2937;
color: #f9fafb;
padding: 1.5rem;
border-radius: 8px;
overflow-x: auto;
margin: 1rem 0;
}
code {
font-family: 'Courier New', Courier, monospace;
font-size: 0.9rem;
}
pre code {
background: none;
padding: 0;
}
.inline-code {
background: var(--bg-light);
padding: 0.2rem 0.4rem;
border-radius: 4px;
font-size: 0.9rem;
}
.back-button {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: var(--primary-color);
text-decoration: none;
margin-bottom: 2rem;
font-weight: 600;
}
.back-button:hover {
color: var(--secondary-color);
}
.alert {
padding: 1rem;
border-radius: 8px;
margin: 1rem 0;
}
.alert-info {
background: #dbeafe;
border-left: 4px solid var(--primary-color);
color: #1e40af;
}
.alert-warning {
background: #fef3c7;
border-left: 4px solid var(--warning-color);
color: #92400e;
}
.alert-success {
background: #d1fae5;
border-left: 4px solid var(--success-color);
color: #065f46;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
}
.stat-card {
background: var(--bg-white);
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
text-align: center;
}
.stat-value {
font-size: 2rem;
font-weight: bold;
color: var(--primary-color);
}
.stat-label {
color: var(--text-light);
margin-top: 0.5rem;
}
footer {
background: var(--text-dark);
color: white;
padding: 2rem 0;
text-align: center;
margin-top: 4rem;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.doc-header h1 {
font-size: 2rem;
}
}
</style>
</head>
<body>
<header>
<nav class="container">
<a href="../index.html" class="logo">AITBC</a>
<ul class="nav-links">
<li><a href="../index.html">Home</a></li>
<li><a href="index.html">Documentation</a></li>
<li><a href="mailto:aitbc@bubuit.net">Contact</a></li>
</ul>
</nav>
</header>
<main>
<div class="container">
<!-- Breadcrumb -->
<div class="breadcrumb">
<a href="index.html">Documentation</a>
<span></span>
<span>Miner Documentation</span>
</div>
<!-- Back Button -->
<a href="index.html" class="back-button">
<i class="fas fa-arrow-left"></i>
Back to Documentation
</a>
<!-- Header -->
<div class="doc-header">
<h1><i class="fas fa-hammer"></i> Miner Documentation</h1>
<p>Learn how to mine AITBC tokens and contribute to network security. Perfect for those looking to earn rewards through staking or providing compute power.</p>
</div>
<!-- Mining Stats -->
<div class="stats-grid">
<div class="stat-card">
<div class="stat-value">100K+</div>
<div class="stat-label">AITBC Staked</div>
</div>
<div class="stat-card">
<div class="stat-value">30+</div>
<div class="stat-label">Active Miners</div>
</div>
<div class="stat-card">
<div class="stat-value">0.02</div>
<div class="stat-label">AITBC/GPU Second</div>
</div>
<div class="stat-card">
<div class="stat-value">Low</div>
<div class="stat-label">Hardware Requirements</div>
</div>
</div>
<!-- Getting Started -->
<section class="content-section">
<h2>Getting Started</h2>
<p>AITBC mining combines Proof of Authority and Proof of Stake, offering multiple ways to participate and earn rewards.</p>
<h3>Mining Options</h3>
<ul>
<li><strong>Authority Mining</strong>: Become a trusted authority node (invitation only)</li>
<li><strong>Stake Mining</strong>: Stake AITBC tokens and earn rewards</li>
<li><strong>GPU Mining</strong>: ✅ OPERATIONAL - Provide compute power for AI/ML workloads via Ollama (RTX 4060 Ti tested)</li>
<li><strong>Hybrid Mining</strong>: Combine staking with compute provision</li>
</ul>
<h3>Requirements</h3>
<div class="requirements-grid">
<div class="requirement-card">
<h4><i class="fas fa-coins"></i> Minimum Stake</h4>
<p>10,000 AITBC tokens</p>
</div>
<div class="requirement-card">
<h4><i class="fas fa-microchip"></i> CPU</h4>
<p>4+ cores (8+ recommended for GPU mining)</p>
</div>
<div class="requirement-card">
<h4><i class="fas fa-memory"></i> RAM</h4>
<p>8GB minimum (16GB+ for GPU mining)</p>
</div>
<div class="requirement-card">
<h4><i class="fas fa-hdd"></i> Storage</h4>
<p>100GB SSD (500GB+ for full node)</p>
</div>
<div class="requirement-card">
<h4><i class="fas fa-network-wired"></i> Network</h4>
<p>Stable broadband (100Mbps+)</p>
</div>
<div class="requirement-card">
<h4><i class="fas fa-rocket"></i> GPU (Optional)</h4>
<p><strong>✅ Tested:</strong> NVIDIA RTX 4060 Ti (16GB)</p>
</div>
</div>
</section>
<!-- Quick Start -->
<section class="content-section">
<h2>Quick Start</h2>
<h3>1. Download & Install</h3>
<p>Get the AITBC mining software for your platform</p>
<pre><code># Linux/macOS
curl -O https://gitea.bubuit.net/oib/aitbc/releases/download/latest/aitbc-miner-linux-amd64.tar.gz
tar -xzf aitbc-miner-linux-amd64.tar.gz
cd aitbc-miner
# Windows
# Download from https://gitea.bubuit.net/oib/aitbc/releases</code></pre>
<h3>2. Configure Your Node</h3>
<p>Set up your mining configuration</p>
<pre><code># Create configuration
./aitbc-miner init
# Edit config file
nano ~/.aitbc/miner/config.toml</code></pre>
<h3>3. Start Mining</h3>
<pre><code># Start the miner
./aitbc-miner start
# Check status
./aitbc-miner status
# View logs
./aitbc-miner logs</code></pre>
</section>
<!-- Configuration -->
<section class="content-section">
<h2>Configuration</h2>
<h3>Basic Configuration</h3>
<p>Edit <span class="inline-code">~/.aitbc/miner/config.toml</span>:</p>
<pre><code># Network settings
[network]
rpc_url = "https://aitbc.bubuit.net"
ws_url = "wss://aitbc.bubuit.net/ws"
# Mining settings
[mining]
stake_amount = 10000
compute_enabled = true
gpu_devices = [0] # GPU indices to use
# Wallet settings
[wallet]
address = "your-wallet-address"
private_key = "your-private-key"
# Performance settings
[performance]
max_concurrent_jobs = 2
memory_limit = "8GB"</code></pre>
<h3>GPU Configuration</h3>
<pre><code># GPU mining settings
[gpu]
enabled = true
devices = [0] # Use first GPU
memory_fraction = 0.8 # Use 80% of GPU memory
models = ["llama3.2", "mistral", "deepseek"] # Supported models</code></pre>
</section>
<!-- Mining Operations -->
<section class="content-section">
<h2>Mining Operations</h2>
<h3>Stake Mining</h3>
<ul>
<li>Stake your AITBC tokens to participate in consensus</li>
<li>Earn rewards from transaction fees</li>
<li>No hardware requirements beyond basic node</li>
<li>Rewards proportional to stake amount</li>
</ul>
<h3>GPU Mining</h3>
<ul>
<li>Provide AI/ML compute power to the network</li>
<li>Process inference jobs and earn AITBC</li>
<li>Supports 13+ Ollama models</li>
<li>Earnings: 0.02 AITBC per GPU second</li>
</ul>
<h3>Monitoring</h3>
<pre><code># Real-time monitoring
./aitbc-miner monitor
# Check earnings
./aitbc-miner earnings
# Performance metrics
./aitbc-miner metrics</code></pre>
</section>
<!-- Troubleshooting -->
<section class="content-section">
<h2>Troubleshooting</h2>
<h3>Common Issues</h3>
<div class="alert alert-warning">
<strong>GPU not detected?</strong> Ensure NVIDIA drivers are installed and CUDA is available.
</div>
<ol>
<li><strong>Connection Issues</strong>
<ul>
<li>Check internet connectivity</li>
<li>Verify RPC endpoint is accessible</li>
<li>Check firewall settings</li>
</ul>
</li>
<li><strong>Low Performance</strong>
<ul>
<li>Reduce concurrent jobs</li>
<li>Check GPU memory usage</li>
<li>Monitor system resources</li>
</ul>
</li>
<li><strong>Sync Issues</strong>
<ul>
<li>Wait for initial sync to complete</li>
<li>Check blockchain status</li>
<li>Restart miner if needed</li>
</ul>
</li>
</ol>
<h3>Getting Help</h3>
<ul>
<li>Check the logs: <code>./aitbc-miner logs</code></li>
<li>Visit our Discord community</li>
<li>Search issues on Gitea</li>
<li>Email support: aitbc@bubuit.net</li>
</ul>
</section>
<!-- FAQ -->
<section class="content-section">
<h2>Frequently Asked Questions</h2>
<h3>How much can I earn mining AITBC?</h3>
<p>Earnings vary based on:
- Stake amount (for stake mining)
- GPU performance and availability (for GPU mining)
- Network demand and transaction volume
- Current reward rates: 0.02 AITBC/GPU second</p>
<h3>What are the minimum requirements?</h3>
<p>Basic stake mining requires:
- 10,000 AITBC tokens minimum stake
- Stable internet connection
- Basic computer (4GB RAM, dual-core CPU)
GPU mining requires:
- NVIDIA GPU with 8GB+ VRAM
- 16GB+ RAM recommended
- Stable high-speed internet</p>
<h3>Is mining profitable?</h3>
<p>Profitability depends on:
- AITBC token value
- Electricity costs (for GPU mining)
- Network activity
- Your stake amount or GPU capabilities</p>
<h3>How do I become an authority node?</h3>
<p>Authority nodes require invitation based on community contribution, technical expertise, and stake amount. Apply through the community forum.</p>
</section>
<!-- Additional Resources -->
<section class="content-section">
<h2>Additional Resources</h2>
<ul>
<li><a href="blockchain-node-md.html">Blockchain Node Documentation</a></li>
<li><a href="full-documentation-md.html">Source Code</a></li>
<li>Network Statistics - available in monitoring dashboard</li>
<li>Mining Calculator - coming soon</li>
</ul>
</section>
</div>
</main>
<footer>
<div class="container">
<p>&copy; 2025 AITBC. All rights reserved.</p>
</div>
</footer>
</body>
</html>

478
website/docs/pool-hub.html Normal file
View File

@@ -0,0 +1,478 @@
<!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">
<style>
:root {
--primary-color: #2563eb;
--secondary-color: #1e40af;
--success-color: #10b981;
--text-dark: #1f2937;
--text-light: #6b7280;
--bg-light: #f9fafb;
--bg-white: #ffffff;
--border-color: #e5e7eb;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: var(--text-dark);
background: var(--bg-white);
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
header {
background: var(--text-dark);
color: white;
padding: 1rem 0;
position: sticky;
top: 0;
z-index: 100;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: white;
text-decoration: none;
}
.nav-links {
display: flex;
gap: 2rem;
list-style: none;
margin: 0;
padding: 0;
}
.nav-links a {
color: white;
text-decoration: none;
transition: color 0.3s;
}
.nav-links a:hover {
color: var(--primary-color);
}
.breadcrumb {
padding: 1rem 0;
color: var(--text-light);
font-size: 0.9rem;
}
.breadcrumb a {
color: var(--text-light);
text-decoration: none;
}
.breadcrumb a:hover {
color: var(--primary-color);
}
.doc-header {
padding: 3rem 0;
background: var(--bg-light);
margin-bottom: 2rem;
}
.doc-header h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
color: var(--text-dark);
}
.doc-header p {
font-size: 1.2rem;
color: var(--text-light);
max-width: 800px;
}
.status-badge {
display: inline-block;
padding: 0.25rem 0.75rem;
background: #10b98120;
color: var(--success-color);
border-radius: 20px;
font-size: 0.875rem;
font-weight: 600;
margin-top: 1rem;
}
.content-section {
margin-bottom: 3rem;
}
.content-section h2 {
font-size: 1.8rem;
margin-bottom: 1.5rem;
color: var(--text-dark);
border-bottom: 2px solid var(--border-color);
padding-bottom: 0.5rem;
}
.content-section h3 {
font-size: 1.4rem;
margin: 2rem 0 1rem;
color: var(--text-dark);
}
.content-section p {
margin-bottom: 1rem;
color: var(--text-dark);
}
.content-section ul {
margin-bottom: 1rem;
padding-left: 2rem;
}
.content-section li {
margin-bottom: 0.5rem;
}
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
}
.feature-card {
background: var(--bg-white);
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.feature-card h4 {
margin-top: 0;
color: var(--primary-color);
}
pre {
background: #1f2937;
color: #f9fafb;
padding: 1.5rem;
border-radius: 8px;
overflow-x: auto;
margin: 1rem 0;
}
code {
font-family: 'Courier New', Courier, monospace;
font-size: 0.9rem;
}
pre code {
background: none;
padding: 0;
}
.back-button {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: var(--primary-color);
text-decoration: none;
margin-bottom: 2rem;
font-weight: 600;
}
.back-button:hover {
color: var(--secondary-color);
}
footer {
background: var(--text-dark);
color: white;
padding: 2rem 0;
text-align: center;
margin-top: 4rem;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.doc-header h1 {
font-size: 2rem;
}
}
</style>
</head>
<body>
<header>
<nav class="container">
<a href="../index.html" class="logo">AITBC</a>
<ul class="nav-links">
<li><a href="../index.html">Home</a></li>
<li><a href="index.html">Documentation</a></li>
<li><a href="mailto:aitbc@bubuit.net">Contact</a></li>
</ul>
</nav>
</header>
<main>
<div class="container">
<!-- Breadcrumb -->
<div class="breadcrumb">
<a href="index.html">Documentation</a>
<span></span>
<a href="#">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; 2025 AITBC. All rights reserved.</p>
</div>
</footer>
</body>
</html>

View File

@@ -326,11 +326,7 @@
<!-- Overview -->
<section class="content-section">
<div class="alert alert-info" style="margin-bottom: 2rem;">
<strong>📚 Also available in Markdown:</strong>
<a href="https://gitea.bubuit.net/oib/aitbc/src/branch/main/docs/trade-exchange.md" target="_blank" style="color: inherit; text-decoration: underline;">View this documentation in markdown format</a> for easier contribution and version control.
</div>
<h2>Overview</h2>
<p>The AITBC Trade Exchange is a crypto-only platform that enables users to exchange Bitcoin for AITBC tokens. It features a modern, responsive interface with user authentication, wallet management, and real-time trading capabilities.</p>

View File

@@ -0,0 +1,428 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wallet Daemon - AITBC Documentation</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
:root {
--primary-color: #2563eb;
--secondary-color: #1e40af;
--success-color: #10b981;
--text-dark: #1f2937;
--text-light: #6b7280;
--bg-light: #f9fafb;
--bg-white: #ffffff;
--border-color: #e5e7eb;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
line-height: 1.6;
color: var(--text-dark);
background: var(--bg-white);
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
header {
background: var(--text-dark);
color: white;
padding: 1rem 0;
position: sticky;
top: 0;
z-index: 100;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
color: white;
text-decoration: none;
}
.nav-links {
display: flex;
gap: 2rem;
list-style: none;
margin: 0;
padding: 0;
}
.nav-links a {
color: white;
text-decoration: none;
transition: color 0.3s;
}
.nav-links a:hover {
color: var(--primary-color);
}
.breadcrumb {
padding: 1rem 0;
color: var(--text-light);
font-size: 0.9rem;
}
.breadcrumb a {
color: var(--text-light);
text-decoration: none;
}
.breadcrumb a:hover {
color: var(--primary-color);
}
.doc-header {
padding: 3rem 0;
background: var(--bg-light);
margin-bottom: 2rem;
}
.doc-header h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
color: var(--text-dark);
}
.doc-header p {
font-size: 1.2rem;
color: var(--text-light);
max-width: 800px;
}
.status-badge {
display: inline-block;
padding: 0.25rem 0.75rem;
background: #10b98120;
color: var(--success-color);
border-radius: 20px;
font-size: 0.875rem;
font-weight: 600;
margin-top: 1rem;
}
.content-section {
margin-bottom: 3rem;
}
.content-section h2 {
font-size: 1.8rem;
margin-bottom: 1.5rem;
color: var(--text-dark);
border-bottom: 2px solid var(--border-color);
padding-bottom: 0.5rem;
}
.content-section h3 {
font-size: 1.4rem;
margin: 2rem 0 1rem;
color: var(--text-dark);
}
.content-section p {
margin-bottom: 1rem;
color: var(--text-dark);
}
.content-section ul {
margin-bottom: 1rem;
padding-left: 2rem;
}
.content-section li {
margin-bottom: 0.5rem;
}
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
margin: 2rem 0;
}
.feature-card {
background: var(--bg-white);
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.feature-card h4 {
margin-top: 0;
color: var(--primary-color);
}
pre {
background: #1f2937;
color: #f9fafb;
padding: 1.5rem;
border-radius: 8px;
overflow-x: auto;
margin: 1rem 0;
}
code {
font-family: 'Courier New', Courier, monospace;
font-size: 0.9rem;
}
pre code {
background: none;
padding: 0;
}
.back-button {
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: var(--primary-color);
text-decoration: none;
margin-bottom: 2rem;
font-weight: 600;
}
.back-button:hover {
color: var(--secondary-color);
}
footer {
background: var(--text-dark);
color: white;
padding: 2rem 0;
text-align: center;
margin-top: 4rem;
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.doc-header h1 {
font-size: 2rem;
}
}
</style>
</head>
<body>
<header>
<nav class="container">
<a href="../index.html" class="logo">AITBC</a>
<ul class="nav-links">
<li><a href="../index.html">Home</a></li>
<li><a href="index.html">Documentation</a></li>
<li><a href="mailto:aitbc@bubuit.net">Contact</a></li>
</ul>
</nav>
</header>
<main>
<div class="container">
<!-- Breadcrumb -->
<div class="breadcrumb">
<a href="index.html">Documentation</a>
<span></span>
<a href="#">Components</a>
<span></span>
<span>Wallet Daemon</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-wallet"></i> Wallet Daemon</h1>
<p>Encrypted keystore with Argon2id + XChaCha20-Poly1305, REST/JSON-RPC APIs, and receipt verification capabilities</p>
<span class="status-badge">● Live</span>
</div>
<!-- Overview -->
<section class="content-section">
<h2>Overview</h2>
<p>The AITBC Wallet Daemon provides secure wallet management with enterprise-grade encryption and multiple API interfaces for seamless integration.</p>
<h3>Key Features</h3>
<ul>
<li>Encrypted keystore with Argon2id + XChaCha20-Poly1305</li>
<li>REST and JSON-RPC APIs</li>
<li>Receipt verification capabilities</li>
<li>Hardware wallet support</li>
<li>Multi-signature wallet support</li>
</ul>
</section>
<!-- Architecture -->
<section class="content-section">
<h2>Architecture</h2>
<p>The wallet daemon is built with security as the primary focus:</p>
<div class="feature-grid">
<div class="feature-card">
<h4><i class="fas fa-lock"></i> Encryption</h4>
<p>Argon2id key derivation with XChaCha20-Poly1305 AEAD encryption</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-key"></i> Key Management</h4>
<p>Hierarchical deterministic (HD) wallets with BIP44 support</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-plug"></i> API Layer</h4>
<p>REST and JSON-RPC APIs for easy integration</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-shield-alt"></i> Security</h4>
<p>Sandboxed execution and memory protection</p>
</div>
</div>
</section>
<!-- API Reference -->
<section class="content-section">
<h2>API Reference</h2>
<h3>REST API</h3>
<pre><code># Create wallet
POST /api/v1/wallet/create
{
"name": "my-wallet",
"password": "strong-password"
}
# Unlock wallet
POST /api/v1/wallet/unlock
{
"name": "my-wallet",
"password": "strong-password"
}
# Get address
GET /api/v1/wallet/address
# Send transaction
POST /api/v1/wallet/send
{
"to": "0x...",
"amount": 1000,
"fee": 10
}</code></pre>
<h3>JSON-RPC API</h3>
<pre><code># Get balance
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "get_balance",
"params": [],
"id": 1
}'
# Sign transaction
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "sign_transaction",
"params": [tx_data],
"id": 1
}'</code></pre>
</section>
<!-- Configuration -->
<section class="content-section">
<h2>Configuration</h2>
<p>The wallet daemon can be configured via environment variables or config file:</p>
<pre><code># Configuration file: ~/.aitbc/wallet/config.toml
[wallet]
keystore_path = "~/.aitbc/wallet/keystore"
default_network = "mainnet"
[api]
rest_host = "127.0.0.1"
rest_port = 8545
rpc_host = "127.0.0.1"
rpc_port = 8546
[security]
argon2_time = 3
argon2_memory = 67108864 # 64MB
argon2_parallelism = 4</code></pre>
</section>
<!-- Security -->
<section class="content-section">
<h2>Security Features</h2>
<ul>
<li><strong>Memory Encryption</strong>: All sensitive data encrypted in memory</li>
<li><strong>Secure Erasure</strong>: Memory zeroized after use</li>
<li><strong>Access Control</strong>: API key authentication</li>
<li><strong>Audit Logging</strong>: All operations logged securely</li>
<li><strong>Hardware Support</strong>: Ledger and Trezor integration</li>
</ul>
</section>
<!-- Integration -->
<section class="content-section">
<h2>Integration Examples</h2>
<h3>Python Integration</h3>
<pre><code>from aitbc_wallet import WalletClient
client = WalletClient("http://localhost:8545")
# Create wallet
wallet = client.create_wallet("my-wallet", "password")
print(f"Address: {wallet.address}")
# Send transaction
tx = client.send_transaction(
to="0x123...",
amount=1000,
password="password"
)
print(f"Transaction hash: {tx.hash}")</code></pre>
<h3>JavaScript Integration</h3>
<pre><code>const { WalletClient } = require('@aitbc/wallet');
const client = new WalletClient('http://localhost:8545');
// Create wallet
const wallet = await client.createWallet('my-wallet', 'password');
console.log('Address:', wallet.address);
// Get balance
const balance = await client.getBalance();
console.log('Balance:', balance);</code></pre>
</section>
</div>
</main>
<footer>
<div class="container">
<p>&copy; 2025 AITBC. All rights reserved.</p>
</div>
</footer>
</body>
</html>