feat: add marketplace metrics, privacy features, and service registry endpoints
- Add Prometheus metrics for marketplace API throughput and error rates with new dashboard panels - Implement confidential transaction models with encryption support and access control - Add key management system with registration, rotation, and audit logging - Create services and registry routers for service discovery and management - Integrate ZK proof generation for privacy-preserving receipts - Add metrics instru
This commit is contained in:
52
docs/user/getting-started/architecture.md
Normal file
52
docs/user/getting-started/architecture.md
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
title: Architecture
|
||||
description: Technical architecture of the AITBC platform
|
||||
---
|
||||
|
||||
# Architecture
|
||||
|
||||
## Overview
|
||||
|
||||
AITBC consists of several interconnected components that work together to provide a secure and efficient AI computing platform.
|
||||
|
||||
## Components
|
||||
|
||||
### Coordinator API
|
||||
The central service managing jobs, marketplace operations, and coordination.
|
||||
|
||||
### Blockchain Nodes
|
||||
Maintain the distributed ledger and execute smart contracts.
|
||||
|
||||
### Wallet Daemon
|
||||
Manages cryptographic keys and transactions.
|
||||
|
||||
### Miners/Validators
|
||||
Execute AI computations and secure the network.
|
||||
|
||||
### Explorer
|
||||
Browse blockchain data and transactions.
|
||||
|
||||
## Data Flow
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant U as User
|
||||
participant C as Coordinator
|
||||
participant M as Marketplace
|
||||
participant B as Blockchain
|
||||
participant V as Miner
|
||||
|
||||
U->>C: Submit Job
|
||||
C->>M: Find Offer
|
||||
M->>B: Create Transaction
|
||||
V->>B: Execute Job
|
||||
V->>C: Submit Results
|
||||
C->>U: Return Results
|
||||
```
|
||||
|
||||
## Security Model
|
||||
|
||||
- Cryptographic proofs for all computations
|
||||
- Multi-signature validation
|
||||
- Secure enclave support
|
||||
- Privacy-preserving techniques
|
||||
53
docs/user/getting-started/installation.md
Normal file
53
docs/user/getting-started/installation.md
Normal file
@ -0,0 +1,53 @@
|
||||
---
|
||||
title: Installation
|
||||
description: Install and set up AITBC on your system
|
||||
---
|
||||
|
||||
# Installation
|
||||
|
||||
This guide will help you install AITBC on your system.
|
||||
|
||||
## System Requirements
|
||||
|
||||
- Python 3.8 or higher
|
||||
- Docker and Docker Compose (optional)
|
||||
- 4GB RAM minimum
|
||||
- 10GB disk space
|
||||
|
||||
## Installation Methods
|
||||
|
||||
### Method 1: Docker (Recommended)
|
||||
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://github.com/aitbc/aitbc.git
|
||||
cd aitbc
|
||||
|
||||
# Start with Docker Compose
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
### Method 2: pip Install
|
||||
|
||||
```bash
|
||||
# Install the CLI
|
||||
pip install aitbc-cli
|
||||
|
||||
# Verify installation
|
||||
aitbc --version
|
||||
```
|
||||
|
||||
### Method 3: From Source
|
||||
|
||||
```bash
|
||||
# Clone repository
|
||||
git clone https://github.com/aitbc/aitbc.git
|
||||
cd aitbc
|
||||
|
||||
# Install in development mode
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
After installation, proceed to the [Quickstart Guide](quickstart.md).
|
||||
93
docs/user/getting-started/introduction.md
Normal file
93
docs/user/getting-started/introduction.md
Normal file
@ -0,0 +1,93 @@
|
||||
---
|
||||
title: Introduction to AITBC
|
||||
description: Learn about the AI Trusted Blockchain Computing platform
|
||||
---
|
||||
|
||||
# Introduction to AITBC
|
||||
|
||||
AITBC (AI Trusted Blockchain Computing) is a revolutionary platform that combines artificial intelligence with blockchain technology to create a secure, transparent, and efficient ecosystem for AI computations.
|
||||
|
||||
## What is AITBC?
|
||||
|
||||
AITBC enables:
|
||||
- **Verifiable AI Computations**: Execute AI workloads on the blockchain with cryptographic proofs
|
||||
- **Decentralized Marketplace**: Connect AI service providers with consumers in a trustless environment
|
||||
- **Fair Compensation**: Ensure fair payment for computational resources through smart contracts
|
||||
- **Privacy Preservation**: Maintain data privacy while enabling verification
|
||||
|
||||
## Key Features
|
||||
|
||||
### 🔒 Trust & Security
|
||||
- Cryptographic proofs of computation
|
||||
- Immutable audit trails
|
||||
- Secure multi-party computation
|
||||
|
||||
### ⚡ Performance
|
||||
- High-throughput consensus
|
||||
- GPU-accelerated computations
|
||||
- Optimized for AI workloads
|
||||
|
||||
### 💰 Economics
|
||||
- Token-based incentives
|
||||
- Dynamic pricing
|
||||
- Staking rewards
|
||||
|
||||
### 🌐 Accessibility
|
||||
- Easy-to-use APIs
|
||||
- SDKs for major languages
|
||||
- No blockchain expertise required
|
||||
|
||||
## Use Cases
|
||||
|
||||
### AI Service Providers
|
||||
- Monetize AI models
|
||||
- Reach global customers
|
||||
- Automated payments
|
||||
|
||||
### Data Scientists
|
||||
- Access compute resources
|
||||
- Verify results
|
||||
- Collaborate securely
|
||||
|
||||
### Enterprises
|
||||
- Private AI deployments
|
||||
- Compliance tracking
|
||||
- Cost optimization
|
||||
|
||||
### Developers
|
||||
- Build AI dApps
|
||||
- Integrate blockchain
|
||||
- Create new services
|
||||
|
||||
## Architecture
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A[Users] --> B[Coordinator API]
|
||||
B --> C[Marketplace]
|
||||
B --> D[Blockchain]
|
||||
D --> E[Miners]
|
||||
E --> F[AI Models]
|
||||
G[Wallets] --> B
|
||||
H[Explorer] --> D
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
Ready to dive in? Check out our [Quickstart Guide](quickstart.md) to get up and running in minutes.
|
||||
|
||||
## Learn More
|
||||
|
||||
- [Architecture Details](architecture.md)
|
||||
- [Installation Guide](installation.md)
|
||||
- [Developer Documentation](../developer-guide/)
|
||||
- [API Reference](../api/)
|
||||
|
||||
## Community
|
||||
|
||||
Join our community to learn, share, and collaborate:
|
||||
|
||||
- [Discord](https://discord.gg/aitbc)
|
||||
- [GitHub](https://github.com/aitbc)
|
||||
- [Blog](https://blog.aitbc.io)
|
||||
- [Twitter](https://twitter.com/aitbc)
|
||||
311
docs/user/getting-started/quickstart.md
Normal file
311
docs/user/getting-started/quickstart.md
Normal file
@ -0,0 +1,311 @@
|
||||
---
|
||||
title: Quickstart Guide
|
||||
description: Get up and running with AITBC in minutes
|
||||
---
|
||||
|
||||
# Quickstart Guide
|
||||
|
||||
This guide will help you get started with AITBC quickly. You'll learn how to set up a development environment, create your first AI job, and interact with the marketplace.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you begin, ensure you have:
|
||||
|
||||
- Python 3.8 or higher
|
||||
- Docker and Docker Compose
|
||||
- Git
|
||||
- A terminal or command line interface
|
||||
- Basic knowledge of AI/ML concepts (optional but helpful)
|
||||
|
||||
## 1. Installation
|
||||
|
||||
### Option A: Using Docker (Recommended)
|
||||
|
||||
The fastest way to get started is with Docker:
|
||||
|
||||
```bash
|
||||
# Clone the AITBC repository
|
||||
git clone https://github.com/aitbc/aitbc.git
|
||||
cd aitbc
|
||||
|
||||
# Start all services with Docker Compose
|
||||
docker-compose up -d
|
||||
|
||||
# Wait for services to be ready (takes 2-3 minutes)
|
||||
docker-compose logs -f
|
||||
```
|
||||
|
||||
### Option B: Local Development
|
||||
|
||||
For local development, install components individually:
|
||||
|
||||
```bash
|
||||
# Install the AITBC CLI
|
||||
pip install aitbc-cli
|
||||
|
||||
# Initialize a new project
|
||||
aitbc init my-ai-project
|
||||
cd my-ai-project
|
||||
|
||||
# Start local services
|
||||
aitbc dev start
|
||||
```
|
||||
|
||||
## 2. Verify Installation
|
||||
|
||||
Check that everything is working:
|
||||
|
||||
```bash
|
||||
# Check coordinator API health
|
||||
curl http://localhost:8011/v1/health
|
||||
|
||||
# Expected response:
|
||||
# {"status":"ok","env":"dev"}
|
||||
```
|
||||
|
||||
## 3. Create Your First AI Job
|
||||
|
||||
### Step 1: Prepare Your AI Model
|
||||
|
||||
Create a simple Python script for your AI model:
|
||||
|
||||
```python
|
||||
# model.py
|
||||
import numpy as np
|
||||
from typing import Dict, Any
|
||||
|
||||
def process_image(image_data: bytes) -> Dict[str, Any]:
|
||||
"""Process an image and return results"""
|
||||
# Your AI processing logic here
|
||||
# This is a simple example
|
||||
result = {
|
||||
"prediction": "cat",
|
||||
"confidence": 0.95,
|
||||
"processing_time": 0.123
|
||||
}
|
||||
return result
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
with open(sys.argv[1], 'rb') as f:
|
||||
data = f.read()
|
||||
result = process_image(data)
|
||||
print(result)
|
||||
```
|
||||
|
||||
### Step 2: Create a Job Specification
|
||||
|
||||
Create a job file:
|
||||
|
||||
```yaml
|
||||
# job.yaml
|
||||
name: "image-classification"
|
||||
description: "Classify images using AI model"
|
||||
type: "ai-inference"
|
||||
|
||||
model:
|
||||
type: "python"
|
||||
entrypoint: "model.py"
|
||||
requirements:
|
||||
- numpy==1.21.0
|
||||
- pillow==8.3.0
|
||||
- torch==1.9.0
|
||||
|
||||
input:
|
||||
type: "image"
|
||||
format: "jpeg"
|
||||
max_size: "10MB"
|
||||
|
||||
output:
|
||||
type: "json"
|
||||
schema:
|
||||
prediction: string
|
||||
confidence: float
|
||||
processing_time: float
|
||||
|
||||
resources:
|
||||
cpu: "1000m"
|
||||
memory: "2Gi"
|
||||
gpu: "1"
|
||||
|
||||
pricing:
|
||||
max_cost: "0.10"
|
||||
per_inference: "0.001"
|
||||
```
|
||||
|
||||
### Step 3: Submit the Job
|
||||
|
||||
Submit your job to the marketplace:
|
||||
|
||||
```bash
|
||||
# Using the CLI
|
||||
aitbc job submit job.yaml
|
||||
|
||||
# Or using curl directly
|
||||
curl -X POST http://localhost:8011/v1/jobs \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-API-Key: your-api-key" \
|
||||
-d @job.json
|
||||
```
|
||||
|
||||
You'll receive a job ID in response:
|
||||
```json
|
||||
{
|
||||
"job_id": "job_1234567890",
|
||||
"status": "submitted",
|
||||
"estimated_completion": "2024-01-01T12:00:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
## 4. Monitor Job Progress
|
||||
|
||||
Track your job's progress:
|
||||
|
||||
```bash
|
||||
# Check job status
|
||||
aitbc job status job_1234567890
|
||||
|
||||
# Stream logs
|
||||
aitbc job logs job_1234567890 --follow
|
||||
```
|
||||
|
||||
## 5. Get Results
|
||||
|
||||
Once the job completes, retrieve the results:
|
||||
|
||||
```bash
|
||||
# Get job results
|
||||
aitbc job results job_1234567890
|
||||
|
||||
# Download output files
|
||||
aitbc job download job_1234567890 --output ./results/
|
||||
```
|
||||
|
||||
## 6. Interact with the Marketplace
|
||||
|
||||
### Browse Available Services
|
||||
|
||||
```bash
|
||||
# List all available services
|
||||
aitbc marketplace list
|
||||
|
||||
# Search for specific services
|
||||
aitbc marketplace search --type "image-classification"
|
||||
```
|
||||
|
||||
### Use a Service
|
||||
|
||||
```bash
|
||||
# Use a service directly
|
||||
aitbc marketplace use service_456 \
|
||||
--input ./test-image.jpg \
|
||||
--output ./result.json
|
||||
```
|
||||
|
||||
## 7. Set Up a Wallet
|
||||
|
||||
Create a wallet to manage payments and rewards:
|
||||
|
||||
```bash
|
||||
# Create a new wallet
|
||||
aitbc wallet create
|
||||
|
||||
# Get wallet address
|
||||
aitbc wallet address
|
||||
|
||||
# Check balance
|
||||
aitbc wallet balance
|
||||
|
||||
# Fund your wallet (testnet only)
|
||||
aitbc wallet fund --amount 10
|
||||
```
|
||||
|
||||
## 8. Become a Miner
|
||||
|
||||
Run a miner to earn rewards:
|
||||
|
||||
```bash
|
||||
# Configure mining settings
|
||||
aitbc miner config \
|
||||
--gpu-count 1 \
|
||||
--max-jobs 5
|
||||
|
||||
# Start mining
|
||||
aitbc miner start
|
||||
|
||||
# Check mining status
|
||||
aitbc miner status
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Congratulations! You've successfully:
|
||||
- ✅ Set up AITBC
|
||||
- ✅ Created and submitted an AI job
|
||||
- ✅ Interacted with the marketplace
|
||||
- ✅ Set up a wallet
|
||||
- ✅ Started mining
|
||||
|
||||
### What to explore next:
|
||||
|
||||
1. **Advanced Job Configuration**
|
||||
- Learn about [complex job types](user-guide/creating-jobs.md#advanced-jobs)
|
||||
- Explore [resource optimization](user-guide/creating-jobs.md#optimization)
|
||||
|
||||
2. **Marketplace Features**
|
||||
- Read about [pricing strategies](user-guide/marketplace.md#pricing)
|
||||
- Understand [reputation system](user-guide/marketplace.md#reputation)
|
||||
|
||||
3. **Development**
|
||||
- Check out the [Python SDK](developer-guide/sdks/python.md)
|
||||
- Explore [API documentation](api/coordinator/endpoints.md)
|
||||
|
||||
4. **Production Deployment**
|
||||
- Learn about [deployment strategies](operations/deployment.md)
|
||||
- Set up [monitoring](operations/monitoring.md)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Service won't start**
|
||||
```bash
|
||||
# Check Docker logs
|
||||
docker-compose logs coordinator
|
||||
|
||||
# Restart services
|
||||
docker-compose restart
|
||||
```
|
||||
|
||||
**Job submission fails**
|
||||
```bash
|
||||
# Verify API key
|
||||
aitbc auth verify
|
||||
|
||||
# Check service status
|
||||
aitbc status
|
||||
```
|
||||
|
||||
**Connection errors**
|
||||
```bash
|
||||
# Check network connectivity
|
||||
curl -v http://localhost:8011/v1/health
|
||||
|
||||
# Verify configuration
|
||||
aitbc config show
|
||||
```
|
||||
|
||||
### Get Help
|
||||
|
||||
- 📖 [Full Documentation](../)
|
||||
- 💬 [Discord Community](https://discord.gg/aitbc)
|
||||
- 🐛 [Report Issues](https://github.com/aitbc/issues)
|
||||
- 📧 [Email Support](mailto:support@aitbc.io)
|
||||
|
||||
---
|
||||
|
||||
!!! tip "Pro Tip"
|
||||
Join our [Discord](https://discord.gg/aitbc) to connect with other developers and get real-time help from the AITBC team.
|
||||
|
||||
!!! note "Testnet vs Mainnet"
|
||||
This quickstart uses the AITBC testnet. All transactions are free and don't involve real money. When you're ready for production, switch to mainnet with `aitbc config set network mainnet`.
|
||||
117
docs/user/index.md
Normal file
117
docs/user/index.md
Normal file
@ -0,0 +1,117 @@
|
||||
---
|
||||
title: Welcome to AITBC
|
||||
description: AI Trusted Blockchain Computing Platform - Secure, scalable, and developer-friendly blockchain infrastructure for AI workloads
|
||||
---
|
||||
|
||||
# Welcome to AITBC Documentation
|
||||
|
||||
!!! tip "New to AITBC?"
|
||||
Start with our [Quickstart Guide](getting-started/quickstart.md) to get up and running in minutes.
|
||||
|
||||
AITBC (AI Trusted Blockchain Computing) is a next-generation blockchain platform specifically designed for AI workloads. It provides a secure, scalable, and developer-friendly infrastructure for running AI computations on the blockchain with verifiable proofs.
|
||||
|
||||
## 🚀 Key Features
|
||||
|
||||
### **AI-Native Design**
|
||||
- Built from the ground up for AI workloads
|
||||
- Support for machine learning model execution
|
||||
- Verifiable computation proofs for AI results
|
||||
- GPU-accelerated computing capabilities
|
||||
|
||||
### **Marketplace Integration**
|
||||
- Decentralized marketplace for AI services
|
||||
- Transparent pricing and reputation system
|
||||
- Smart contract-based job execution
|
||||
- Automated dispute resolution
|
||||
|
||||
### **Developer-Friendly**
|
||||
- RESTful APIs with OpenAPI specifications
|
||||
- SDK support for Python and JavaScript
|
||||
- Comprehensive documentation and examples
|
||||
- Easy integration with existing AI/ML pipelines
|
||||
|
||||
### **Enterprise-Ready**
|
||||
- High-performance consensus mechanism
|
||||
- Horizontal scaling capabilities
|
||||
- Comprehensive monitoring and observability
|
||||
- Security-hardened infrastructure
|
||||
|
||||
## 🏛️ Architecture Overview
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "AITBC Ecosystem"
|
||||
A[Client Applications] --> B[Coordinator API]
|
||||
B --> C[Marketplace]
|
||||
B --> D[Blockchain Nodes]
|
||||
D --> E[Miners/Validators]
|
||||
D --> F[Ledger Storage]
|
||||
G[Wallet Daemon] --> B
|
||||
H[Explorer] --> D
|
||||
end
|
||||
|
||||
subgraph "External Services"
|
||||
I[AI/ML Models] --> D
|
||||
J[Storage Systems] --> D
|
||||
K[Oracles] --> D
|
||||
end
|
||||
```
|
||||
|
||||
## 📚 What's in this Documentation
|
||||
|
||||
### For Users
|
||||
- [Getting Started](getting-started/) - Learn the basics and get running quickly
|
||||
- [User Guide](../user-guide/) - Comprehensive guide to using AITBC features
|
||||
- [Tutorials](../developer/tutorials/) - Step-by-step guides for common tasks
|
||||
|
||||
### For Developers
|
||||
- [Developer Guide](../developer/) - Set up your development environment
|
||||
- [API Reference](../developer/api/) - Detailed API documentation
|
||||
- [SDKs](../developer/sdks/) - Python and JavaScript SDK guides
|
||||
|
||||
### For Operators
|
||||
- [Operations Guide](../operator/) - Deployment and maintenance
|
||||
- [Security](../operator/security.md) - Security best practices
|
||||
- [Monitoring](../operator/monitoring/) - Observability setup
|
||||
|
||||
### For Ecosystem Participants
|
||||
- [Hackathons](../ecosystem/hackathons/) - Join our developer events
|
||||
- [Grants](../ecosystem/grants/) - Apply for ecosystem funding
|
||||
- [Certification](../ecosystem/certification/) - Get your solution certified
|
||||
|
||||
## 🎯 Quick Links
|
||||
|
||||
| Resource | Description | Link |
|
||||
|----------|-------------|------|
|
||||
| **Try AITBC** | Interactive demo environment | [Demo Portal](https://demo.aitbc.io) |
|
||||
| **GitHub** | Source code and contributions | [github.com/aitbc](https://github.com/aitbc) |
|
||||
| **Discord** | Community support | [Join our Discord](https://discord.gg/aitbc) |
|
||||
| **Blog** | Latest updates and tutorials | [AITBC Blog](https://blog.aitbc.io) |
|
||||
|
||||
## 🆘 Getting Help
|
||||
|
||||
!!! question "Need assistance?"
|
||||
- 📖 Check our [FAQ](resources/faq.md) for common questions
|
||||
- 💬 Join our [Discord community](https://discord.gg/aitbc) for real-time support
|
||||
- 🐛 Report issues on [GitHub](https://github.com/aitbc/issues)
|
||||
- 📧 Email us at [support@aitbc.io](mailto:support@aitbc.io)
|
||||
|
||||
## 🌟 Contributing
|
||||
|
||||
We welcome contributions from the community! Whether you're fixing bugs, improving documentation, or proposing new features, we'd love to have you involved.
|
||||
|
||||
Check out our [Contributing Guide](developer-guide/contributing.md) to get started.
|
||||
|
||||
---
|
||||
|
||||
!!! info "Stay Updated"
|
||||
Subscribe to our newsletter for the latest updates, releases, and community news.
|
||||
|
||||
[Subscribe Now](https://aitbc.io/newsletter)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<p>Built with ❤️ by the AITBC Team</p>
|
||||
<p><a href="https://github.com/aitbc/docs/blob/main/LICENSE">License</a> | <a href="https://aitbc.io/privacy">Privacy Policy</a> | <a href="https://aitbc.io/terms">Terms of Service</a></p>
|
||||
</div>
|
||||
Reference in New Issue
Block a user