feat: Convert HTML documentation to markdown and add web format
- Convert all HTML documentation files to markdown format in /docs folder - Add markdown links to HTML documentation pages - Update all aitbc.io references to aitbc.bubuit.net - Create HTML web format versions of key documentation files - Update documentation index to show both HTML and web format options - Add flowchart documentation explaining CLI job submission process
This commit is contained in:
173
docs/blockchain-node.md
Normal file
173
docs/blockchain-node.md
Normal file
@@ -0,0 +1,173 @@
|
||||
# Blockchain Node - AITBC Documentation
|
||||
|
||||
PoA/PoS consensus blockchain with REST/WebSocket RPC, real-time gossip layer, and comprehensive observability
|
||||
|
||||
<span class="status-badge live">● Live</span>
|
||||
|
||||
## Overview
|
||||
|
||||
The AITBC Blockchain Node is the core infrastructure component that maintains the distributed ledger. It implements a hybrid Proof-of-Authority/Proof-of-Stake consensus mechanism with fast finality and supports high throughput for AI workload transactions.
|
||||
|
||||
### Key Features
|
||||
|
||||
- Hybrid PoA/PoS consensus with sub-second finality
|
||||
- REST and WebSocket RPC APIs
|
||||
- Real-time gossip protocol for block propagation
|
||||
- Comprehensive observability with Prometheus metrics
|
||||
- SQLModel-based data persistence
|
||||
- Built-in devnet tooling and scripts
|
||||
|
||||
## Architecture
|
||||
|
||||
The blockchain node is built with a modular architecture separating concerns for consensus, storage, networking, and API layers.
|
||||
|
||||
#### Consensus Engine
|
||||
Hybrid PoA/PoS with proposer rotation and validator sets
|
||||
|
||||
#### Storage Layer
|
||||
SQLModel with SQLite/PostgreSQL support
|
||||
|
||||
#### Networking
|
||||
WebSocket gossip + REST API
|
||||
|
||||
#### Observability
|
||||
Prometheus metrics + structured logging
|
||||
|
||||
## API Reference
|
||||
|
||||
The blockchain node exposes both REST and WebSocket APIs for interaction.
|
||||
|
||||
### REST Endpoints
|
||||
|
||||
`GET /rpc/get_head`
|
||||
Get the latest block header
|
||||
|
||||
`POST /rpc/send_tx`
|
||||
Submit a new transaction
|
||||
|
||||
`GET /rpc/get_balance/{address}`
|
||||
Get account balance
|
||||
|
||||
`GET /rpc/get_block/{height}`
|
||||
Get block by height
|
||||
|
||||
### WebSocket Subscriptions
|
||||
|
||||
- `new_blocks` - Real-time block notifications
|
||||
- `new_transactions` - Transaction pool updates
|
||||
- `consensus_events` - Consensus round updates
|
||||
|
||||
## Configuration
|
||||
|
||||
The node can be configured via environment variables or configuration file.
|
||||
|
||||
### Key Settings
|
||||
|
||||
```bash
|
||||
# Database
|
||||
DATABASE_URL=sqlite:///blockchain.db
|
||||
|
||||
# Network
|
||||
RPC_HOST=0.0.0.0
|
||||
RPC_PORT=9080
|
||||
WS_PORT=9081
|
||||
|
||||
# Consensus
|
||||
CONSENSUS_MODE=poa
|
||||
VALIDATOR_ADDRESS=0x...
|
||||
BLOCK_TIME=1s
|
||||
|
||||
# Observability
|
||||
METRICS_PORT=9090
|
||||
LOG_LEVEL=info
|
||||
```
|
||||
|
||||
## Running a Node
|
||||
|
||||
### Development Mode
|
||||
|
||||
```bash
|
||||
# Initialize devnet
|
||||
python -m blockchain.scripts.init_devnet
|
||||
|
||||
# Start node
|
||||
python -m blockchain.main --config devnet.yaml
|
||||
```
|
||||
|
||||
### Production Mode
|
||||
|
||||
```bash
|
||||
# Using Docker
|
||||
docker run -d \
|
||||
-v /data/blockchain:/data \
|
||||
-p 9080:9080 \
|
||||
-p 9081:9081 \
|
||||
-p 9090:9090 \
|
||||
aitbc/blockchain-node:latest
|
||||
```
|
||||
|
||||
## Monitoring
|
||||
|
||||
### Prometheus Metrics
|
||||
|
||||
Available at `http://localhost:9090/metrics`
|
||||
|
||||
Key metrics:
|
||||
- `blockchain_blocks_total` - Total blocks produced
|
||||
- `blockchain_transactions_total` - Total transactions processed
|
||||
- `blockchain_consensus_rounds` - Consensus rounds completed
|
||||
- `blockchain_network_peers` - Active peer connections
|
||||
|
||||
### Health Checks
|
||||
|
||||
```bash
|
||||
# Node status
|
||||
curl http://localhost:9080/health
|
||||
|
||||
# Sync status
|
||||
curl http://localhost:9080/sync_status
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
1. **Node not syncing**
|
||||
- Check peer connections: `curl /rpc/peers`
|
||||
- Verify network connectivity
|
||||
- Check logs for consensus errors
|
||||
|
||||
2. **High memory usage**
|
||||
- Reduce `block_cache_size` in config
|
||||
- Enable block pruning
|
||||
|
||||
3. **RPC timeouts**
|
||||
- Increase `rpc_timeout` setting
|
||||
- Check system resources
|
||||
|
||||
## Development
|
||||
|
||||
### Building from Source
|
||||
|
||||
```bash
|
||||
git clone https://github.com/aitbc/blockchain
|
||||
cd blockchain
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
### Running Tests
|
||||
|
||||
```bash
|
||||
# Unit tests
|
||||
pytest tests/
|
||||
|
||||
# Integration tests
|
||||
pytest tests/integration/
|
||||
```
|
||||
|
||||
## Security Considerations
|
||||
|
||||
- Validator keys should be kept secure
|
||||
- Use HTTPS in production
|
||||
- Implement rate limiting on RPC endpoints
|
||||
- Regular security updates for dependencies
|
||||
305
docs/client-documentation.md
Normal file
305
docs/client-documentation.md
Normal file
@@ -0,0 +1,305 @@
|
||||
# Client Documentation - AITBC
|
||||
|
||||
Use AITBC for AI/ML Workloads: Access secure, private, and verifiable AI/ML computation on the decentralized network
|
||||
|
||||
> ✅ **Now Available: CLI Wrapper Tool**
|
||||
>
|
||||
> Submit jobs, check status, and verify receipts with our new bash CLI wrapper. Supporting 13+ Ollama models with real-time blockchain verification!
|
||||
|
||||
## Key Features
|
||||
|
||||
- **Privacy First** - Your data and models remain confidential with zero-knowledge proofs and secure enclaves
|
||||
- **Verifiable Results** - Every computation is cryptographically verified on the blockchain for trust and transparency
|
||||
- **Fast & Efficient** - Access thousands of GPUs worldwide with sub-second response times
|
||||
|
||||
## Getting Started
|
||||
|
||||
Start using AITBC in minutes with our simple client SDK or web interface.
|
||||
|
||||
### Quick Start Options
|
||||
|
||||
- **CLI Wrapper Tool**: ✅ NEW - Unified bash script for job management
|
||||
- **Web Interface**: No installation required
|
||||
- **Python SDK**: For AI/ML developers
|
||||
- **JavaScript SDK**: For web applications
|
||||
- **REST API**: For any platform
|
||||
|
||||
### CLI Wrapper Tool (Recommended)
|
||||
|
||||
#### Submit an Inference Job
|
||||
|
||||
Use the bash CLI wrapper for easy job submission:
|
||||
|
||||
```bash
|
||||
# Submit job with CLI wrapper
|
||||
./scripts/aitbc-cli.sh submit inference \
|
||||
--prompt "What is machine learning?" \
|
||||
--model llama3.2:latest
|
||||
|
||||
# Check job status
|
||||
./scripts/aitbc-cli.sh status <job_id>
|
||||
|
||||
# View receipt with payment details
|
||||
./scripts/aitbc-cli.sh receipts --job-id <job_id>
|
||||
```
|
||||
|
||||
> **Available Models:** llama3.2, mistral, deepseek-r1:14b, gemma3, qwen2.5-coder, and 8+ more via Ollama integration. Processing time: 11-25 seconds. Rate: 0.02 AITBC per GPU second.
|
||||
|
||||
### Web Interface (Fastest)
|
||||
|
||||
1. **Visit the Marketplace**
|
||||
- Go to [aitbc.bubuit.net/marketplace](https://gitea.bubuit.net/oib/aitbc)
|
||||
|
||||
2. **Connect Your Wallet**
|
||||
- Connect MetaMask or create a new AITBC wallet
|
||||
|
||||
3. **Submit Your Job**
|
||||
- Upload your data or model, select parameters, and submit
|
||||
|
||||
4. **Get Results**
|
||||
- Receive verified results with cryptographic proof
|
||||
|
||||
## Popular Use Cases
|
||||
|
||||
### AI Inference ✅ LIVE
|
||||
Run inference on pre-trained models including LLama, Mistral, DeepSeek, and custom models via Ollama
|
||||
|
||||
- Text generation (13+ models)
|
||||
- Code generation (DeepSeek, Qwen)
|
||||
- Translation (Qwen2.5-translator)
|
||||
- Real-time processing (11-25s)
|
||||
|
||||
### Model Training
|
||||
Train and fine-tune models on your data with privacy guarantees
|
||||
|
||||
- Fine-tuning LLMs
|
||||
- Custom model training
|
||||
- Federated learning
|
||||
- Transfer learning
|
||||
|
||||
### Data Analysis
|
||||
Process large datasets with confidential computing
|
||||
|
||||
- Statistical analysis
|
||||
- Pattern recognition
|
||||
- Predictive modeling
|
||||
- Data visualization
|
||||
|
||||
### Secure Computation
|
||||
Run sensitive computations with end-to-end encryption
|
||||
|
||||
- Financial modeling
|
||||
- Healthcare analytics
|
||||
- Legal document processing
|
||||
- Proprietary algorithms
|
||||
|
||||
## SDK Examples
|
||||
|
||||
### Python SDK
|
||||
|
||||
```python
|
||||
# Install the SDK
|
||||
pip install aitbc
|
||||
|
||||
# Initialize client
|
||||
from aitbc import AITBCClient
|
||||
|
||||
client = AITBCClient(api_key="your-api-key")
|
||||
|
||||
# Run inference
|
||||
result = client.inference(
|
||||
model="gpt-4",
|
||||
prompt="Explain quantum computing",
|
||||
max_tokens=500,
|
||||
temperature=0.7
|
||||
)
|
||||
|
||||
print(result.text)
|
||||
|
||||
# Verify the receipt
|
||||
is_valid = client.verify_receipt(result.receipt_id)
|
||||
print(f"Verified: {is_valid}")
|
||||
```
|
||||
|
||||
### JavaScript SDK
|
||||
|
||||
```javascript
|
||||
// Install the SDK
|
||||
npm install @aitbc/client
|
||||
|
||||
// Initialize client
|
||||
import { AITBCClient } from '@aitbc/client';
|
||||
|
||||
const client = new AITBCClient({
|
||||
apiKey: 'your-api-key',
|
||||
network: 'mainnet'
|
||||
});
|
||||
|
||||
// Run inference
|
||||
const result = await client.inference({
|
||||
model: 'stable-diffusion',
|
||||
prompt: 'A futuristic city',
|
||||
steps: 50,
|
||||
cfg_scale: 7.5
|
||||
});
|
||||
|
||||
// Download the image
|
||||
await client.downloadImage(result.imageId, './output.png');
|
||||
|
||||
// Verify computation
|
||||
const verified = await client.verify(result.receiptId);
|
||||
console.log('Computation verified:', verified);
|
||||
```
|
||||
|
||||
### REST API
|
||||
|
||||
```bash
|
||||
# Submit a job
|
||||
curl -X POST https://aitbc.bubuit.net/api/v1/jobs \
|
||||
-H "Authorization: Bearer YOUR_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"type": "inference",
|
||||
"model": "gpt-4",
|
||||
"input": {
|
||||
"prompt": "Hello, AITBC!",
|
||||
"max_tokens": 100
|
||||
},
|
||||
"privacy": {
|
||||
"confidential": true,
|
||||
"zk_proof": true
|
||||
}
|
||||
}'
|
||||
|
||||
# Check job status
|
||||
curl -X GET https://aitbc.bubuit.net/api/v1/jobs/JOB_ID \
|
||||
-H "Authorization: Bearer YOUR_TOKEN"
|
||||
```
|
||||
|
||||
## Pricing
|
||||
|
||||
Flexible pricing options for every use case
|
||||
|
||||
### Pay-per-use
|
||||
- **$0.01/1K tokens**
|
||||
- No minimum commitment
|
||||
- Pay only for what you use
|
||||
- All models available
|
||||
- Basic support
|
||||
|
||||
### Professional
|
||||
- **$99/month**
|
||||
- $500 included credits
|
||||
- Priority processing
|
||||
- Advanced models
|
||||
- Email support
|
||||
- API access
|
||||
|
||||
### Enterprise
|
||||
- **Custom**
|
||||
- Unlimited usage
|
||||
- Dedicated resources
|
||||
- Custom models
|
||||
- 24/7 support
|
||||
- SLA guarantee
|
||||
|
||||
## Privacy & Security
|
||||
|
||||
> **Your data is never stored or exposed** - All computations are performed in secure enclaves with zero-knowledge proof verification.
|
||||
|
||||
### Privacy Features
|
||||
|
||||
- **End-to-end encryption** - Your data is encrypted before leaving your device
|
||||
- **Zero-knowledge proofs** - Prove computation without revealing inputs
|
||||
- **Secure enclaves** - Computations run in isolated, verified environments
|
||||
- **No data retention** - Providers cannot access or store your data
|
||||
- **Audit trails** - Full transparency on blockchain
|
||||
|
||||
### Compliance
|
||||
|
||||
- GDPR compliant
|
||||
- SOC 2 Type II certified
|
||||
- HIPAA eligible
|
||||
- ISO 27001 certified
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Optimizing Performance
|
||||
|
||||
- Use appropriate model sizes for your task
|
||||
- Batch requests when possible
|
||||
- Enable caching for repeated queries
|
||||
- Choose the right privacy level for your needs
|
||||
- Monitor your usage and costs
|
||||
|
||||
### Security Tips
|
||||
|
||||
- Keep your API keys secure
|
||||
- Use environment variables for credentials
|
||||
- Enable two-factor authentication
|
||||
- Regularly rotate your keys
|
||||
- Use VPN for additional privacy
|
||||
|
||||
### Cost Optimization
|
||||
|
||||
- Start with smaller models for testing
|
||||
- Use streaming for long responses
|
||||
- Set appropriate limits and timeouts
|
||||
- Monitor token usage
|
||||
- Consider subscription plans for regular use
|
||||
|
||||
## Support & Resources
|
||||
|
||||
### Getting Help
|
||||
|
||||
- **Documentation**: [Full API reference](full-documentation.html)
|
||||
- **Community**: [Join our Discord](https://discord.gg/aitbc)
|
||||
- **Email**: [aitbc@bubuit.net](mailto:aitbc@bubuit.net)
|
||||
- **Status**: [System status](https://status.aitbc.bubuit.net)
|
||||
|
||||
### Tutorials
|
||||
|
||||
- [Getting Started with AI Inference](#)
|
||||
- [Building a Chat Application](#)
|
||||
- [Image Generation Guide](#)
|
||||
- [Privacy-Preserving ML](#)
|
||||
- [API Integration Best Practices](#)
|
||||
|
||||
### Examples
|
||||
|
||||
- [GitHub Repository](#)
|
||||
- [Code Examples](#)
|
||||
- [Sample Applications](#)
|
||||
- [SDK Documentation](#)
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
> **Question not answered?** Contact us at [aitbc@bubuit.net](mailto:aitbc@bubuit.net)
|
||||
|
||||
### General
|
||||
|
||||
- **How do I get started?** - Sign up for an account, connect your wallet, and submit your first job through the web interface or API.
|
||||
- **What models are available?** - We support GPT-3.5/4, Claude, Llama, Stable Diffusion, and many custom models.
|
||||
- **Can I use my own model?** - Yes, you can upload and run private models with full confidentiality.
|
||||
|
||||
### Privacy
|
||||
|
||||
- **Is my data private?** - Absolutely. Your data is encrypted and never exposed to providers.
|
||||
- **How do ZK proofs work?** - They prove computation was done correctly without revealing inputs.
|
||||
- **Can you see my prompts?** - No, prompts are encrypted and processed in secure enclaves.
|
||||
|
||||
### Technical
|
||||
|
||||
- **What's the response time?** - Most jobs complete in 1-5 seconds depending on complexity.
|
||||
- **Do you support streaming?** - Yes, streaming is available for real-time applications.
|
||||
- **Can I run batch jobs?** - Yes, batch processing is supported for large workloads.
|
||||
|
||||
### Billing
|
||||
|
||||
- **How am I billed?** - Pay-per-use or monthly subscription options available.
|
||||
- **Can I set spending limits?** - Yes, you can set daily/monthly limits in your dashboard.
|
||||
- **Do you offer refunds?** - Yes, we offer refunds for service issues within 30 days.
|
||||
|
||||
---
|
||||
|
||||
© 2025 AITBC. All rights reserved.
|
||||
121
docs/components.md
Normal file
121
docs/components.md
Normal file
@@ -0,0 +1,121 @@
|
||||
# AITBC System Components
|
||||
|
||||
Overview of all components in the AITBC platform, their status, and documentation links.
|
||||
|
||||
## Core Components
|
||||
|
||||
### Blockchain Node
|
||||
<span class="component-status live">● Live</span>
|
||||
|
||||
PoA/PoS consensus with REST/WebSocket RPC, real-time gossip layer, and comprehensive observability. Production-ready with devnet tooling.
|
||||
|
||||
[Learn More →](blockchain-node.md)
|
||||
|
||||
### Coordinator API
|
||||
<span class="component-status live">● Live</span>
|
||||
|
||||
FastAPI service for job submission, miner registration, and receipt management. SQLite persistence with comprehensive endpoints.
|
||||
|
||||
[Learn More →](coordinator-api.md)
|
||||
|
||||
### Marketplace Web
|
||||
<span class="component-status live">● Live</span>
|
||||
|
||||
Vite/TypeScript marketplace with offer/bid functionality, stats dashboard, and mock/live data toggle. Production UI ready.
|
||||
|
||||
[Learn More →](marketplace-web.md)
|
||||
|
||||
### Explorer Web
|
||||
<span class="component-status live">● Live</span>
|
||||
|
||||
Full-featured blockchain explorer with blocks, transactions, addresses, and receipts tracking. Responsive design with live data.
|
||||
|
||||
[Learn More →](explorer-web.md)
|
||||
|
||||
### Wallet Daemon
|
||||
<span class="component-status live">● Live</span>
|
||||
|
||||
Encrypted keystore with Argon2id + XChaCha20-Poly1305, REST/JSON-RPC APIs, and receipt verification capabilities.
|
||||
|
||||
[Learn More →](wallet-daemon.md)
|
||||
|
||||
### Trade Exchange
|
||||
<span class="component-status live">● Live</span>
|
||||
|
||||
Bitcoin-to-AITBC exchange with QR payments, user management, and real-time trading. Buy tokens with BTC instantly.
|
||||
|
||||
[Learn More →](trade-exchange.md)
|
||||
|
||||
### Pool Hub
|
||||
<span class="component-status live">● Live</span>
|
||||
|
||||
Miner registry with scoring engine, Redis/PostgreSQL backing, and comprehensive metrics. Live matching API deployed.
|
||||
|
||||
[Learn More →](pool-hub.md)
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
The AITBC platform consists of 7 core components working together to provide a complete AI blockchain computing solution:
|
||||
|
||||
### Infrastructure Layer
|
||||
|
||||
- **Blockchain Node** - Distributed ledger with PoA/PoS consensus
|
||||
- **Coordinator API** - Job orchestration and management
|
||||
- **Wallet Daemon** - Secure wallet management
|
||||
|
||||
### Application Layer
|
||||
|
||||
- **Marketplace Web** - GPU compute marketplace
|
||||
- **Trade Exchange** - Token trading platform
|
||||
- **Explorer Web** - Blockchain explorer
|
||||
- **Pool Hub** - Miner coordination service
|
||||
|
||||
## Component Interactions
|
||||
|
||||
```
|
||||
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
|
||||
│ Clients │────▶│ Coordinator │────▶│ Blockchain │
|
||||
│ │ │ API │ │ Node │
|
||||
└─────────────┘ └──────────────┘ └─────────────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
|
||||
│ Wallet │ │ Pool Hub │ │ Miners │
|
||||
│ Daemon │ │ │ │ │
|
||||
└─────────────┘ └──────────────┘ └─────────────┘
|
||||
```
|
||||
|
||||
## Quick Links
|
||||
|
||||
[Trade Exchange](https://aitbc.bubuit.net/Exchange/)
|
||||
[Marketplace](https://aitbc.bubuit.net/marketplace/)
|
||||
[Explorer](https://aitbc.bubuit.net/explorer/)
|
||||
[API Docs](https://aitbc.bubuit.net/api/docs)
|
||||
|
||||
## Status Legend
|
||||
|
||||
- <span class="component-status live">● Live</span> - Production ready and deployed
|
||||
- <span class="component-status beta">● Beta</span> - In testing, limited availability
|
||||
- <span class="component-status dev">● Development</span> - Under active development
|
||||
|
||||
## Deployment Information
|
||||
|
||||
All components are containerized and can be deployed using Docker Compose:
|
||||
|
||||
```bash
|
||||
# Deploy all components
|
||||
docker-compose up -d
|
||||
|
||||
# Check status
|
||||
docker-compose ps
|
||||
|
||||
# View logs
|
||||
docker-compose logs -f
|
||||
```
|
||||
|
||||
## Support
|
||||
|
||||
For component-specific issues:
|
||||
- Check individual documentation pages
|
||||
- Visit the [GitHub repository](https://github.com/aitbc/platform)
|
||||
- Contact: [aitbc@bubuit.net](mailto:aitbc@bubuit.net)
|
||||
254
docs/coordinator-api.md
Normal file
254
docs/coordinator-api.md
Normal file
@@ -0,0 +1,254 @@
|
||||
# Coordinator API - AITBC Documentation
|
||||
|
||||
FastAPI service for job submission, miner registration, and receipt management. SQLite persistence with comprehensive endpoints.
|
||||
|
||||
<span class="component-status live">● Live</span>
|
||||
|
||||
## Overview
|
||||
|
||||
The Coordinator API is the central orchestration layer that manages job distribution between clients and miners in the AITBC network. It handles job submissions, miner registrations, and tracks all computation receipts.
|
||||
|
||||
### Key Features
|
||||
|
||||
- Job submission and tracking
|
||||
- Miner registration and heartbeat monitoring
|
||||
- Receipt management and verification
|
||||
- User management with wallet-based authentication
|
||||
- SQLite persistence with SQLModel ORM
|
||||
- Comprehensive API documentation with OpenAPI
|
||||
|
||||
## Architecture
|
||||
|
||||
The Coordinator API follows a clean architecture with separation of concerns for domain models, API routes, and business logic.
|
||||
|
||||
#### API Layer
|
||||
FastAPI routers for clients, miners, admin, and users
|
||||
|
||||
#### Domain Models
|
||||
SQLModel definitions for jobs, miners, receipts, users
|
||||
|
||||
#### Business Logic
|
||||
Service layer handling job orchestration
|
||||
|
||||
#### Persistence
|
||||
SQLite database with Alembic migrations
|
||||
|
||||
## API Reference
|
||||
|
||||
The Coordinator API provides RESTful endpoints for all major operations.
|
||||
|
||||
### Client Endpoints
|
||||
|
||||
`POST /v1/client/jobs`
|
||||
Submit a new computation job
|
||||
|
||||
`GET /v1/client/jobs/{job_id}/status`
|
||||
Get job status and progress
|
||||
|
||||
`GET /v1/client/jobs/{job_id}/receipts`
|
||||
Retrieve computation receipts
|
||||
|
||||
### Miner Endpoints
|
||||
|
||||
`POST /v1/miner/register`
|
||||
Register as a compute provider
|
||||
|
||||
`POST /v1/miner/heartbeat`
|
||||
Send miner heartbeat
|
||||
|
||||
`GET /v1/miner/jobs`
|
||||
Fetch available jobs
|
||||
|
||||
`POST /v1/miner/result`
|
||||
Submit job result
|
||||
|
||||
### User Management
|
||||
|
||||
`POST /v1/users/login`
|
||||
Login or register with wallet
|
||||
|
||||
`GET /v1/users/me`
|
||||
Get current user profile
|
||||
|
||||
`GET /v1/users/{user_id}/balance`
|
||||
Get user wallet balance
|
||||
|
||||
### Exchange Endpoints
|
||||
|
||||
`POST /v1/exchange/create-payment`
|
||||
Create Bitcoin payment request
|
||||
|
||||
`GET /v1/exchange/payment-status/{id}`
|
||||
Check payment status
|
||||
|
||||
## Authentication
|
||||
|
||||
The API uses API key authentication for clients and miners, and session-based authentication for users.
|
||||
|
||||
### API Keys
|
||||
|
||||
```http
|
||||
X-Api-Key: your-api-key-here
|
||||
```
|
||||
|
||||
### Session Tokens
|
||||
|
||||
```http
|
||||
X-Session-Token: sha256-token-here
|
||||
```
|
||||
|
||||
### Example Request
|
||||
|
||||
```bash
|
||||
curl -X POST "https://aitbc.bubuit.net/api/v1/client/jobs" \
|
||||
-H "X-Api-Key: your-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"job_type": "llm_inference",
|
||||
"parameters": {...}
|
||||
}'
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
The Coordinator API can be configured via environment variables.
|
||||
|
||||
### Environment Variables
|
||||
|
||||
```bash
|
||||
# Database
|
||||
DATABASE_URL=sqlite:///coordinator.db
|
||||
|
||||
# API Settings
|
||||
API_HOST=0.0.0.0
|
||||
API_PORT=8000
|
||||
|
||||
# Security
|
||||
SECRET_KEY=your-secret-key
|
||||
API_KEYS=key1,key2,key3
|
||||
|
||||
# Exchange
|
||||
BITCOIN_ADDRESS=tb1qxy2...
|
||||
BTC_TO_AITBC_RATE=100000
|
||||
```
|
||||
|
||||
## Deployment
|
||||
|
||||
The Coordinator API runs in a Docker container with nginx proxy.
|
||||
|
||||
### Docker Deployment
|
||||
|
||||
```bash
|
||||
# Build image
|
||||
docker build -t aitbc-coordinator .
|
||||
|
||||
# Run container
|
||||
docker run -d \
|
||||
--name aitbc-coordinator \
|
||||
-p 8000:8000 \
|
||||
-e DATABASE_URL=sqlite:///data/coordinator.db \
|
||||
-v $(pwd)/data:/app/data \
|
||||
aitbc-coordinator
|
||||
```
|
||||
|
||||
### Systemd Service
|
||||
|
||||
```bash
|
||||
# Start service
|
||||
sudo systemctl start aitbc-coordinator
|
||||
|
||||
# Check status
|
||||
sudo systemctl status aitbc-coordinator
|
||||
|
||||
# View logs
|
||||
sudo journalctl -u aitbc-coordinator -f
|
||||
```
|
||||
|
||||
## Interactive API Documentation
|
||||
|
||||
Interactive API documentation is available via Swagger UI and ReDoc.
|
||||
|
||||
- [Swagger UI](https://aitbc.bubuit.net/api/docs)
|
||||
- [ReDoc](https://aitbc.bubuit.net/api/redoc)
|
||||
- [OpenAPI Spec](https://aitbc.bubuit.net/api/openapi.json)
|
||||
|
||||
## Data Models
|
||||
|
||||
### Job
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "uuid",
|
||||
"client_id": "string",
|
||||
"job_type": "llm_inference",
|
||||
"parameters": {},
|
||||
"status": "pending|running|completed|failed",
|
||||
"created_at": "timestamp",
|
||||
"updated_at": "timestamp"
|
||||
}
|
||||
```
|
||||
|
||||
### Miner
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "uuid",
|
||||
"address": "string",
|
||||
"endpoint": "string",
|
||||
"capabilities": [],
|
||||
"status": "active|inactive",
|
||||
"last_heartbeat": "timestamp"
|
||||
}
|
||||
```
|
||||
|
||||
### Receipt
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "uuid",
|
||||
"job_id": "uuid",
|
||||
"miner_id": "uuid",
|
||||
"result": {},
|
||||
"proof": "string",
|
||||
"created_at": "timestamp"
|
||||
}
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
The API returns standard HTTP status codes with detailed error messages:
|
||||
|
||||
```json
|
||||
{
|
||||
"error": {
|
||||
"code": "INVALID_JOB_TYPE",
|
||||
"message": "The specified job type is not supported",
|
||||
"details": {}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Rate Limiting
|
||||
|
||||
API endpoints are rate-limited to prevent abuse:
|
||||
|
||||
- Client endpoints: 100 requests/minute
|
||||
- Miner endpoints: 1000 requests/minute
|
||||
- User endpoints: 60 requests/minute
|
||||
|
||||
## Monitoring
|
||||
|
||||
The Coordinator API exposes metrics at `/metrics` endpoint:
|
||||
|
||||
- `api_requests_total` - Total API requests
|
||||
- `api_request_duration_seconds` - Request latency
|
||||
- `active_jobs` - Currently active jobs
|
||||
- `registered_miners` - Number of registered miners
|
||||
|
||||
## Security
|
||||
|
||||
- All sensitive endpoints require authentication
|
||||
- API keys should be kept confidential
|
||||
- HTTPS is required in production
|
||||
- Input validation on all endpoints
|
||||
- SQL injection prevention via ORM
|
||||
259
docs/developer-documentation.md
Normal file
259
docs/developer-documentation.md
Normal file
@@ -0,0 +1,259 @@
|
||||
# Developer Documentation - AITBC
|
||||
|
||||
Build on the AITBC platform: SDKs, APIs, bounties, and resources for developers.
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Git
|
||||
- Docker and Docker Compose
|
||||
- Node.js 18+ (for frontend)
|
||||
- Python 3.9+ (for AI services)
|
||||
- Rust 1.70+ (for blockchain)
|
||||
|
||||
### Setup Development Environment
|
||||
|
||||
```bash
|
||||
# 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
|
||||
```
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
The AITBC platform consists of:
|
||||
|
||||
- **Blockchain Node** (Rust) - PoA/PoS consensus layer
|
||||
- **Coordinator API** (Python/FastAPI) - Job orchestration
|
||||
- **Marketplace Web** (TypeScript/Vite) - User interface
|
||||
- **Miner Daemons** (Go) - GPU compute providers
|
||||
- **Wallet Daemon** (Go) - Secure wallet management
|
||||
|
||||
## Contributing
|
||||
|
||||
### How to Contribute
|
||||
|
||||
1. Fork the repository on Gitea
|
||||
2. Create a feature branch: `git checkout -b feature/amazing-feature`
|
||||
3. Make your changes
|
||||
4. Add tests for new functionality
|
||||
5. Ensure all tests pass: `make test`
|
||||
6. Submit a pull request
|
||||
|
||||
### Code Style
|
||||
|
||||
- **Rust**: Use `rustfmt` and `clippy`
|
||||
- **Python**: Follow PEP 8, use `black` and `flake8`
|
||||
- **TypeScript**: Use Prettier and ESLint
|
||||
- **Go**: Use `gofmt`
|
||||
|
||||
### Pull Request Process
|
||||
|
||||
1. Update documentation for any changes
|
||||
2. Add unit tests for new features
|
||||
3. Ensure CI/CD pipeline passes
|
||||
4. Request review from core team
|
||||
5. Address feedback promptly
|
||||
|
||||
## Bounty Program
|
||||
|
||||
Get paid to contribute to AITBC! Check open bounties on Gitea.
|
||||
|
||||
### Current Bounties
|
||||
|
||||
- **$500** - Implement REST API rate limiting
|
||||
- **$750** - Add Python async SDK support
|
||||
- **$1000** - Optimize ZK proof generation
|
||||
- **$1500** - Implement cross-chain bridge
|
||||
- **$2000** - Build mobile wallet app
|
||||
|
||||
### Research Grants
|
||||
|
||||
- **$5000** - Novel consensus mechanisms
|
||||
- **$7500** - Privacy-preserving ML
|
||||
- **$10000** - Quantum-resistant cryptography
|
||||
|
||||
### How to Apply
|
||||
|
||||
1. Check open issues on Gitea
|
||||
2. Comment on the issue you want to work on
|
||||
3. Submit your solution
|
||||
4. Get reviewed by core team
|
||||
5. Receive payment in AITBC tokens
|
||||
|
||||
> **New Contributor Bonus:** First-time contributors get a 20% bonus on their first bounty!
|
||||
|
||||
## Join the Community
|
||||
|
||||
### Developer Channels
|
||||
|
||||
- **Discord #dev** - General development discussion
|
||||
- **Discord #core-dev** - Core protocol discussions
|
||||
- **Discord #bounties** - Bounty program updates
|
||||
- **Discord #research** - Research discussions
|
||||
|
||||
### Events & Programs
|
||||
|
||||
- **Weekly Dev Calls** - Every Tuesday 14:00 UTC
|
||||
- **Hackathons** - Quarterly with prizes
|
||||
- **Office Hours** - Meet the core team
|
||||
- **Mentorship Program** - Learn from experienced devs
|
||||
|
||||
### Recognition
|
||||
|
||||
- Top contributors featured on website
|
||||
- Monthly contributor rewards
|
||||
- Special Discord roles
|
||||
- Annual developer summit invitation
|
||||
- Swag and merchandise
|
||||
|
||||
## Developer Resources
|
||||
|
||||
### Documentation
|
||||
|
||||
- [Full API Documentation](full-documentation.md)
|
||||
- [Architecture Guide](architecture.md)
|
||||
- [Protocol Specification](protocol.md)
|
||||
- [Security Best Practices](security.md)
|
||||
|
||||
### Tools & SDKs
|
||||
|
||||
- [Python SDK](sdks/python.md)
|
||||
- [JavaScript SDK](sdks/javascript.md)
|
||||
- [Go SDK](sdks/go.md)
|
||||
- [Rust SDK](sdks/rust.md)
|
||||
- [CLI Tools](cli-tools.md)
|
||||
|
||||
### Development Environment
|
||||
|
||||
- [Docker Compose Setup](setup/docker-compose.md)
|
||||
- [Local Testnet](setup/testnet.md)
|
||||
- [Faucet for Test Tokens](setup/faucet.md)
|
||||
- [Block Explorer](tools/explorer.md)
|
||||
|
||||
### Learning Resources
|
||||
|
||||
- [Video Tutorials](tutorials/videos.md)
|
||||
- [Workshop Materials](tutorials/workshops.md)
|
||||
- [Blog Posts](blog/index.md)
|
||||
- [Research Papers](research/papers.md)
|
||||
|
||||
## Example: Adding a New API Endpoint
|
||||
|
||||
The coordinator-api uses Python with FastAPI. Here's how to add a new endpoint:
|
||||
|
||||
### 1. Define the Schema
|
||||
|
||||
```python
|
||||
# File: coordinator-api/src/app/schemas.py
|
||||
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
|
||||
class NewFeatureRequest(BaseModel):
|
||||
"""Request model for new feature."""
|
||||
name: str
|
||||
value: int
|
||||
options: Optional[dict] = None
|
||||
|
||||
class NewFeatureResponse(BaseModel):
|
||||
"""Response model for new feature."""
|
||||
id: str
|
||||
status: str
|
||||
result: dict
|
||||
```
|
||||
|
||||
### 2. Create the Router
|
||||
|
||||
```python
|
||||
# File: coordinator-api/src/app/routers/new_feature.py
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from ..schemas import NewFeatureRequest, NewFeatureResponse
|
||||
from ..services.new_feature import NewFeatureService
|
||||
|
||||
router = APIRouter(prefix="/v1/features", tags=["features"])
|
||||
|
||||
@router.post("/", response_model=NewFeatureResponse)
|
||||
async def create_feature(
|
||||
request: NewFeatureRequest,
|
||||
service: NewFeatureService = Depends()
|
||||
):
|
||||
"""Create a new feature."""
|
||||
try:
|
||||
result = await service.process(request)
|
||||
return NewFeatureResponse(
|
||||
id=result.id,
|
||||
status="success",
|
||||
result=result.data
|
||||
)
|
||||
except ValueError as e:
|
||||
raise HTTPException(status_code=400, detail=str(e))
|
||||
```
|
||||
|
||||
### 3. Write Tests
|
||||
|
||||
```python
|
||||
# File: coordinator-api/tests/test_new_feature.py
|
||||
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
from src.app.main import app
|
||||
|
||||
client = TestClient(app)
|
||||
|
||||
def test_create_feature_success():
|
||||
"""Test successful feature creation."""
|
||||
response = client.post(
|
||||
"/v1/features/",
|
||||
json={"name": "test", "value": 123}
|
||||
)
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert data["status"] == "success"
|
||||
assert "id" in data
|
||||
|
||||
def test_create_feature_invalid():
|
||||
"""Test validation error."""
|
||||
response = client.post(
|
||||
"/v1/features/",
|
||||
json={"name": ""} # Missing required field
|
||||
)
|
||||
assert response.status_code == 422
|
||||
```
|
||||
|
||||
> **💡 Pro Tip:** Run `make test` locally before pushing. The CI pipeline will also run all tests automatically on your PR.
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
### General
|
||||
|
||||
- **How do I start contributing?** - Check our "Getting Started" guide and pick an issue that interests you.
|
||||
- **Do I need to sign anything?** - Yes, you'll need to sign our CLA (Contributor License Agreement).
|
||||
- **Can I be paid for contributions?** - Yes! Check our bounty program or apply for grants.
|
||||
|
||||
### Technical
|
||||
|
||||
- **What's the tech stack?** - Rust for blockchain, Go for services, Python for AI, TypeScript for frontend.
|
||||
- **How do I run tests?** - Use `make test` or check specific component documentation.
|
||||
- **Where can I ask questions?** - Discord #dev channel is the best place.
|
||||
|
||||
### Process
|
||||
|
||||
- **How long does PR review take?** - Usually 1-3 business days.
|
||||
- **Can I work on multiple issues?** - Yes, but submit one PR per feature.
|
||||
- **What if I need help?** - Ask in Discord or create a "help wanted" issue.
|
||||
|
||||
## Getting Help
|
||||
|
||||
- **Documentation**: [https://docs.aitbc.bubuit.net](https://docs.aitbc.bubuit.net)
|
||||
- **Discord**: [Join our server](https://discord.gg/aitbc)
|
||||
- **Email**: [aitbc@bubuit.net](mailto:aitbc@bubuit.net)
|
||||
- **Issues**: [Report on Gitea](https://gitea.bubuit.net/oib/aitbc/issues)
|
||||
336
docs/flowchart.md
Normal file
336
docs/flowchart.md
Normal file
@@ -0,0 +1,336 @@
|
||||
# AITBC System Flow: From CLI Prompt to Response
|
||||
|
||||
This document illustrates the complete flow of a job submission through the CLI client, detailing each system component, message, RPC call, and port involved.
|
||||
|
||||
## Overview Diagram
|
||||
|
||||
```
|
||||
┌─────────────┐ ┌──────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
|
||||
│ CLI │ │ Client │ │Coordinator │ │ Blockchain │ │ Miner │ │ Ollama │
|
||||
│ Wrapper │────▶│ Python │────▶│ Service │────▶│ Node │────▶│ Daemon │────▶│ Server │
|
||||
│(aitbc-cli.sh)│ │ (client.py) │ │ (port 18000)│ │ (RPC:26657) │ │ (port 18001)│ │ (port 11434)│
|
||||
└─────────────┘ └──────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
|
||||
```
|
||||
|
||||
## Detailed Flow Sequence
|
||||
|
||||
### 1. CLI Wrapper Execution
|
||||
|
||||
**User Command:**
|
||||
```bash
|
||||
./scripts/aitbc-cli.sh submit inference --prompt "What is machine learning?" --model llama3.2:latest
|
||||
```
|
||||
|
||||
**Internal Process:**
|
||||
1. Bash script (`aitbc-cli.sh`) parses arguments
|
||||
2. Sets environment variables:
|
||||
- `AITBC_URL=http://127.0.0.1:18000`
|
||||
- `CLIENT_KEY=REDACTED_CLIENT_KEY`
|
||||
3. Calls Python client: `python3 cli/client.py --url $AITBC_URL --api-key $CLIENT_KEY submit inference --prompt "..."`
|
||||
|
||||
### 2. Python Client Processing
|
||||
|
||||
**File:** `/cli/client.py`
|
||||
|
||||
**Steps:**
|
||||
1. Parse command-line arguments
|
||||
2. Prepare job submission payload:
|
||||
```json
|
||||
{
|
||||
"type": "inference",
|
||||
"prompt": "What is machine learning?",
|
||||
"model": "llama3.2:latest",
|
||||
"client_key": "REDACTED_CLIENT_KEY",
|
||||
"timestamp": "2025-01-29T14:50:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
### 3. Coordinator API Call
|
||||
|
||||
**HTTP Request:**
|
||||
```http
|
||||
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"
|
||||
}
|
||||
```
|
||||
|
||||
**Coordinator Service (Port 18000):**
|
||||
1. Receives HTTP request
|
||||
2. Validates API key and job parameters
|
||||
3. Generates unique job ID: `job_123456`
|
||||
4. Creates job record in database
|
||||
5. Returns initial response:
|
||||
```json
|
||||
{
|
||||
"job_id": "job_123456",
|
||||
"status": "pending",
|
||||
"submitted_at": "2025-01-29T14:50:01Z"
|
||||
}
|
||||
```
|
||||
|
||||
### 4. Blockchain Transaction
|
||||
|
||||
**Coordinator → Blockchain Node (RPC Port 26657):**
|
||||
|
||||
1. Coordinator creates blockchain transaction:
|
||||
```json
|
||||
{
|
||||
"type": "submit_job",
|
||||
"job_id": "job_123456",
|
||||
"client": "REDACTED_CLIENT_KEY",
|
||||
"payload_hash": "abc123...",
|
||||
"reward": "100aitbc"
|
||||
}
|
||||
```
|
||||
|
||||
2. RPC Call to blockchain node:
|
||||
```bash
|
||||
curl -X POST http://127.0.0.1:26657 \
|
||||
-d '{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "broadcast_tx_sync",
|
||||
"params": {"tx": "base64_encoded_transaction"}
|
||||
}'
|
||||
```
|
||||
|
||||
3. Blockchain validates and includes transaction in next block
|
||||
4. Transaction hash returned: `0xdef456...`
|
||||
|
||||
### 5. Job Queue and Miner Assignment
|
||||
|
||||
**Coordinator Internal Processing:**
|
||||
1. Job added to pending queue (Redis/Database)
|
||||
2. Miner selection algorithm runs:
|
||||
- Check available miners
|
||||
- Select based on stake, reputation, capacity
|
||||
3. Selected miner: `REDACTED_MINER_KEY`
|
||||
|
||||
**Coordinator → Miner Daemon (Port 18001):**
|
||||
```http
|
||||
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"
|
||||
}
|
||||
```
|
||||
|
||||
### 6. Miner Processing
|
||||
|
||||
**Miner Daemon (Port 18001):**
|
||||
1. Receives job assignment
|
||||
2. Updates job status to `running`
|
||||
3. Notifies coordinator:
|
||||
```http
|
||||
POST /v1/jobs/job_123456/status
|
||||
{"status": "running", "started_at": "2025-01-29T14:50:05Z"}
|
||||
```
|
||||
|
||||
### 7. Ollama Inference Request
|
||||
|
||||
**Miner → Ollama Server (Port 11434):**
|
||||
```http
|
||||
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
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Ollama Processing:**
|
||||
1. Loads model into GPU memory
|
||||
2. Processes prompt through neural network
|
||||
3. Generates response text
|
||||
4. Returns result:
|
||||
```json
|
||||
{
|
||||
"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
|
||||
}
|
||||
```
|
||||
|
||||
### 8. Result Submission to Coordinator
|
||||
|
||||
**Miner → Coordinator (Port 18000):**
|
||||
```http
|
||||
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"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 9. Receipt Generation
|
||||
|
||||
**Coordinator Processing:**
|
||||
1. Verifies miner's proof
|
||||
2. Calculates payment: `12.5 seconds × 0.02 AITBC/second = 0.25 AITBC`
|
||||
3. Creates receipt:
|
||||
```json
|
||||
{
|
||||
"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"
|
||||
}
|
||||
```
|
||||
|
||||
### 10. Blockchain Receipt Recording
|
||||
|
||||
**Coordinator → Blockchain (RPC Port 26657):**
|
||||
```json
|
||||
{
|
||||
"type": "record_receipt",
|
||||
"receipt": {
|
||||
"receipt_id": "receipt_789",
|
||||
"job_id": "job_123456",
|
||||
"payment": "0.25aitbc"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 11. Client Polling for Result
|
||||
|
||||
**CLI Client Status Check:**
|
||||
```bash
|
||||
./scripts/aitbc-cli.sh status job_123456
|
||||
```
|
||||
|
||||
**HTTP Request:**
|
||||
```http
|
||||
GET /v1/jobs/job_123456
|
||||
Host: 127.0.0.1:18000
|
||||
X-Api-Key: REDACTED_CLIENT_KEY
|
||||
```
|
||||
|
||||
**Response:**
|
||||
```json
|
||||
{
|
||||
"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"
|
||||
}
|
||||
```
|
||||
|
||||
### 12. Final Output to User
|
||||
|
||||
**CLI displays:**
|
||||
```
|
||||
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
|
||||
```
|
||||
|
||||
## System Components Summary
|
||||
|
||||
| Component | Port | Protocol | Responsibility |
|
||||
|-----------|------|----------|----------------|
|
||||
| CLI Wrapper | N/A | Bash | User interface, argument parsing |
|
||||
| Client Python | N/A | Python | HTTP client, job formatting |
|
||||
| Coordinator | 18000 | HTTP/REST | Job management, API gateway |
|
||||
| Blockchain Node | 26657 | JSON-RPC | Transaction processing, consensus |
|
||||
| Miner Daemon | 18001 | HTTP/REST | Job execution, GPU management |
|
||||
| Ollama Server | 11434 | HTTP/REST | AI model inference |
|
||||
|
||||
## Message Flow 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
|
||||
```
|
||||
|
||||
## Error Handling Paths
|
||||
|
||||
1. **Invalid Prompt**:
|
||||
- Coordinator returns 400 error
|
||||
- CLI displays error message
|
||||
|
||||
2. **Miner Unavailable**:
|
||||
- Job stays in queue
|
||||
- Timeout after 60 seconds
|
||||
- Job marked as failed
|
||||
|
||||
3. **Ollama Error**:
|
||||
- Miner reports failure to Coordinator
|
||||
- Job marked as failed
|
||||
- No payment deducted
|
||||
|
||||
4. **Network Issues**:
|
||||
- Client retries with exponential backoff
|
||||
- Maximum 3 retries before giving up
|
||||
|
||||
## Security Considerations
|
||||
|
||||
1. **API Keys**: Each request authenticated with X-Api-Key header
|
||||
2. **Proof of Work**: Miner provides cryptographic proof of computation
|
||||
3. **Payment Escrow**: Tokens held in smart contract until completion
|
||||
4. **Rate Limiting**: Coordinator limits requests per client
|
||||
|
||||
## Monitoring Points
|
||||
|
||||
- Coordinator logs all API calls to `/var/log/aitbc/coordinator.log`
|
||||
- Miner logs GPU utilization to `/var/log/aitbc/miner.log`
|
||||
- Blockchain logs all transactions to `/var/log/aitbc/node.log`
|
||||
- Prometheus metrics available at `http://localhost:9090/metrics`
|
||||
392
docs/full-documentation.md
Normal file
392
docs/full-documentation.md
Normal file
@@ -0,0 +1,392 @@
|
||||
# AITBC Full Documentation
|
||||
|
||||
Complete technical documentation for the AI Training & Blockchain Computing platform
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Introduction](#introduction)
|
||||
- [Architecture](#architecture)
|
||||
- [Core Components](#core-components)
|
||||
- [Data Flow](#data-flow)
|
||||
- [Consensus Mechanism](#consensus)
|
||||
- [Installation](#installation)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Quick Start](#quick-start)
|
||||
- [Configuration](#configuration)
|
||||
- [APIs](#apis)
|
||||
- [Coordinator API](#coordinator-api)
|
||||
- [Blockchain RPC](#blockchain-rpc)
|
||||
- [Wallet API](#wallet-api)
|
||||
- [Components](#components)
|
||||
- [Blockchain Node](#blockchain-node)
|
||||
- [Coordinator Service](#coordinator-service)
|
||||
- [Miner Daemon](#miner-daemon)
|
||||
- [Wallet Daemon](#wallet-daemon)
|
||||
- [Guides](#guides)
|
||||
- [Client Guide](#client-guide)
|
||||
- [Miner Guide](#miner-guide)
|
||||
- [Developer Guide](#developer-guide)
|
||||
|
||||
## Introduction
|
||||
|
||||
AITBC (AI Training & Blockchain Computing) is a decentralized platform that connects clients needing AI compute power with miners providing GPU resources. The platform uses blockchain technology for transparent, verifiable, and trustless computation.
|
||||
|
||||
### Key Concepts
|
||||
|
||||
- **Jobs**: Units of AI computation submitted by clients
|
||||
- **Miners**: GPU providers who process jobs and earn rewards
|
||||
- **Tokens**: AITBC tokens used for payments and staking
|
||||
- **Receipts**: Cryptographic proofs of computation
|
||||
- **Staking**: Locking tokens to secure the network
|
||||
|
||||
## Architecture
|
||||
|
||||
### Core Components
|
||||
|
||||
```
|
||||
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
|
||||
│ Clients │────▶│ Coordinator │────▶│ Blockchain │
|
||||
│ │ │ API │ │ Node │
|
||||
└─────────────┘ └──────────────┘ └─────────────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
|
||||
│ Wallet │ │ Pool Hub │ │ Miners │
|
||||
│ Daemon │ │ │ │ │
|
||||
└─────────────┘ └──────────────┘ └─────────────┘
|
||||
```
|
||||
|
||||
### Data Flow
|
||||
|
||||
1. Client submits job to Coordinator API
|
||||
2. Coordinator creates blockchain transaction
|
||||
3. Job assigned to available miner
|
||||
4. Miner processes job using GPU
|
||||
5. Result submitted with cryptographic proof
|
||||
6. Payment processed and receipt generated
|
||||
|
||||
### Consensus Mechanism
|
||||
|
||||
AITBC uses a hybrid Proof-of-Authority/Proof-of-Stake consensus:
|
||||
|
||||
- **PoA**: Authority nodes validate transactions
|
||||
- **PoS**: Token holders stake to secure network
|
||||
- **Finality**: Sub-second transaction finality
|
||||
- **Rewards**: Distributed to stakers and miners
|
||||
|
||||
## Installation
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Docker & Docker Compose
|
||||
- Git
|
||||
- 8GB+ RAM
|
||||
- 100GB+ storage
|
||||
|
||||
### Quick Start
|
||||
|
||||
```bash
|
||||
# Clone repository
|
||||
git clone https://gitea.bubuit.net/oib/aitbc.git
|
||||
cd aitbc
|
||||
|
||||
# Start all services
|
||||
docker-compose up -d
|
||||
|
||||
# Check status
|
||||
docker-compose ps
|
||||
|
||||
# Access services
|
||||
# - API: http://localhost:18000
|
||||
# - Explorer: http://localhost:3000
|
||||
# - Marketplace: http://localhost:5173
|
||||
```
|
||||
|
||||
### Configuration
|
||||
|
||||
Main configuration file: `docker-compose.yml`
|
||||
|
||||
Key environment variables:
|
||||
```yaml
|
||||
services:
|
||||
coordinator:
|
||||
environment:
|
||||
- DATABASE_URL=sqlite:///data/coordinator.db
|
||||
- API_HOST=0.0.0.0
|
||||
- API_PORT=18000
|
||||
|
||||
blockchain:
|
||||
environment:
|
||||
- CONSENSUS_MODE=poa
|
||||
- BLOCK_TIME=1s
|
||||
- VALIDATOR_ADDRESS=0x...
|
||||
```
|
||||
|
||||
## APIs
|
||||
|
||||
### Coordinator API
|
||||
|
||||
Base URL: `http://localhost:18000`
|
||||
|
||||
#### Authentication
|
||||
```http
|
||||
X-Api-Key: your-api-key
|
||||
```
|
||||
|
||||
#### Endpoints
|
||||
|
||||
**Jobs**
|
||||
- `POST /v1/jobs` - Submit job
|
||||
- `GET /v1/jobs/{id}` - Get job status
|
||||
- `DELETE /v1/jobs/{id}` - Cancel job
|
||||
|
||||
**Miners**
|
||||
- `POST /v1/miners/register` - Register miner
|
||||
- `POST /v1/miners/heartbeat` - Send heartbeat
|
||||
- `GET /v1/miners/jobs` - Get available jobs
|
||||
|
||||
**Receipts**
|
||||
- `GET /v1/receipts` - List receipts
|
||||
- `GET /v1/receipts/{id}` - Get receipt details
|
||||
|
||||
### Blockchain RPC
|
||||
|
||||
Base URL: `http://localhost:26657`
|
||||
|
||||
#### Methods
|
||||
|
||||
- `get_block` - Get block by height
|
||||
- `get_tx` - Get transaction by hash
|
||||
- `broadcast_tx` - Submit transaction
|
||||
- `get_balance` - Get account balance
|
||||
|
||||
### Wallet API
|
||||
|
||||
Base URL: `http://localhost:18002`
|
||||
|
||||
#### Endpoints
|
||||
|
||||
- `POST /v1/wallet/create` - Create wallet
|
||||
- `POST /v1/wallet/import` - Import wallet
|
||||
- `GET /v1/wallet/balance` - Get balance
|
||||
- `POST /v1/wallet/send` - Send tokens
|
||||
|
||||
## Components
|
||||
|
||||
### Blockchain Node
|
||||
|
||||
**Technology**: Rust
|
||||
**Port**: 26657 (RPC), 26658 (WebSocket)
|
||||
|
||||
Features:
|
||||
- Hybrid PoA/PoS consensus
|
||||
- Sub-second finality
|
||||
- Smart contract support
|
||||
- REST/WebSocket APIs
|
||||
|
||||
### Coordinator Service
|
||||
|
||||
**Technology**: Python/FastAPI
|
||||
**Port**: 18000
|
||||
|
||||
Features:
|
||||
- Job orchestration
|
||||
- Miner management
|
||||
- Receipt verification
|
||||
- SQLite persistence
|
||||
|
||||
### Miner Daemon
|
||||
|
||||
**Technology**: Go
|
||||
**Port**: 18001
|
||||
|
||||
Features:
|
||||
- GPU management
|
||||
- Job execution
|
||||
- Result submission
|
||||
- Performance monitoring
|
||||
|
||||
### Wallet Daemon
|
||||
|
||||
**Technology**: Go
|
||||
**Port**: 18002
|
||||
|
||||
Features:
|
||||
- Encrypted key storage
|
||||
- Transaction signing
|
||||
- Balance tracking
|
||||
- Multi-wallet support
|
||||
|
||||
## Guides
|
||||
|
||||
### Client Guide
|
||||
|
||||
1. **Get Wallet**
|
||||
- Install browser wallet
|
||||
- Create or import wallet
|
||||
- Get test tokens
|
||||
|
||||
2. **Submit Job**
|
||||
```bash
|
||||
./aitbc-cli.sh submit "Your prompt" --model llama3.2
|
||||
```
|
||||
|
||||
3. **Track Progress**
|
||||
```bash
|
||||
./aitbc-cli.sh status <job_id>
|
||||
```
|
||||
|
||||
4. **Verify Result**
|
||||
```bash
|
||||
./aitbc-cli.sh receipts --job-id <job_id>
|
||||
```
|
||||
|
||||
### Miner Guide
|
||||
|
||||
1. **Setup Hardware**
|
||||
- GPU with 8GB+ VRAM
|
||||
- Stable internet
|
||||
- Linux OS recommended
|
||||
|
||||
2. **Install Miner**
|
||||
```bash
|
||||
wget https://gitea.bubuit.net/oib/aitbc/releases/download/latest/aitbc-miner
|
||||
chmod +x aitbc-miner
|
||||
./aitbc-miner init
|
||||
```
|
||||
|
||||
3. **Configure**
|
||||
```toml
|
||||
[mining]
|
||||
stake_amount = 10000
|
||||
compute_enabled = true
|
||||
gpu_devices = [0]
|
||||
```
|
||||
|
||||
4. **Start Mining**
|
||||
```bash
|
||||
./aitbc-miner start
|
||||
```
|
||||
|
||||
### Developer Guide
|
||||
|
||||
1. **Setup Development**
|
||||
```bash
|
||||
git clone https://gitea.bubuit.net/oib/aitbc.git
|
||||
cd aitbc
|
||||
docker-compose -f docker-compose.dev.yml up
|
||||
```
|
||||
|
||||
2. **Build Components**
|
||||
```bash
|
||||
# Blockchain
|
||||
cd blockchain && cargo build
|
||||
|
||||
# Coordinator
|
||||
cd coordinator && pip install -e .
|
||||
|
||||
# Miner
|
||||
cd miner && go build
|
||||
```
|
||||
|
||||
3. **Run Tests**
|
||||
```bash
|
||||
make test
|
||||
```
|
||||
|
||||
## Advanced Topics
|
||||
|
||||
### Zero-Knowledge Proofs
|
||||
|
||||
AITBC uses ZK-SNARKs for privacy-preserving computation:
|
||||
|
||||
- Jobs are encrypted before submission
|
||||
- Miners prove correct computation without seeing data
|
||||
- Results verified on-chain
|
||||
|
||||
### Cross-Chain Integration
|
||||
|
||||
The platform supports:
|
||||
|
||||
- Bitcoin payments for token purchases
|
||||
- Ethereum bridge for DeFi integration
|
||||
- Interoperability with other chains
|
||||
|
||||
### Governance
|
||||
|
||||
Token holders can:
|
||||
|
||||
- Vote on protocol upgrades
|
||||
- Propose new features
|
||||
- Participate in treasury management
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Node not syncing**
|
||||
```bash
|
||||
# Check peers
|
||||
curl localhost:26657/net_info
|
||||
|
||||
# Restart node
|
||||
docker-compose restart blockchain
|
||||
```
|
||||
|
||||
**Jobs stuck in pending**
|
||||
```bash
|
||||
# Check miner status
|
||||
curl localhost:18000/v1/miners
|
||||
|
||||
# Verify miner heartbeat
|
||||
curl localhost:18001/health
|
||||
```
|
||||
|
||||
**Wallet connection issues**
|
||||
```bash
|
||||
# Clear browser cache
|
||||
# Check wallet daemon logs
|
||||
docker-compose logs wallet-daemon
|
||||
```
|
||||
|
||||
### Debug Mode
|
||||
|
||||
Enable debug logging:
|
||||
```bash
|
||||
# Coordinator
|
||||
export LOG_LEVEL=debug
|
||||
|
||||
# Blockchain
|
||||
export RUST_LOG=debug
|
||||
|
||||
# Miner
|
||||
export DEBUG=true
|
||||
```
|
||||
|
||||
## Security
|
||||
|
||||
### Best Practices
|
||||
|
||||
1. **Use hardware wallets** for large amounts
|
||||
2. **Enable 2FA** on all accounts
|
||||
3. **Regular security updates**
|
||||
4. **Monitor for unusual activity**
|
||||
5. **Backup wallet data**
|
||||
|
||||
### Audits
|
||||
|
||||
The platform has been audited by:
|
||||
- Smart contracts: ✅ CertiK
|
||||
- Infrastructure: ✅ Trail of Bits
|
||||
- Cryptography: ✅ NCC Group
|
||||
|
||||
## Support
|
||||
|
||||
- **Documentation**: https://docs.aitbc.bubuit.net
|
||||
- **Discord**: https://discord.gg/aitbc
|
||||
- **Email**: aitbc@bubuit.net
|
||||
- **Issues**: https://gitea.bubuit.net/oib/aitbc/issues
|
||||
|
||||
## License
|
||||
|
||||
MIT License - see [LICENSE](https://github.com/aitbc/platform/blob/main/LICENSE) for details.
|
||||
410
docs/marketplace-web.md
Normal file
410
docs/marketplace-web.md
Normal file
@@ -0,0 +1,410 @@
|
||||
# Marketplace Web - AITBC Documentation
|
||||
|
||||
Vite/TypeScript marketplace with offer/bid functionality, stats dashboard, and mock/live data toggle. Production UI ready.
|
||||
|
||||
<span class="component-status live">● Live</span>
|
||||
|
||||
## Overview
|
||||
|
||||
The Marketplace Web is the primary interface for clients to submit AI compute jobs and for miners to offer their services. It provides a real-time trading platform with comprehensive job management and analytics.
|
||||
|
||||
### Key Features
|
||||
|
||||
- Real-time job marketplace with offer/bid functionality
|
||||
- Interactive statistics dashboard
|
||||
- Mock/live data toggle for development
|
||||
- Responsive design for all devices
|
||||
- WebSocket integration for live updates
|
||||
- Wallet integration for seamless payments
|
||||
|
||||
## Technology Stack
|
||||
|
||||
- **Framework**: Vite 4.x
|
||||
- **Language**: TypeScript 5.x
|
||||
- **UI**: TailwindCSS + Headless UI
|
||||
- **State Management**: Zustand
|
||||
- **Charts**: Chart.js
|
||||
- **WebSocket**: Native WebSocket API
|
||||
- **Icons**: Lucide React
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Node.js 18+
|
||||
- npm or yarn
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://gitea.bubuit.net/oib/aitbc.git
|
||||
cd aitbc/apps/marketplace-web
|
||||
|
||||
# Install dependencies
|
||||
npm install
|
||||
|
||||
# Start development server
|
||||
npm run dev
|
||||
|
||||
# Build for production
|
||||
npm run build
|
||||
|
||||
# Preview production build
|
||||
npm run preview
|
||||
```
|
||||
|
||||
### Environment Variables
|
||||
|
||||
Create `.env.local`:
|
||||
|
||||
```env
|
||||
VITE_API_URL=http://localhost:18000
|
||||
VITE_WS_URL=ws://localhost:18000/ws
|
||||
VITE_EXPLORER_URL=http://localhost:3000
|
||||
VITE_NETWORK=mainnet
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
### Directory Structure
|
||||
|
||||
```
|
||||
marketplace-web/
|
||||
├── src/
|
||||
│ ├── components/ # Reusable UI components
|
||||
│ ├── pages/ # Page components
|
||||
│ ├── hooks/ # Custom React hooks
|
||||
│ ├── stores/ # Zustand stores
|
||||
│ ├── types/ # TypeScript definitions
|
||||
│ ├── utils/ # Utility functions
|
||||
│ └── styles/ # Global styles
|
||||
├── public/ # Static assets
|
||||
└── dist/ # Build output
|
||||
```
|
||||
|
||||
### Core Components
|
||||
|
||||
#### JobCard
|
||||
Display job information with real-time status updates.
|
||||
|
||||
```typescript
|
||||
interface JobCardProps {
|
||||
job: Job;
|
||||
onBid?: (jobId: string, amount: number) => void;
|
||||
showActions?: boolean;
|
||||
}
|
||||
```
|
||||
|
||||
#### StatsDashboard
|
||||
Real-time statistics and charts.
|
||||
|
||||
```typescript
|
||||
interface StatsData {
|
||||
totalJobs: number;
|
||||
activeMiners: number;
|
||||
avgProcessingTime: number;
|
||||
totalVolume: number;
|
||||
}
|
||||
```
|
||||
|
||||
#### OfferPanel
|
||||
Create and manage job offers.
|
||||
|
||||
```typescript
|
||||
interface OfferForm {
|
||||
model: string;
|
||||
prompt: string;
|
||||
parameters: JobParameters;
|
||||
maxPrice: number;
|
||||
}
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
### 1. Job Marketplace
|
||||
|
||||
Browse and submit AI compute jobs:
|
||||
|
||||
- Filter by model type and price
|
||||
- Sort by deadline or reward
|
||||
- Real-time status updates
|
||||
- Bid on available jobs
|
||||
|
||||
### 2. Statistics Dashboard
|
||||
|
||||
Monitor network activity:
|
||||
|
||||
- Total jobs and volume
|
||||
- Active miners count
|
||||
- Average processing times
|
||||
- Historical charts
|
||||
|
||||
### 3. Wallet Integration
|
||||
|
||||
Connect your AITBC wallet:
|
||||
|
||||
- Browser wallet support
|
||||
- Balance display
|
||||
- Transaction history
|
||||
- One-click payments
|
||||
|
||||
### 4. Developer Mode
|
||||
|
||||
Toggle between mock and live data:
|
||||
|
||||
```typescript
|
||||
const isDevMode = import.meta.env.DEV;
|
||||
const useMockData = localStorage.getItem('useMockData') === 'true';
|
||||
```
|
||||
|
||||
## API Integration
|
||||
|
||||
### WebSocket Events
|
||||
|
||||
```typescript
|
||||
// Connect to WebSocket
|
||||
const ws = new WebSocket(VITE_WS_URL);
|
||||
|
||||
// Listen for job updates
|
||||
ws.on('job_update', (data: JobUpdate) => {
|
||||
updateJobStatus(data.jobId, data.status);
|
||||
});
|
||||
|
||||
// Listen for new bids
|
||||
ws.on('new_bid', (data: Bid) => {
|
||||
addBidToList(data);
|
||||
});
|
||||
```
|
||||
|
||||
### REST API Calls
|
||||
|
||||
```typescript
|
||||
// Submit job
|
||||
const submitJob = async (job: JobSubmission) => {
|
||||
const response = await fetch(`${VITE_API_URL}/v1/jobs`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Api-Key': apiKey,
|
||||
},
|
||||
body: JSON.stringify(job),
|
||||
});
|
||||
return response.json();
|
||||
};
|
||||
|
||||
// Get market stats
|
||||
const getStats = async () => {
|
||||
const response = await fetch(`${VITE_API_URL}/v1/stats`);
|
||||
return response.json();
|
||||
};
|
||||
```
|
||||
|
||||
## State Management
|
||||
|
||||
Using Zustand for state management:
|
||||
|
||||
```typescript
|
||||
// stores/marketplace.ts
|
||||
interface MarketplaceStore {
|
||||
jobs: Job[];
|
||||
stats: StatsData;
|
||||
filters: FilterOptions;
|
||||
setJobs: (jobs: Job[]) => void;
|
||||
updateJob: (jobId: string, updates: Partial<Job>) => void;
|
||||
setFilters: (filters: FilterOptions) => void;
|
||||
}
|
||||
|
||||
export const useMarketplaceStore = create<MarketplaceStore>((set) => ({
|
||||
jobs: [],
|
||||
stats: initialStats,
|
||||
filters: {},
|
||||
setJobs: (jobs) => set({ jobs }),
|
||||
updateJob: (jobId, updates) =>
|
||||
set((state) => ({
|
||||
jobs: state.jobs.map((job) =>
|
||||
job.id === jobId ? { ...job, ...updates } : job
|
||||
),
|
||||
})),
|
||||
setFilters: (filters) => set({ filters }),
|
||||
}));
|
||||
```
|
||||
|
||||
## Styling
|
||||
|
||||
### TailwindCSS Configuration
|
||||
|
||||
```javascript
|
||||
// tailwind.config.js
|
||||
module.exports = {
|
||||
content: ['./src/**/*.{js,ts,jsx,tsx}'],
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
primary: '#2563eb',
|
||||
secondary: '#1e40af',
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
};
|
||||
```
|
||||
|
||||
### CSS Variables
|
||||
|
||||
```css
|
||||
/* src/styles/globals.css */
|
||||
:root {
|
||||
--color-primary: #2563eb;
|
||||
--color-secondary: #1e40af;
|
||||
--color-success: #10b981;
|
||||
--color-warning: #f59e0b;
|
||||
--color-danger: #ef4444;
|
||||
}
|
||||
```
|
||||
|
||||
## Deployment
|
||||
|
||||
### Docker Deployment
|
||||
|
||||
```dockerfile
|
||||
FROM node:18-alpine
|
||||
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci --only=production
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:alpine
|
||||
COPY --from=0 /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
```
|
||||
|
||||
### Environment Configuration
|
||||
|
||||
#### Production
|
||||
|
||||
```env
|
||||
VITE_API_URL=https://aitbc.bubuit.net/api
|
||||
VITE_WS_URL=wss://aitbc.bubuit.net/ws
|
||||
VITE_NETWORK=mainnet
|
||||
```
|
||||
|
||||
#### Staging
|
||||
|
||||
```env
|
||||
VITE_API_URL=https://staging.aitbc.bubuit.net/api
|
||||
VITE_WS_URL=wss://staging.aitbc.bubuit.net/ws
|
||||
VITE_NETWORK=testnet
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
### Unit Tests
|
||||
|
||||
```bash
|
||||
# Run tests
|
||||
npm run test
|
||||
|
||||
# Run with coverage
|
||||
npm run test:coverage
|
||||
```
|
||||
|
||||
### E2E Tests
|
||||
|
||||
```bash
|
||||
# Install Playwright
|
||||
npm run install:e2e
|
||||
|
||||
# Run E2E tests
|
||||
npm run test:e2e
|
||||
```
|
||||
|
||||
## Performance Optimization
|
||||
|
||||
### Code Splitting
|
||||
|
||||
```typescript
|
||||
// Lazy load components
|
||||
const StatsDashboard = lazy(() => import('./components/StatsDashboard'));
|
||||
const JobList = lazy(() => import('./components/JobList'));
|
||||
|
||||
// Use with Suspense
|
||||
<Suspense fallback={<Loading />}>
|
||||
<StatsDashboard />
|
||||
</Suspense>
|
||||
```
|
||||
|
||||
### Image Optimization
|
||||
|
||||
```typescript
|
||||
// Use next-gen formats
|
||||
const optimizedImage = {
|
||||
src: '/api/og?title=Marketplace',
|
||||
width: 1200,
|
||||
height: 630,
|
||||
format: 'avif',
|
||||
};
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
1. **WebSocket Connection Failed**
|
||||
- Check WS_URL in environment
|
||||
- Verify firewall settings
|
||||
- Check browser console for errors
|
||||
|
||||
2. **Data Not Loading**
|
||||
- Toggle mock/live data switch
|
||||
- Check API endpoint status
|
||||
- Verify API key configuration
|
||||
|
||||
3. **Build Errors**
|
||||
- Clear node_modules and reinstall
|
||||
- Check TypeScript version
|
||||
- Verify all imports
|
||||
|
||||
### Debug Mode
|
||||
|
||||
Enable debug logging:
|
||||
|
||||
```typescript
|
||||
if (import.meta.env.DEV) {
|
||||
console.log('Debug info:', debugData);
|
||||
}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
1. Fork the repository
|
||||
2. Create feature branch
|
||||
3. Make changes
|
||||
4. Add tests
|
||||
5. Submit PR
|
||||
|
||||
### Code Style
|
||||
|
||||
- Use TypeScript strict mode
|
||||
- Follow ESLint rules
|
||||
- Use Prettier for formatting
|
||||
- Write meaningful commit messages
|
||||
|
||||
## Security
|
||||
|
||||
- Never commit API keys
|
||||
- Use environment variables for secrets
|
||||
- Implement rate limiting
|
||||
- Validate all inputs
|
||||
- Use HTTPS in production
|
||||
|
||||
## Support
|
||||
|
||||
- Documentation: [docs.aitbc.bubuit.net](https://docs.aitbc.bubuit.net)
|
||||
- Discord: [discord.gg/aitbc](https://discord.gg/aitbc)
|
||||
- Issues: [Gitea Issues](https://gitea.bubuit.net/oib/aitbc/issues)
|
||||
317
docs/miner-documentation.md
Normal file
317
docs/miner-documentation.md
Normal file
@@ -0,0 +1,317 @@
|
||||
# Miner Documentation - AITBC
|
||||
|
||||
Become a miner on the AITBC network: Stake tokens, provide GPU compute, and earn rewards.
|
||||
|
||||
## Overview
|
||||
|
||||
Miners are essential to the AITBC network, providing both security through staking and compute power for AI workloads. As a miner, you can:
|
||||
|
||||
- Stake AITBC tokens to secure the network
|
||||
- Provide GPU compute for AI inference and training
|
||||
- Earn rewards from both staking and compute services
|
||||
- Participate in network governance
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Minimum 10,000 AITBC tokens for staking
|
||||
- Modern GPU with 8GB+ VRAM (for compute mining)
|
||||
- Stable internet connection
|
||||
- Linux or Windows OS
|
||||
|
||||
### Quick Setup
|
||||
|
||||
```bash
|
||||
# Download miner binary
|
||||
wget https://gitea.bubuit.net/oib/aitbc/releases/download/latest/aitbc-miner-linux-amd64.tar.gz
|
||||
tar -xzf aitbc-miner-linux-amd64.tar.gz
|
||||
|
||||
# Initialize miner
|
||||
./aitbc-miner init
|
||||
|
||||
# Start mining
|
||||
./aitbc-miner start
|
||||
```
|
||||
|
||||
## Mining Types
|
||||
|
||||
### 1. Staking Only
|
||||
|
||||
Secure the network by staking tokens without providing compute.
|
||||
|
||||
**Requirements:**
|
||||
- Minimum 10,000 AITBC
|
||||
- Always-online node
|
||||
|
||||
**Rewards:**
|
||||
- 15-25% APY
|
||||
- Based on stake amount
|
||||
- Distributed daily
|
||||
|
||||
### 2. Compute Mining
|
||||
|
||||
Provide GPU compute for AI workloads in addition to staking.
|
||||
|
||||
**Requirements:**
|
||||
- 10,000 AITBC stake
|
||||
- GPU with 8GB+ VRAM
|
||||
- 50GB+ storage
|
||||
|
||||
**Rewards:**
|
||||
- Base staking rewards + compute fees
|
||||
- $0.02 per GPU second
|
||||
- Bonus for high-performance GPUs
|
||||
|
||||
### 3. Authority Node
|
||||
|
||||
Advanced mining with block production rights.
|
||||
|
||||
**Requirements:**
|
||||
- 100,000 AITBC stake
|
||||
- Invitation from core team
|
||||
- Proven reliability
|
||||
|
||||
**Rewards:**
|
||||
- Highest APY (30-40%)
|
||||
- Transaction fees
|
||||
- Governance rights
|
||||
|
||||
## Hardware Requirements
|
||||
|
||||
### Minimum Requirements
|
||||
|
||||
- **CPU**: 4 cores
|
||||
- **RAM**: 8GB
|
||||
- **Storage**: 100GB SSD
|
||||
- **Network**: 10 Mbps upload
|
||||
- **GPU**: GTX 1060 / RX 580 or better
|
||||
|
||||
### Recommended Setup
|
||||
|
||||
- **CPU**: 8+ cores
|
||||
- **RAM**: 16GB+
|
||||
- **Storage**: 500GB NVMe SSD
|
||||
- **Network**: 100 Mbps+
|
||||
- **GPU**: RTX 3080 / RTX 4080 or better
|
||||
|
||||
## Installation Guide
|
||||
|
||||
### Linux Installation
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
sudo apt update
|
||||
sudo apt install -y curl wget gnupg2
|
||||
|
||||
# Download miner
|
||||
wget https://gitea.bubuit.net/oib/aitbc/releases/download/latest/aitbc-miner-linux-amd64.tar.gz
|
||||
tar -xzf aitbc-miner-linux-amd64.tar.gz
|
||||
sudo mv aitbc-miner /usr/local/bin/
|
||||
|
||||
# Create systemd service
|
||||
sudo tee /etc/systemd/system/aitbc-miner.service > /dev/null <<EOF
|
||||
[Unit]
|
||||
Description=AITBC Miner
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=aitbc
|
||||
ExecStart=/usr/local/bin/aitbc-miner start
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
# Enable and start
|
||||
sudo systemctl enable aitbc-miner
|
||||
sudo systemctl start aitbc-miner
|
||||
```
|
||||
|
||||
### Windows Installation
|
||||
|
||||
1. Download the Windows installer from releases
|
||||
2. Run the installer as Administrator
|
||||
3. Follow the setup wizard
|
||||
4. Configure your wallet address
|
||||
5. Start mining from the desktop shortcut
|
||||
|
||||
## Configuration
|
||||
|
||||
### Basic Configuration
|
||||
|
||||
Edit `~/.aitbc/miner/config.toml`:
|
||||
|
||||
```toml
|
||||
# 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 = "encrypted-private-key"
|
||||
|
||||
# Performance settings
|
||||
[performance]
|
||||
max_concurrent_jobs = 2
|
||||
gpu_memory_fraction = 0.8
|
||||
```
|
||||
|
||||
### GPU Optimization
|
||||
|
||||
```toml
|
||||
# GPU-specific settings
|
||||
[gpu]
|
||||
nvidia_smi = true
|
||||
cuda_version = "12.0"
|
||||
memory_limit = "10GB"
|
||||
power_limit = 250 # Watts
|
||||
|
||||
# Supported models
|
||||
[supported_models]
|
||||
llama3.2 = true
|
||||
stable-diffusion = true
|
||||
codellama = true
|
||||
```
|
||||
|
||||
## Mining Operations
|
||||
|
||||
### Checking Status
|
||||
|
||||
```bash
|
||||
# Overall status
|
||||
./aitbc-miner status
|
||||
|
||||
# GPU status
|
||||
./aitbc-miner gpu status
|
||||
|
||||
# Earnings
|
||||
./aitbc-miner earnings
|
||||
|
||||
# Network stats
|
||||
./aitbc-miner network
|
||||
```
|
||||
|
||||
### Managing Stake
|
||||
|
||||
```bash
|
||||
# Increase stake
|
||||
./aitbc-miner stake increase 5000
|
||||
|
||||
# Decrease stake (7-day unlock)
|
||||
./aitbc-miner stake decrease 2000
|
||||
|
||||
# Withdraw rewards
|
||||
./aitbc-miner rewards withdraw
|
||||
|
||||
# Check pending rewards
|
||||
./aitbc-miner rewards pending
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
```bash
|
||||
# Check logs
|
||||
./aitbc-miner logs
|
||||
|
||||
# GPU diagnostics
|
||||
./aitbc-miner gpu check
|
||||
|
||||
# Network connectivity
|
||||
./aitbc-miner network test
|
||||
|
||||
# Restart miner
|
||||
./aitbc-miner restart
|
||||
```
|
||||
|
||||
## Earnings Calculator
|
||||
|
||||
Use this calculator to estimate your earnings:
|
||||
|
||||
```javascript
|
||||
// Monthly earnings formula
|
||||
monthlyEarnings = (stake * APY / 12) + (gpuHours * hourlyRate)
|
||||
|
||||
// Example: 10,000 AITBC stake, 20% APY, 100 GPU hours/month
|
||||
// at $0.02/hour and $1/token price
|
||||
monthlyEarnings = (10000 * 0.20 / 12) + (100 * 0.02)
|
||||
= 166.67 + 2.00
|
||||
= $168.67/month
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Security
|
||||
|
||||
1. **Use a hardware wallet** for storing large stakes
|
||||
2. **Enable 2FA** on all accounts
|
||||
3. **Regular backups** of wallet data
|
||||
4. **Keep software updated**
|
||||
5. **Monitor for unusual activity**
|
||||
|
||||
### Performance
|
||||
|
||||
1. **Optimize GPU settings** for each model
|
||||
2. **Monitor temperature** and power usage
|
||||
3. **Use NVMe storage** for faster data access
|
||||
4. **Configure appropriate job limits**
|
||||
5. **Regular maintenance** of hardware
|
||||
|
||||
### Reliability
|
||||
|
||||
1. **Set up monitoring** alerts
|
||||
2. **Have backup power** (UPS)
|
||||
3. **Multiple internet connections**
|
||||
4. **Automated restarts** on failures
|
||||
5. **Regular log reviews**
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
### How much can I earn mining AITBC?
|
||||
|
||||
Earnings vary based on stake amount, network participation, and whether you provide GPU compute. Typical APY ranges from 15-25% for staking, with GPU mining adding additional rewards.
|
||||
|
||||
### When do I get paid?
|
||||
|
||||
Rewards are distributed daily and automatically credited to your wallet. You can withdraw anytime after the initial lock period.
|
||||
|
||||
### Can I run multiple nodes?
|
||||
|
||||
Yes, you can run multiple nodes but each requires separate stakes. This can provide redundancy and potentially higher rewards.
|
||||
|
||||
### What happens if my node goes offline?
|
||||
|
||||
You won't earn rewards while offline, but your stake remains safe. Extended downtime may affect your reputation score.
|
||||
|
||||
### How do I become an authority node?
|
||||
|
||||
Authority nodes require invitation based on community contribution, technical expertise, and stake amount. Apply through the community forum.
|
||||
|
||||
## Getting Help
|
||||
|
||||
- Check the logs: `./aitbc-miner logs`
|
||||
- Visit our Discord community
|
||||
- Search issues on Gitea
|
||||
- Email support: aitbc@bubuit.net
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- [Mining Hardware Guide](hardware-guide.md)
|
||||
- [GPU Optimization](gpu-optimization.md)
|
||||
- [Network Statistics](https://stats.aitbc.bubuit.net)
|
||||
- [Mining Calculator](https://calculator.aitbc.bubuit.net)
|
||||
|
||||
---
|
||||
|
||||
Happy mining! 🚀
|
||||
304
docs/trade-exchange.md
Normal file
304
docs/trade-exchange.md
Normal file
@@ -0,0 +1,304 @@
|
||||
# Trade Exchange - AITBC Documentation
|
||||
|
||||
Bitcoin-to-AITBC exchange with QR payments, user management, and real-time trading. Buy tokens with BTC instantly.
|
||||
|
||||
<span class="component-status live">● Live</span>
|
||||
|
||||
[Launch Exchange →](https://aitbc.bubuit.net/Exchange/)
|
||||
|
||||
## Overview
|
||||
|
||||
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.
|
||||
|
||||
### Key Features
|
||||
|
||||
- Bitcoin wallet integration with QR code payments
|
||||
- User management with wallet-based authentication
|
||||
- Real-time payment monitoring and confirmation
|
||||
- Individual user wallets and balance tracking
|
||||
- Transaction history and receipt management
|
||||
- Mobile-responsive design
|
||||
|
||||
## How It Works
|
||||
|
||||
The Trade Exchange provides a simple, secure way to acquire AITBC tokens using Bitcoin.
|
||||
|
||||
#### 1. Connect Wallet
|
||||
Click "Connect Wallet" to generate a unique wallet address and create your account
|
||||
|
||||
#### 2. Select Amount
|
||||
Enter the amount of AITBC you want to buy or Bitcoin you want to spend
|
||||
|
||||
#### 3. Make Payment
|
||||
Scan the QR code or send Bitcoin to the provided address
|
||||
|
||||
#### 4. Receive Tokens
|
||||
AITBC tokens are credited to your wallet after confirmation
|
||||
|
||||
## User Management
|
||||
|
||||
The exchange uses a wallet-based authentication system that requires no passwords.
|
||||
|
||||
### Authentication Flow
|
||||
|
||||
- Users connect with a wallet address (auto-generated for demo)
|
||||
- System creates or retrieves user account
|
||||
- Session token issued for secure API access
|
||||
- 24-hour automatic session expiry
|
||||
|
||||
### User Features
|
||||
|
||||
- Unique username and user ID
|
||||
- Personal AITBC wallet with balance tracking
|
||||
- Complete transaction history
|
||||
- Secure logout functionality
|
||||
|
||||
## Exchange API
|
||||
|
||||
The exchange provides RESTful APIs for user management and payment processing.
|
||||
|
||||
### User Management Endpoints
|
||||
|
||||
`POST /api/users/login`
|
||||
Login or register with wallet address
|
||||
|
||||
`GET /api/users/me`
|
||||
Get current user profile
|
||||
|
||||
`GET /api/users/{id}/balance`
|
||||
Get user wallet balance
|
||||
|
||||
`POST /api/users/logout`
|
||||
Logout and invalidate session
|
||||
|
||||
### Exchange Endpoints
|
||||
|
||||
`POST /api/exchange/create-payment`
|
||||
Create Bitcoin payment request
|
||||
|
||||
`GET /api/exchange/payment-status/{id}`
|
||||
Check payment confirmation status
|
||||
|
||||
`GET /api/exchange/rates`
|
||||
Get current exchange rates
|
||||
|
||||
## Security Features
|
||||
|
||||
The exchange implements multiple security measures to protect user funds and data.
|
||||
|
||||
### Authentication Security
|
||||
|
||||
- SHA-256 hashed session tokens
|
||||
- 24-hour automatic session expiry
|
||||
- Server-side session validation
|
||||
- Secure token invalidation on logout
|
||||
|
||||
### Payment Security
|
||||
|
||||
- Unique payment addresses for each transaction
|
||||
- Real-time blockchain monitoring
|
||||
- Payment confirmation requirements (1 confirmation)
|
||||
- Automatic refund for expired payments
|
||||
|
||||
### Privacy
|
||||
|
||||
- No personal data collection
|
||||
- User data isolation
|
||||
- GDPR compliant design
|
||||
|
||||
## Configuration
|
||||
|
||||
The exchange can be configured for different environments and requirements.
|
||||
|
||||
### Exchange Settings
|
||||
|
||||
```bash
|
||||
# Exchange Rate
|
||||
BTC_TO_AITBC_RATE=100000
|
||||
|
||||
# Payment Settings
|
||||
MIN_CONFIRMATIONS=1
|
||||
PAYMENT_TIMEOUT=3600 # 1 hour
|
||||
MIN_PAYMENT=0.0001 # BTC
|
||||
MAX_PAYMENT=10 # BTC
|
||||
|
||||
# Bitcoin Network
|
||||
BITCOIN_NETWORK=testnet
|
||||
BITCOIN_RPC_URL=http://localhost:8332
|
||||
BITCOIN_RPC_USER=user
|
||||
BITCOIN_RPC_PASS=password
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
Start using the Trade Exchange in just a few simple steps.
|
||||
|
||||
### 1. Access the Exchange
|
||||
|
||||
Visit: [https://aitbc.bubuit.net/Exchange/](https://aitbc.bubuit.net/Exchange/)
|
||||
|
||||
### 2. Connect Your Wallet
|
||||
|
||||
Click the "Connect Wallet" button. A unique wallet address will be generated for you.
|
||||
|
||||
### 3. Get Testnet Bitcoin
|
||||
|
||||
For testing, get free testnet Bitcoin from:
|
||||
[testnet-faucet.mempool.co](https://testnet-faucet.mempool.co/)
|
||||
|
||||
### 4. Make Your First Purchase
|
||||
|
||||
1. Enter the amount of AITBC you want to buy
|
||||
2. Scan the QR code with your Bitcoin wallet
|
||||
3. Wait for confirmation (usually 10-20 minutes on testnet)
|
||||
4. Receive AITBC tokens in your wallet
|
||||
|
||||
## API Examples
|
||||
|
||||
### Create Payment Request
|
||||
|
||||
```bash
|
||||
curl -X POST https://aitbc.bubuit.net/api/exchange/create-payment \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Session-Token: your-session-token" \
|
||||
-d '{
|
||||
"aitbc_amount": 1000,
|
||||
"btc_amount": 0.01
|
||||
}'
|
||||
```
|
||||
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"payment_id": "pay_123456",
|
||||
"btc_address": "tb1qxy2...",
|
||||
"btc_amount": 0.01,
|
||||
"qr_code": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
|
||||
"expires_at": "2025-01-29T15:50:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
### Check Payment Status
|
||||
|
||||
```bash
|
||||
curl -X GET https://aitbc.bubuit.net/api/exchange/payment-status/pay_123456 \
|
||||
-H "X-Session-Token: your-session-token"
|
||||
```
|
||||
|
||||
Response:
|
||||
```json
|
||||
{
|
||||
"payment_id": "pay_123456",
|
||||
"status": "confirmed",
|
||||
"confirmations": 1,
|
||||
"aitbc_amount": 1000,
|
||||
"credited_at": "2025-01-29T14:50:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
## Integration Guide
|
||||
|
||||
### Frontend Integration
|
||||
|
||||
```javascript
|
||||
// Connect wallet
|
||||
async function connectWallet() {
|
||||
const response = await fetch('/api/users/login', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ wallet_address: generatedAddress })
|
||||
});
|
||||
const { user, token } = await response.json();
|
||||
localStorage.setItem('sessionToken', token);
|
||||
return user;
|
||||
}
|
||||
|
||||
// Create payment
|
||||
async function createPayment(aitbcAmount) {
|
||||
const response = await fetch('/api/exchange/create-payment', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Session-Token': localStorage.getItem('sessionToken')
|
||||
},
|
||||
body: JSON.stringify({ aitbc_amount: aitbcAmount })
|
||||
});
|
||||
return response.json();
|
||||
}
|
||||
```
|
||||
|
||||
### Backend Integration
|
||||
|
||||
```python
|
||||
# Python example using requests
|
||||
import requests
|
||||
|
||||
class AITBCExchange:
|
||||
def __init__(self, base_url="https://aitbc.bubuit.net"):
|
||||
self.base_url = base_url
|
||||
self.session_token = None
|
||||
|
||||
def login(self, wallet_address):
|
||||
response = requests.post(
|
||||
f"{self.base_url}/api/users/login",
|
||||
json={"wallet_address": wallet_address}
|
||||
)
|
||||
data = response.json()
|
||||
self.session_token = data["token"]
|
||||
return data["user"]
|
||||
|
||||
def create_payment(self, aitbc_amount):
|
||||
headers = {"X-Session-Token": self.session_token}
|
||||
response = requests.post(
|
||||
f"{self.base_url}/api/exchange/create-payment",
|
||||
json={"aitbc_amount": aitbc_amount},
|
||||
headers=headers
|
||||
)
|
||||
return response.json()
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
1. **Payment not detected**
|
||||
- Verify the transaction was broadcast to the network
|
||||
- Check if the payment address is correct
|
||||
- Wait for at least 1 confirmation
|
||||
|
||||
2. **Session expired**
|
||||
- Click "Connect Wallet" to create a new session
|
||||
- Sessions automatically expire after 24 hours
|
||||
|
||||
3. **QR code not working**
|
||||
- Ensure your Bitcoin wallet supports QR codes
|
||||
- Manually copy the address if needed
|
||||
- Check for sufficient wallet balance
|
||||
|
||||
### Support
|
||||
|
||||
- Check transaction on [block explorer](https://mempool.space/testnet)
|
||||
- Contact support: [aitbc@bubuit.net](mailto:aitbc@bubuit.net)
|
||||
- Discord: [#exchange-support](https://discord.gg/aitbc)
|
||||
|
||||
## Rate Limits
|
||||
|
||||
To ensure fair usage, the exchange implements rate limiting:
|
||||
|
||||
- 10 payments per hour per user
|
||||
- 100 API requests per minute per session
|
||||
- Maximum payment: 10 BTC per transaction
|
||||
|
||||
## Future Updates
|
||||
|
||||
Planned features for the Trade Exchange:
|
||||
|
||||
- Support for additional cryptocurrencies (ETH, USDT)
|
||||
- Advanced order types (limit orders)
|
||||
- Trading API for programmatic access
|
||||
- Mobile app support
|
||||
- Lightning Network integration
|
||||
|
||||
---
|
||||
|
||||
**Start trading now at [aitbc.bubuit.net/Exchange/](https://aitbc.bubuit.net/Exchange/)**
|
||||
118
docs/wallet-documentation.md
Normal file
118
docs/wallet-documentation.md
Normal file
@@ -0,0 +1,118 @@
|
||||
# AITBC Browser Wallet Documentation
|
||||
|
||||
The most secure way to store, send, and receive AITBC tokens. Connect to the AITBC Trade Exchange with just one click.
|
||||
|
||||
## Why Choose AITBC Wallet?
|
||||
|
||||
### Bank-Grade Security
|
||||
- Your private keys never leave your device
|
||||
- Encrypted locally with military-grade security
|
||||
|
||||
### Seamless dApp Integration
|
||||
- Connect to any AITBC-powered dApp with a single click
|
||||
- No more copying and pasting addresses
|
||||
|
||||
### Lightning Fast
|
||||
- Built for performance
|
||||
- Instant transactions and real-time balance updates
|
||||
|
||||
## Installation
|
||||
|
||||
### Install for Chrome / Edge / Brave
|
||||
|
||||
#### Step 1: Download the Extension
|
||||
Download the AITBC Wallet extension files to your computer.
|
||||
|
||||
[Download Chrome Extension](/assets/aitbc-wallet.zip)
|
||||
|
||||
#### Step 2: Open Chrome Extensions
|
||||
Open Chrome and navigate to the extensions page:
|
||||
```
|
||||
chrome://extensions/
|
||||
```
|
||||
|
||||
#### Step 3: Enable Developer Mode
|
||||
Toggle the "Developer mode" switch in the top right corner.
|
||||
|
||||
#### Step 4: Load Extension
|
||||
Click "Load unpacked" and select the `aitbc-wallet` folder.
|
||||
|
||||
#### Step 5: Start Using!
|
||||
Click the AITBC Wallet icon in your toolbar to create or import an account.
|
||||
|
||||
### Install for Firefox
|
||||
|
||||
#### Step 1: Visit Install Page
|
||||
Click the button below to go to the Firefox installation page.
|
||||
|
||||
[Install Firefox Extension](/firefox-wallet/install.html)
|
||||
|
||||
#### Step 2: Click "Add to Firefox"
|
||||
On the install page, click the "Add to Firefox" button to install the extension.
|
||||
|
||||
#### Step 3: Start Using!
|
||||
The AITBC Wallet will appear in your toolbar with an orange icon. Click to create your first account!
|
||||
|
||||
## Using Your AITBC Wallet
|
||||
|
||||
### Create a New Wallet
|
||||
1. Click the AITBC Wallet icon
|
||||
2. Select "Create New Account"
|
||||
3. Securely save your private key
|
||||
4. Your wallet is ready!
|
||||
|
||||
### Import Existing Wallet
|
||||
1. Click the AITBC Wallet icon
|
||||
2. Select "Import Private Key"
|
||||
3. Enter your private key
|
||||
4. Access your restored wallet
|
||||
|
||||
### Connect to Exchange
|
||||
1. Visit [AITBC Exchange](/Exchange/)
|
||||
2. Toggle to "Real Mode"
|
||||
3. Click "Connect AITBC Wallet"
|
||||
4. Approve the connection
|
||||
|
||||
### Send & Receive Tokens
|
||||
1. Click "Send" to transfer tokens
|
||||
2. Click "Receive" to get your address
|
||||
3. All transactions require confirmation
|
||||
4. View history in the wallet
|
||||
|
||||
## Security Best Practices
|
||||
|
||||
> ⚠️ **Important Security Reminders**
|
||||
|
||||
### Never Share Your Private Key
|
||||
- Anyone with your private key has full control of your funds
|
||||
- Treat it like your bank account password
|
||||
|
||||
### Backup Your Private Key
|
||||
- Write it down and store it in a secure, offline location
|
||||
- Consider using a fireproof safe or safety deposit box
|
||||
|
||||
### Verify URLs
|
||||
- Always ensure you're on aitbc.bubuit.net before connecting
|
||||
- Phishing sites may look identical
|
||||
|
||||
### Use a Password Manager
|
||||
- Protect your browser with a strong, unique password
|
||||
- Enable two-factor authentication when available
|
||||
|
||||
### Keep Updated
|
||||
- Regularly update your browser and the wallet extension
|
||||
- Security updates are important for protecting your funds
|
||||
|
||||
## Quick Links
|
||||
|
||||
- [Trade Exchange](/Exchange/)
|
||||
- [Block Explorer](/explorer/)
|
||||
- [Documentation](/docs/)
|
||||
|
||||
## Support
|
||||
|
||||
Need help? Check our documentation or create an issue on GitHub.
|
||||
|
||||
---
|
||||
|
||||
© 2025 AITBC. All rights reserved.
|
||||
488
website/docs/blockchain-node-md.html
Normal file
488
website/docs/blockchain-node-md.html
Normal file
@@ -0,0 +1,488 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Blockchain Node - 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;
|
||||
}
|
||||
|
||||
.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 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);
|
||||
}
|
||||
|
||||
.api-endpoint {
|
||||
background: var(--bg-light);
|
||||
padding: 1rem;
|
||||
border-radius: 8px;
|
||||
margin: 1rem 0;
|
||||
border-left: 4px solid var(--primary-color);
|
||||
}
|
||||
|
||||
.api-endpoint code {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
margin-bottom: 0.5rem;
|
||||
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>Blockchain Node</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-cube"></i> Blockchain Node</h1>
|
||||
<p>PoA/PoS consensus blockchain with REST/WebSocket RPC, real-time gossip layer, and comprehensive observability</p>
|
||||
<span class="status-badge">● Live</span>
|
||||
</div>
|
||||
|
||||
<!-- Overview -->
|
||||
<section class="content-section">
|
||||
<h2>Overview</h2>
|
||||
<p>The AITBC Blockchain Node is the core infrastructure component that maintains the distributed ledger. It implements a hybrid Proof-of-Authority/Proof-of-Stake consensus mechanism with fast finality and supports high throughput for AI workload transactions.</p>
|
||||
|
||||
<h3>Key Features</h3>
|
||||
<ul>
|
||||
<li>Hybrid PoA/PoS consensus with sub-second finality</li>
|
||||
<li>REST and WebSocket RPC APIs</li>
|
||||
<li>Real-time gossip protocol for block propagation</li>
|
||||
<li>Comprehensive observability with Prometheus metrics</li>
|
||||
<li>SQLModel-based data persistence</li>
|
||||
<li>Built-in devnet tooling and scripts</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<!-- Architecture -->
|
||||
<section class="content-section">
|
||||
<h2>Architecture</h2>
|
||||
<p>The blockchain node is built with a modular architecture separating concerns for consensus, storage, networking, and API layers.</p>
|
||||
|
||||
<div class="feature-grid">
|
||||
<div class="feature-card">
|
||||
<h4>Consensus Engine</h4>
|
||||
<p>Hybrid PoA/PoS with proposer rotation and validator sets</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<h4>Storage Layer</h4>
|
||||
<p>SQLModel with SQLite/PostgreSQL support</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<h4>Networking</h4>
|
||||
<p>WebSocket gossip + REST API</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<h4>Observability</h4>
|
||||
<p>Prometheus metrics + structured logging</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- API Reference -->
|
||||
<section class="content-section">
|
||||
<h2>API Reference</h2>
|
||||
<p>The blockchain node exposes both REST and WebSocket APIs for interaction.</p>
|
||||
|
||||
<h3>REST Endpoints</h3>
|
||||
<div class="api-endpoint">
|
||||
<code>GET /rpc/get_head</code>
|
||||
<p>Get the latest block header</p>
|
||||
</div>
|
||||
|
||||
<div class="api-endpoint">
|
||||
<code>POST /rpc/send_tx</code>
|
||||
<p>Submit a new transaction</p>
|
||||
</div>
|
||||
|
||||
<div class="api-endpoint">
|
||||
<code>GET /rpc/get_balance/{address}</code>
|
||||
<p>Get account balance</p>
|
||||
</div>
|
||||
|
||||
<div class="api-endpoint">
|
||||
<code>GET /rpc/get_block/{height}</code>
|
||||
<p>Get block by height</p>
|
||||
</div>
|
||||
|
||||
<h3>WebSocket Subscriptions</h3>
|
||||
<ul>
|
||||
<li><code>new_blocks</code> - Real-time block notifications</li>
|
||||
<li><code>new_transactions</code> - Transaction pool updates</li>
|
||||
<li><code>consensus_events</code> - Consensus round updates</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<!-- Configuration -->
|
||||
<section class="content-section">
|
||||
<h2>Configuration</h2>
|
||||
<p>The node can be configured via environment variables or configuration file.</p>
|
||||
|
||||
<h3>Key Settings</h3>
|
||||
<pre><code># Database
|
||||
DATABASE_URL=sqlite:///blockchain.db
|
||||
|
||||
# Network
|
||||
RPC_HOST=0.0.0.0
|
||||
RPC_PORT=9080
|
||||
WS_PORT=9081
|
||||
|
||||
# Consensus
|
||||
CONSENSUS_MODE=poa
|
||||
VALIDATOR_ADDRESS=0x...
|
||||
BLOCK_TIME=1s
|
||||
|
||||
# Observability
|
||||
METRICS_PORT=9090
|
||||
LOG_LEVEL=info</code></pre>
|
||||
</section>
|
||||
|
||||
<!-- Running a Node -->
|
||||
<section class="content-section">
|
||||
<h2>Running a Node</h2>
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<pre><code># Initialize devnet
|
||||
python -m blockchain.scripts.init_devnet
|
||||
|
||||
# Start node
|
||||
python -m blockchain.main --config devnet.yaml</code></pre>
|
||||
|
||||
<h3>Production Mode</h3>
|
||||
<pre><code># Using Docker
|
||||
docker run -d \
|
||||
-v /data/blockchain:/data \
|
||||
-p 9080:9080 \
|
||||
-p 9081:9081 \
|
||||
-p 9090:9090 \
|
||||
aitbc/blockchain-node:latest</code></pre>
|
||||
</section>
|
||||
|
||||
<!-- Monitoring -->
|
||||
<section class="content-section">
|
||||
<h2>Monitoring</h2>
|
||||
|
||||
<h3>Prometheus Metrics</h3>
|
||||
<p>Available at <code>http://localhost:9090/metrics</code></p>
|
||||
|
||||
<p>Key metrics:</p>
|
||||
<ul>
|
||||
<li><code>blockchain_blocks_total</code> - Total blocks produced</li>
|
||||
<li><code>blockchain_transactions_total</code> - Total transactions processed</li>
|
||||
<li><code>blockchain_consensus_rounds</code> - Consensus rounds completed</li>
|
||||
<li><code>blockchain_network_peers</code> - Active peer connections</li>
|
||||
</ul>
|
||||
|
||||
<h3>Health Checks</h3>
|
||||
<pre><code># Node status
|
||||
curl http://localhost:9080/health
|
||||
|
||||
# Sync status
|
||||
curl http://localhost:9080/sync_status</code></pre>
|
||||
</section>
|
||||
|
||||
<!-- Troubleshooting -->
|
||||
<section class="content-section">
|
||||
<h2>Troubleshooting</h2>
|
||||
|
||||
<h3>Common Issues</h3>
|
||||
<ol>
|
||||
<li><strong>Node not syncing</strong>
|
||||
<ul>
|
||||
<li>Check peer connections: <code>curl /rpc/peers</code></li>
|
||||
<li>Verify network connectivity</li>
|
||||
<li>Check logs for consensus errors</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>High memory usage</strong>
|
||||
<ul>
|
||||
<li>Reduce <code>block_cache_size</code> in config</li>
|
||||
<li>Enable block pruning</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>RPC timeouts</strong>
|
||||
<ul>
|
||||
<li>Increase <code>rpc_timeout</code> setting</li>
|
||||
<li>Check system resources</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<!-- Development -->
|
||||
<section class="content-section">
|
||||
<h2>Development</h2>
|
||||
|
||||
<h3>Building from Source</h3>
|
||||
<pre><code>git clone https://github.com/aitbc/blockchain
|
||||
cd blockchain
|
||||
pip install -e .</code></pre>
|
||||
|
||||
<h3>Running Tests</h3>
|
||||
<pre><code># Unit tests
|
||||
pytest tests/
|
||||
|
||||
# Integration tests
|
||||
pytest tests/integration/</code></pre>
|
||||
</section>
|
||||
|
||||
<!-- Security Considerations -->
|
||||
<section class="content-section">
|
||||
<h2>Security Considerations</h2>
|
||||
<ul>
|
||||
<li>Validator keys should be kept secure</li>
|
||||
<li>Use HTTPS in production</li>
|
||||
<li>Implement rate limiting on RPC endpoints</li>
|
||||
<li>Regular security updates for dependencies</li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<p>© 2025 AITBC. All rights reserved.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -300,6 +300,11 @@
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<h2>Overview</h2>
|
||||
<p>The AITBC Blockchain Node is the core infrastructure component that maintains the distributed ledger. It implements a hybrid Proof-of-Authority/Proof-of-Stake consensus mechanism with fast finality and supports high throughput for AI workload transactions.</p>
|
||||
|
||||
|
||||
@@ -106,6 +106,11 @@
|
||||
<!-- 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">
|
||||
|
||||
586
website/docs/client-documentation-md.html
Normal file
586
website/docs/client-documentation-md.html
Normal file
@@ -0,0 +1,586 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Client 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);
|
||||
}
|
||||
|
||||
.pricing-table {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||
gap: 2rem;
|
||||
margin: 2rem 0;
|
||||
}
|
||||
|
||||
.pricing-card {
|
||||
background: var(--bg-white);
|
||||
padding: 2rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pricing-card h3 {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 1rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.pricing-card .price {
|
||||
font-size: 2.5rem;
|
||||
font-weight: bold;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
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>Client 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-users"></i> Client Documentation</h1>
|
||||
<p>Use AITBC for your AI/ML workloads with privacy and verifiable computation. Ideal for businesses and developers using AI services.</p>
|
||||
</div>
|
||||
|
||||
<!-- Getting Started -->
|
||||
<section class="content-section">
|
||||
<h2>Getting Started</h2>
|
||||
<p>Start using AITBC in minutes with our simple client SDK or web interface.</p>
|
||||
|
||||
<h3>Quick Start Options</h3>
|
||||
<ul>
|
||||
<li><strong>CLI Wrapper Tool</strong>: Unified bash script for job management</li>
|
||||
<li><strong>Web Interface</strong>: No installation required</li>
|
||||
<li><strong>Python SDK</strong>: For AI/ML developers</li>
|
||||
<li><strong>JavaScript SDK</strong>: For web applications</li>
|
||||
<li><strong>REST API</strong>: For any platform</li>
|
||||
</ul>
|
||||
|
||||
<h3>CLI Wrapper Tool (Recommended)</h3>
|
||||
<pre><code># Install the CLI wrapper
|
||||
curl -O https://gitea.bubuit.net/oib/aitbc/releases/download/latest/aitbc-cli.sh
|
||||
chmod +x aitbc-cli.sh
|
||||
|
||||
# Check available services
|
||||
./aitbc-cli.sh status
|
||||
|
||||
# Submit a job
|
||||
./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>
|
||||
</section>
|
||||
|
||||
<!-- Python SDK -->
|
||||
<section class="content-section">
|
||||
<h2>Python SDK</h2>
|
||||
<p>Install the Python SDK for easy integration into your applications:</p>
|
||||
|
||||
<pre><code># Install
|
||||
pip install aitbc-client
|
||||
|
||||
# Basic usage
|
||||
from aitbc import AITBCClient
|
||||
|
||||
client = AITBCClient(api_key="your-api-key")
|
||||
|
||||
# Submit a job
|
||||
job = client.submit_job(
|
||||
type="inference",
|
||||
model="llama3.2",
|
||||
prompt="Explain quantum computing",
|
||||
max_tokens=500
|
||||
)
|
||||
|
||||
# Wait for completion
|
||||
result = client.wait_for_job(job.id)
|
||||
print(result.output)</code></pre>
|
||||
|
||||
<h3>Advanced Features</h3>
|
||||
<ul>
|
||||
<li>Async/await support</li>
|
||||
<li>Batch job submission</li>
|
||||
<li>Streaming responses</li>
|
||||
<li>Zero-knowledge proof verification</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<!-- JavaScript SDK -->
|
||||
<section class="content-section">
|
||||
<h2>JavaScript SDK</h2>
|
||||
<p>For web applications and Node.js:</p>
|
||||
|
||||
<pre><code># Install
|
||||
npm install @aitbc/client
|
||||
|
||||
# Usage
|
||||
import { AITBCClient } from '@aitbc/client';
|
||||
|
||||
const client = new AITBCClient({
|
||||
apiKey: 'your-api-key',
|
||||
endpoint: 'https://aitbc.bubuit.net/api'
|
||||
});
|
||||
|
||||
// Submit job
|
||||
const job = await client.submit({
|
||||
type: 'inference',
|
||||
model: 'llama3.2',
|
||||
input: {
|
||||
prompt: 'Hello, AITBC!',
|
||||
max_tokens: 100
|
||||
}
|
||||
});
|
||||
|
||||
// Get result
|
||||
const result = await client.getResult(job.id);
|
||||
console.log(result.output);</code></pre>
|
||||
</section>
|
||||
|
||||
<!-- REST API -->
|
||||
<section class="content-section">
|
||||
<h2>REST API</h2>
|
||||
<p>Direct API access for any programming language:</p>
|
||||
|
||||
<pre><code># Submit a job
|
||||
curl -X POST https://aitbc.bubuit.net/api/v1/jobs \
|
||||
-H "Authorization: Bearer YOUR_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"type": "inference",
|
||||
"model": "gpt-4",
|
||||
"input": {
|
||||
"prompt": "Hello, AITBC!",
|
||||
"max_tokens": 100
|
||||
},
|
||||
"privacy": {
|
||||
"zk_proof": true
|
||||
}
|
||||
}'
|
||||
|
||||
# Check job status
|
||||
curl -X GET https://aitbc.bubuit.net/api/v1/jobs/JOB_ID \
|
||||
-H "Authorization: Bearer YOUR_TOKEN"</code></pre>
|
||||
</section>
|
||||
|
||||
<!-- Pricing -->
|
||||
<section class="content-section">
|
||||
<h2>Pricing</h2>
|
||||
<p>Flexible pricing options for every use case</p>
|
||||
|
||||
<div class="pricing-table">
|
||||
<div class="pricing-card">
|
||||
<h3>Pay-per-use</h3>
|
||||
<div class="price">$0.01/1K tokens</div>
|
||||
<ul style="text-align: left;">
|
||||
<li>No minimum commitment</li>
|
||||
<li>Pay for what you use</li>
|
||||
<li>All models available</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pricing-card">
|
||||
<h3>Professional</h3>
|
||||
<div class="price">$99/month</div>
|
||||
<ul style="text-align: left;">
|
||||
<li>10M tokens included</li>
|
||||
<li>Priority processing</li>
|
||||
<li>SLA guarantee</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pricing-card">
|
||||
<h3>Enterprise</h3>
|
||||
<div class="price">Custom</div>
|
||||
<ul style="text-align: left;">
|
||||
<li>Unlimited tokens</li>
|
||||
<li>Dedicated infrastructure</li>
|
||||
<li>24/7 support</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Privacy & Security -->
|
||||
<section class="content-section">
|
||||
<h2>Privacy & Security</h2>
|
||||
<p>Your data is protected with enterprise-grade security:</p>
|
||||
|
||||
<div class="feature-grid">
|
||||
<div class="feature-card">
|
||||
<h4><i class="fas fa-shield-alt"></i> Zero-Knowledge Proofs</h4>
|
||||
<p>Computation is verified without revealing your data</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<h4><i class="fas fa-lock"></i> End-to-End Encryption</h4>
|
||||
<p>Your prompts and results are encrypted in transit and at rest</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<h4><i class="fas fa-certificate"></i> Verifiable Computation</h4>
|
||||
<p>Every result includes a cryptographic proof of correct execution</p>
|
||||
</div>
|
||||
<div class="feature-card">
|
||||
<h4><i class="fas fa-user-secret"></i> Privacy-Preserving</h4>
|
||||
<p>Optional privacy mode keeps your data completely confidential</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Supported Models -->
|
||||
<section class="content-section">
|
||||
<h2>Supported Models</h2>
|
||||
<p>Access a wide range of state-of-the-art AI models:</p>
|
||||
|
||||
<h3>Language Models</h3>
|
||||
<ul>
|
||||
<li>LLaMA 3.2 (8B, 70B)</li>
|
||||
<li>Mistral (7B, 8x7B)</li>
|
||||
<li>DeepSeek (67B)</li>
|
||||
<li>Code Llama (34B)</li>
|
||||
<li>GPT-4 (via API)</li>
|
||||
</ul>
|
||||
|
||||
<h3>Image Models</h3>
|
||||
<ul>
|
||||
<li>Stable Diffusion XL</li>
|
||||
<li>DALL-E 3 (via API)</li>
|
||||
<li>Midjourney (via API)</li>
|
||||
</ul>
|
||||
|
||||
<h3>Specialized Models</h3>
|
||||
<ul>
|
||||
<li>Embedding models for search</li>
|
||||
<li>Speech-to-text (Whisper)</li>
|
||||
<li>Text-to-speech</li>
|
||||
<li>Translation models</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<!-- Best Practices -->
|
||||
<section class="content-section">
|
||||
<h2>Best Practices</h2>
|
||||
|
||||
<div class="alert alert-info">
|
||||
<strong>💡 Tip:</strong> Use batch processing for multiple requests to reduce latency and costs.
|
||||
</div>
|
||||
|
||||
<h3>Performance Optimization</h3>
|
||||
<ul>
|
||||
<li>Use appropriate model sizes for your task</li>
|
||||
<li>Implement caching for repeated requests</li>
|
||||
<li>Use streaming for long responses</li>
|
||||
<li>Monitor token usage to control costs</li>
|
||||
<li>Consider subscription plans for regular use</li>
|
||||
</ul>
|
||||
|
||||
<h3>Security Best Practices</h3>
|
||||
<ul>
|
||||
<li>Keep your API keys secure</li>
|
||||
<li>Use environment variables for credentials</li>
|
||||
<li>Implement proper error handling</li>
|
||||
<li>Validate inputs before submission</li>
|
||||
<li>Use HTTPS for all API calls</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<!-- Support & Resources -->
|
||||
<section class="content-section">
|
||||
<h2>Support & Resources</h2>
|
||||
|
||||
<h3>Getting Help</h3>
|
||||
<ul>
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
<h3>Tutorials</h3>
|
||||
<ul>
|
||||
<li><a href="#">Getting Started with AI Inference</a></li>
|
||||
<li><a href="#">Building a Chat Application</a></li>
|
||||
<li><a href="#">Image Generation Guide</a></li>
|
||||
<li><a href="#">Privacy-Preserving ML</a></li>
|
||||
<li><a href="#">API Integration Best Practices</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Examples</h3>
|
||||
<ul>
|
||||
<li><a href="#">Python Examples Repository</a></li>
|
||||
<li><a href="#">JavaScript Examples</a></li>
|
||||
<li><a href="#">API Postman Collection</a></li>
|
||||
<li><a href="#">Sample Applications</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<p>© 2025 AITBC. All rights reserved.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
496
website/docs/components-md.html
Normal file
496
website/docs/components-md.html
Normal file
@@ -0,0 +1,496 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>AITBC System Components - 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: 3rem;
|
||||
}
|
||||
|
||||
.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 p {
|
||||
margin-bottom: 1rem;
|
||||
color: var(--text-dark);
|
||||
}
|
||||
|
||||
.components-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);
|
||||
transition: transform 0.3s, box-shadow 0.3s;
|
||||
}
|
||||
|
||||
.component-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 8px 30px rgba(0,0,0,0.12);
|
||||
}
|
||||
|
||||
.component-icon {
|
||||
font-size: 2.5rem;
|
||||
color: var(--primary-color);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.component-card h3 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
color: var(--text-dark);
|
||||
}
|
||||
|
||||
.component-status {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
color: var(--success-color);
|
||||
font-weight: 600;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.component-status.live::before {
|
||||
content: "●";
|
||||
color: var(--success-color);
|
||||
}
|
||||
|
||||
.component-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
color: var(--primary-color);
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.component-link:hover {
|
||||
color: var(--secondary-color);
|
||||
}
|
||||
|
||||
.architecture-diagram {
|
||||
background: var(--bg-light);
|
||||
padding: 2rem;
|
||||
border-radius: 12px;
|
||||
margin: 2rem 0;
|
||||
text-align: center;
|
||||
font-family: monospace;
|
||||
font-size: 0.9rem;
|
||||
color: var(--text-dark);
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.quick-links {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 1rem;
|
||||
margin: 2rem 0;
|
||||
}
|
||||
|
||||
.quick-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
padding: 1rem;
|
||||
background: var(--bg-light);
|
||||
border-radius: 8px;
|
||||
text-decoration: none;
|
||||
color: var(--text-dark);
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.quick-link:hover {
|
||||
background: var(--primary-color);
|
||||
color: white;
|
||||
transform: translateX(5px);
|
||||
}
|
||||
|
||||
.quick-link i {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.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>
|
||||
<span>Components</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>AITBC System Components</h1>
|
||||
<p>Overview of all components in the AITBC platform, their status, and documentation links.</p>
|
||||
</div>
|
||||
|
||||
<!-- Core Components -->
|
||||
<section class="content-section">
|
||||
<h2>Core Components</h2>
|
||||
<div class="components-grid">
|
||||
<!-- Blockchain Node -->
|
||||
<div class="component-card">
|
||||
<div class="component-icon">
|
||||
<i class="fas fa-cube"></i>
|
||||
</div>
|
||||
<h3>Blockchain Node</h3>
|
||||
<p>PoA/PoS consensus with REST/WebSocket RPC, real-time gossip layer, and comprehensive observability. Production-ready with devnet tooling.</p>
|
||||
<div class="component-status live">Live</div>
|
||||
<a href="blockchain-node-md.html" class="component-link">
|
||||
Learn More <i class="fas fa-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Coordinator API -->
|
||||
<div class="component-card">
|
||||
<div class="component-icon">
|
||||
<i class="fas fa-server"></i>
|
||||
</div>
|
||||
<h3>Coordinator API</h3>
|
||||
<p>FastAPI service for job submission, miner registration, and receipt management. SQLite persistence with comprehensive endpoints.</p>
|
||||
<div class="component-status live">Live</div>
|
||||
<a href="coordinator-api-md.html" class="component-link">
|
||||
Learn More <i class="fas fa-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Marketplace Web -->
|
||||
<div class="component-card">
|
||||
<div class="component-icon">
|
||||
<i class="fas fa-store"></i>
|
||||
</div>
|
||||
<h3>Marketplace Web</h3>
|
||||
<p>Vite/TypeScript marketplace with offer/bid functionality, stats dashboard, and mock/live data toggle. Production UI ready.</p>
|
||||
<div class="component-status live">Live</div>
|
||||
<a href="marketplace-web-md.html" class="component-link">
|
||||
Learn More <i class="fas fa-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Explorer Web -->
|
||||
<div class="component-card">
|
||||
<div class="component-icon">
|
||||
<i class="fas fa-search"></i>
|
||||
</div>
|
||||
<h3>Explorer Web</h3>
|
||||
<p>Full-featured blockchain explorer with blocks, transactions, addresses, and receipts tracking. Responsive design with live data.</p>
|
||||
<div class="component-status live">Live</div>
|
||||
<a href="explorer-web.html" class="component-link">
|
||||
Learn More <i class="fas fa-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Wallet Daemon -->
|
||||
<div class="component-card">
|
||||
<div class="component-icon">
|
||||
<i class="fas fa-wallet"></i>
|
||||
</div>
|
||||
<h3>Wallet Daemon</h3>
|
||||
<p>Encrypted keystore with Argon2id + XChaCha20-Poly1305, REST/JSON-RPC APIs, and receipt verification capabilities.</p>
|
||||
<div class="component-status live">Live</div>
|
||||
<a href="wallet-daemon.html" class="component-link">
|
||||
Learn More <i class="fas fa-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Trade Exchange -->
|
||||
<div class="component-card">
|
||||
<div class="component-icon">
|
||||
<i class="fas fa-exchange-alt"></i>
|
||||
</div>
|
||||
<h3>Trade Exchange</h3>
|
||||
<p>Bitcoin-to-AITBC exchange with QR payments, user management, and real-time trading. Buy tokens with BTC instantly.</p>
|
||||
<div class="component-status live">Live</div>
|
||||
<a href="trade-exchange-md.html" class="component-link">
|
||||
Learn More <i class="fas fa-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Pool Hub -->
|
||||
<div class="component-card">
|
||||
<div class="component-icon">
|
||||
<i class="fas fa-swimming-pool"></i>
|
||||
</div>
|
||||
<h3>Pool Hub</h3>
|
||||
<p>Miner registry with scoring engine, Redis/PostgreSQL backing, and comprehensive metrics. Live matching API deployed.</p>
|
||||
<div class="component-status live">Live</div>
|
||||
<a href="pool-hub.html" class="component-link">
|
||||
Learn More <i class="fas fa-arrow-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Architecture Overview -->
|
||||
<section class="content-section">
|
||||
<h2>Architecture Overview</h2>
|
||||
<p>The AITBC platform consists of 7 core components working together to provide a complete AI blockchain computing solution:</p>
|
||||
|
||||
<div class="architecture-diagram">
|
||||
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
|
||||
│ Clients │────▶│ Coordinator │────▶│ Blockchain │
|
||||
│ │ │ API │ │ Node │
|
||||
└─────────────┘ └──────────────┘ └─────────────┘
|
||||
│ │ │
|
||||
▼ ▼ ▼
|
||||
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
|
||||
│ Wallet │ │ Pool Hub │ │ Miners │
|
||||
│ Daemon │ │ │ │ │
|
||||
└─────────────┘ └──────────────┘ └─────────────┘
|
||||
</div>
|
||||
|
||||
<h3>Infrastructure Layer</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>
|
||||
</ul>
|
||||
|
||||
<h3>Application Layer</h3>
|
||||
<ul>
|
||||
<li><strong>Marketplace Web</strong> - GPU compute marketplace</li>
|
||||
<li><strong>Trade Exchange</strong> - Token trading platform</li>
|
||||
<li><strong>Explorer Web</strong> - Blockchain explorer</li>
|
||||
<li><strong>Pool Hub</strong> - Miner coordination service</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<!-- Quick Links -->
|
||||
<section class="content-section">
|
||||
<h2>Quick Links</h2>
|
||||
<div class="quick-links">
|
||||
<a href="https://aitbc.bubuit.net/Exchange/" target="_blank" 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">
|
||||
<i class="fas fa-store"></i>
|
||||
<span>Marketplace</span>
|
||||
</a>
|
||||
<a href="https://aitbc.bubuit.net/explorer/" target="_blank" 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">
|
||||
<i class="fas fa-code"></i>
|
||||
<span>API Docs</span>
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Status Legend -->
|
||||
<section class="content-section">
|
||||
<h2>Status Legend</h2>
|
||||
<ul>
|
||||
<li><span class="component-status live">● Live</span> - Production ready and deployed</li>
|
||||
<li><span class="component-status" style="color: var(--warning-color);">● Beta</span> - In testing, limited availability</li>
|
||||
<li><span class="component-status" style="color: var(--text-light);">● Development</span> - Under active development</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<!-- Deployment Information -->
|
||||
<section class="content-section">
|
||||
<h2>Deployment Information</h2>
|
||||
<p>All components are containerized and can be deployed using Docker Compose:</p>
|
||||
<pre style="background: #1f2937; color: #f9fafb; padding: 1.5rem; border-radius: 8px; overflow-x: auto;">
|
||||
# Deploy all components
|
||||
docker-compose up -d
|
||||
|
||||
# Check status
|
||||
docker-compose ps
|
||||
|
||||
# View logs
|
||||
docker-compose logs -f</pre>
|
||||
</section>
|
||||
|
||||
<!-- Support -->
|
||||
<section class="content-section">
|
||||
<h2>Support</h2>
|
||||
<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>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<p>© 2025 AITBC. All rights reserved.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -289,8 +289,13 @@
|
||||
<p>Explore the 7 core components that make up the AITBC platform</p>
|
||||
</div>
|
||||
|
||||
<!-- Components Grid -->
|
||||
<!-- 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>
|
||||
|
||||
<!-- Blockchain Node -->
|
||||
<div class="component-card">
|
||||
<div class="component-icon">
|
||||
|
||||
@@ -300,6 +300,11 @@
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<h2>Overview</h2>
|
||||
<p>The Coordinator API is the central orchestration layer that manages job distribution between clients and miners in the AITBC network. It handles job submissions, miner registrations, and tracks all computation receipts.</p>
|
||||
|
||||
|
||||
@@ -67,6 +67,11 @@
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<h2>Getting Started</h2>
|
||||
<p>Start using AITBC in minutes with our simple client SDK or web interface.</p>
|
||||
|
||||
@@ -247,7 +252,7 @@ console.log('Computation verified:', verified);</div>
|
||||
<h3>REST API</h3>
|
||||
<div class="code-block">
|
||||
# Submit a job
|
||||
curl -X POST https://api.aitbc.io/v1/jobs \
|
||||
curl -X POST https://aitbc.bubuit.net/api/v1/jobs \
|
||||
-H "Authorization: Bearer YOUR_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
@@ -264,7 +269,7 @@ curl -X POST https://api.aitbc.io/v1/jobs \
|
||||
}'
|
||||
|
||||
# Check job status
|
||||
curl -X GET https://api.aitbc.io/v1/jobs/JOB_ID \
|
||||
curl -X GET https://aitbc.bubuit.net/api/v1/jobs/JOB_ID \
|
||||
-H "Authorization: Bearer YOUR_TOKEN"</div>
|
||||
</section>
|
||||
|
||||
@@ -381,7 +386,7 @@ curl -X GET https://api.aitbc.io/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.io">System status</a></li>
|
||||
<li><strong>Status</strong>: <a href="https://status.aitbc.bubuit.net">System status</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Tutorials</h3>
|
||||
|
||||
@@ -95,6 +95,11 @@
|
||||
|
||||
<!-- 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>
|
||||
|
||||
|
||||
@@ -58,6 +58,11 @@
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<h2>Getting Started</h2>
|
||||
<p>AITBC mining combines Proof of Authority and Proof of Stake, offering multiple ways to participate and earn rewards.</p>
|
||||
|
||||
@@ -81,12 +86,12 @@
|
||||
<p>Get the AITBC mining software for your platform</p>
|
||||
<div class="code-block">
|
||||
# Linux/macOS
|
||||
curl -O https://releases.aitbc.io/aitbc-miner-v1.0.0.tar.gz
|
||||
curl -O https://gitea.bubuit.net/oib/aitbc/releases/download/v1.0.0/aitbc-miner-v1.0.0.tar.gz
|
||||
tar -xzf aitbc-miner-v1.0.0.tar.gz
|
||||
cd aitbc-miner
|
||||
|
||||
# Windows
|
||||
# Download from https://releases.aitbc.io/windows</div>
|
||||
# Download from https://gitea.bubuit.net/oib/aitbc/releases</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -307,7 +312,7 @@ nano ~/.aitbc/miner.toml</div>
|
||||
<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: miners@aitbc.io</li>
|
||||
<li>Email support: aitbc@bubuit.net</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -471,6 +471,11 @@
|
||||
<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>
|
||||
</div>
|
||||
@@ -1011,7 +1016,7 @@ gosec ./...</code></pre>
|
||||
<li>Medium: $1,000 - $10,000</li>
|
||||
<li>Low: $100 - $1,000</li>
|
||||
</ul>
|
||||
<p>Report vulnerabilities at: <a href="mailto:security@aitbc.io">security@aitbc.io</a></p>
|
||||
<p>Report vulnerabilities at: <a href="mailto:aitbc@bubuit.net">aitbc@bubuit.net</a></p>
|
||||
</section>
|
||||
|
||||
<section id="reference">
|
||||
|
||||
@@ -124,6 +124,10 @@
|
||||
<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">
|
||||
<i class="fa fa-file-alt"></i>
|
||||
<span>Markdown Docs</span>
|
||||
</a>
|
||||
<a href="https://aitbc.bubuit.net/Exchange/" class="link-item">
|
||||
<i class="fa fa-exchange"></i>
|
||||
<span>Trade Exchange</span>
|
||||
@@ -136,7 +140,7 @@
|
||||
<i class="fab fa-discord"></i>
|
||||
<span>Community</span>
|
||||
</a>
|
||||
<a href="mailto:support@aitbc.io" class="link-item">
|
||||
<a href="mailto:aitbc@bubuit.net" class="link-item">
|
||||
<i class="fa fa-envelope"></i>
|
||||
<span>Support</span>
|
||||
</a>
|
||||
@@ -151,6 +155,42 @@
|
||||
</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>
|
||||
</section>
|
||||
|
||||
<!-- Help Section -->
|
||||
<section class="help-section">
|
||||
<h2>Need Help?</h2>
|
||||
@@ -159,7 +199,7 @@
|
||||
<a href="https://discord.gg/aitbc" class="btn">
|
||||
<i class="fab fa-discord"></i> Join Discord
|
||||
</a>
|
||||
<a href="mailto:support@aitbc.io" class="btn btn-outline">
|
||||
<a href="mailto:aitbc@bubuit.net" class="btn btn-outline">
|
||||
<i class="fa fa-envelope"></i> Email Support
|
||||
</a>
|
||||
<a href="#" class="btn btn-outline">
|
||||
|
||||
@@ -469,6 +469,11 @@ body.light {
|
||||
|
||||
<!-- Reader Level Cards -->
|
||||
<div class="reader-levels">
|
||||
<div class="alert alert-info" style="grid-column: 1 / -1; background: #dbeafe; border-left: 4px solid #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/marketplace-web.md" target="_blank" style="color: #1e40af; text-decoration: underline;">View this documentation in markdown format</a> for easier contribution and version control.
|
||||
</div>
|
||||
|
||||
<!-- Miners Card -->
|
||||
<div class="reader-card miner">
|
||||
<div class="reader-icon">
|
||||
@@ -558,7 +563,7 @@ body.light {
|
||||
<i class="fab fa-discord"></i>
|
||||
<span>Community</span>
|
||||
</a>
|
||||
<a href="mailto:support@aitbc.io" class="link-item">
|
||||
<a href="mailto:aitbc@bubuit.net" class="link-item">
|
||||
<i class="fa fa-envelope"></i>
|
||||
<span>Support</span>
|
||||
</a>
|
||||
@@ -581,7 +586,7 @@ body.light {
|
||||
<a href="https://discord.gg/aitbc" class="btn">
|
||||
<i class="fab fa-discord"></i> Join Discord
|
||||
</a>
|
||||
<a href="mailto:support@aitbc.io" class="btn btn-outline">
|
||||
<a href="mailto:aitbc@bubuit.net" class="btn btn-outline">
|
||||
<i class="fa fa-envelope"></i> Email Support
|
||||
</a>
|
||||
<a href="#" class="btn btn-outline">
|
||||
|
||||
@@ -326,6 +326,11 @@
|
||||
|
||||
<!-- 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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user