320 lines
12 KiB
HTML
320 lines
12 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>AITBC Agent API - Machine-Readable Network Interface</title>
|
|
<meta name="description" content="Agent-first API for AITBC blockchain network discovery and island management">
|
|
<meta name="robots" content="noindex, follow">
|
|
<link rel="alternate" type="application/json" href="/agent/discovery.json" title="AITBC Network Discovery">
|
|
<style>
|
|
:root {
|
|
--primary: #2563eb;
|
|
--secondary: #7c3aed;
|
|
--bg: #0f172a;
|
|
--surface: #1e293b;
|
|
--text: #f8fafc;
|
|
--text-muted: #94a3b8;
|
|
--border: #334155;
|
|
--success: #10b981;
|
|
--warning: #f59e0b;
|
|
}
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
line-height: 1.6;
|
|
padding: 2rem;
|
|
}
|
|
.container { max-width: 900px; margin: 0 auto; }
|
|
header { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
|
|
h1 { font-size: 1.5rem; color: var(--primary); margin-bottom: 0.5rem; }
|
|
.subtitle { color: var(--text-muted); font-size: 0.9rem; }
|
|
.badge {
|
|
display: inline-block;
|
|
padding: 0.25rem 0.5rem;
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
font-size: 0.75rem;
|
|
color: var(--success);
|
|
margin-left: 0.5rem;
|
|
}
|
|
.section { margin: 2rem 0; }
|
|
h2 {
|
|
font-size: 1.1rem;
|
|
color: var(--secondary);
|
|
margin-bottom: 1rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
}
|
|
.endpoint-grid {
|
|
display: grid;
|
|
gap: 1rem;
|
|
}
|
|
.endpoint {
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
padding: 1rem;
|
|
}
|
|
.endpoint-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
.method {
|
|
background: var(--primary);
|
|
color: white;
|
|
padding: 0.25rem 0.5rem;
|
|
border-radius: 4px;
|
|
font-size: 0.75rem;
|
|
font-weight: bold;
|
|
}
|
|
.path {
|
|
font-family: monospace;
|
|
font-size: 0.9rem;
|
|
color: var(--text);
|
|
}
|
|
.description {
|
|
color: var(--text-muted);
|
|
font-size: 0.85rem;
|
|
margin-top: 0.5rem;
|
|
}
|
|
.curl-command {
|
|
background: #000;
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
padding: 0.5rem 0.75rem;
|
|
margin-top: 0.5rem;
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 0.8rem;
|
|
color: #a5b4fc;
|
|
overflow-x: auto;
|
|
}
|
|
.code-block {
|
|
background: #000;
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
padding: 1rem;
|
|
margin-top: 0.5rem;
|
|
overflow-x: auto;
|
|
}
|
|
code {
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 0.85rem;
|
|
color: #a5b4fc;
|
|
}
|
|
.copy-btn {
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
color: var(--text);
|
|
padding: 0.25rem 0.5rem;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
font-size: 0.75rem;
|
|
float: right;
|
|
}
|
|
.copy-btn:hover { background: var(--border); }
|
|
.island-status {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
gap: 1rem;
|
|
}
|
|
.island-card {
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
padding: 1rem;
|
|
}
|
|
.island-card h3 {
|
|
font-size: 1rem;
|
|
color: var(--primary);
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
.status-indicator {
|
|
display: inline-block;
|
|
width: 8px;
|
|
height: 8px;
|
|
border-radius: 50%;
|
|
background: var(--success);
|
|
margin-right: 0.5rem;
|
|
}
|
|
.footer {
|
|
margin-top: 3rem;
|
|
padding-top: 1rem;
|
|
border-top: 1px solid var(--border);
|
|
color: var(--text-muted);
|
|
font-size: 0.8rem;
|
|
}
|
|
a {
|
|
color: var(--primary);
|
|
text-decoration: none;
|
|
}
|
|
a:hover { text-decoration: underline; }
|
|
.json-link {
|
|
display: inline-block;
|
|
margin-top: 0.5rem;
|
|
font-size: 0.8rem;
|
|
}
|
|
.note {
|
|
background: rgba(37, 99, 235, 0.1);
|
|
border-left: 3px solid var(--primary);
|
|
padding: 1rem;
|
|
margin: 1rem 0;
|
|
border-radius: 0 4px 4px 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<header>
|
|
<h1>AITBC Agent API <span class="badge">v1.0</span></h1>
|
|
<p class="subtitle">Machine-readable network interface for autonomous agents</p>
|
|
</header>
|
|
|
|
<div class="note">
|
|
<strong>Live Data Only:</strong> All API endpoints return real-time data from the blockchain RPC. No static files - everything is queried live from the node.
|
|
</div>
|
|
|
|
<section class="section">
|
|
<h2>Network Status</h2>
|
|
<div class="island-status">
|
|
<div class="island-card">
|
|
<h3>AIT Mainnet</h3>
|
|
<p><span class="status-indicator"></span>active</p>
|
|
<p class="description">Island: ait-mainnet-island</p>
|
|
<p class="description">Role: Hub (Block Production)</p>
|
|
<p class="description" style="font-size: 0.75rem; color: var(--warning);">Live data from RPC</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="section">
|
|
<h2>Agent Discovery</h2>
|
|
<div class="endpoint-grid">
|
|
<div class="endpoint">
|
|
<div class="endpoint-header">
|
|
<span class="path">/agent/discovery.json</span>
|
|
<span class="method">GET</span>
|
|
</div>
|
|
<p class="description">Complete network discovery - returns all islands, endpoints, and this node's role. <strong>Start here.</strong></p>
|
|
<p class="curl-command">curl -s http://YOUR_DOMAIN/agent/discovery.json</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="section">
|
|
<h2>Island Management</h2>
|
|
<div class="endpoint-grid">
|
|
<div class="endpoint">
|
|
<div class="endpoint-header">
|
|
<span class="path">/agent/islands.json</span>
|
|
<span class="method">GET</span>
|
|
</div>
|
|
<p class="description">List all islands with current status, endpoints, and this node's role in each island.</p>
|
|
<p class="curl-command">curl -s http://YOUR_DOMAIN/agent/islands.json</p>
|
|
</div>
|
|
<div class="endpoint">
|
|
<div class="endpoint-header">
|
|
<span class="path">/rpc/islands</span>
|
|
<span class="method">GET</span>
|
|
</div>
|
|
<p class="description">Live island memberships from IslandManager (includes peer counts, roles, status).</p>
|
|
<p class="curl-command">curl -s http://YOUR_DOMAIN/rpc/islands</p>
|
|
</div>
|
|
<div class="endpoint">
|
|
<div class="endpoint-header">
|
|
<span class="path">/rpc/islands/{island_id}</span>
|
|
<span class="method">GET</span>
|
|
</div>
|
|
<p class="description">Detailed information about a specific island.</p>
|
|
<p class="curl-command">curl -s http://YOUR_DOMAIN/rpc/islands/{island_id}</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="section">
|
|
<h2>Chain Information</h2>
|
|
<div class="endpoint-grid">
|
|
<div class="endpoint">
|
|
<div class="endpoint-header">
|
|
<span class="path">/agent/chains.json</span>
|
|
<span class="method">GET</span>
|
|
</div>
|
|
<p class="description">All chains with configuration, endpoints, and join information.</p>
|
|
<p class="curl-command">curl -s http://YOUR_DOMAIN/agent/chains.json</p>
|
|
</div>
|
|
<div class="endpoint">
|
|
<div class="endpoint-header">
|
|
<span class="path">/rpc/head</span>
|
|
<span class="method">GET</span>
|
|
</div>
|
|
<p class="description">Current head block (height, hash, timestamp).</p>
|
|
<p class="curl-command">curl -s http://YOUR_DOMAIN/rpc/head</p>
|
|
</div>
|
|
<div class="endpoint">
|
|
<div class="endpoint-header">
|
|
<span class="path">/rpc/info</span>
|
|
<span class="method">GET</span>
|
|
</div>
|
|
<p class="description">Chain information (chain_id, network_id, consensus).</p>
|
|
<p class="curl-command">curl -s http://YOUR_DOMAIN/rpc/info</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="section">
|
|
<h2>Join Network</h2>
|
|
<div class="endpoint-grid">
|
|
<div class="endpoint">
|
|
<div class="endpoint-header">
|
|
<span class="path">/agent/join/ait-mainnet.json</span>
|
|
<span class="method">GET</span>
|
|
</div>
|
|
<p class="description">Complete join instructions for ait-mainnet: configuration templates, P2P peers, RPC endpoints.</p>
|
|
<p class="curl-command">curl -s http://YOUR_DOMAIN/agent/join/ait-mainnet.json</p>
|
|
</div>
|
|
<div class="endpoint">
|
|
<div class="endpoint-header">
|
|
<span class="path">/agent/join/ait-testnet.json</span>
|
|
<span class="method">GET</span>
|
|
</div>
|
|
<p class="description">Complete join instructions for ait-testnet.</p>
|
|
<p class="curl-command">curl -s http://YOUR_DOMAIN/agent/join/ait-testnet.json</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="section">
|
|
<h2>API Documentation</h2>
|
|
<div class="endpoint-grid">
|
|
<div class="endpoint">
|
|
<div class="endpoint-header">
|
|
<span class="path">/agent/openapi.json</span>
|
|
<span class="method">GET</span>
|
|
</div>
|
|
<p class="description">OpenAPI 3.0 specification for all RPC and agent endpoints.</p>
|
|
<p class="curl-command">curl -s http://YOUR_DOMAIN/agent/openapi.json</p>
|
|
</div>
|
|
<div class="endpoint">
|
|
<div class="endpoint-header">
|
|
<span class="path">/agent/health</span>
|
|
<span class="method">GET</span>
|
|
</div>
|
|
<p class="description">Health check endpoint for monitoring.</p>
|
|
<p class="curl-command">curl -s http://YOUR_DOMAIN/agent/health</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<footer class="footer">
|
|
<p>AITBC Network • Agent-First Architecture</p>
|
|
<p>Node ID: aitbc | Role: Hub | <a href="/">Human Interface →</a></p>
|
|
</footer>
|
|
</div>
|
|
</body>
|
|
</html>
|