Files
aitbc/docs/development/5_developer-guide.md
aitbc 19d415a235
Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Failing after 3s
CLI Tests / test-cli (push) Failing after 3s
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Successful in 2s
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Successful in 3s
Cross-Chain Functionality Tests / test-cross-chain-bridge (push) Has been skipped
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Successful in 2s
Cross-Chain Functionality Tests / aggregate-results (push) Has been skipped
Deploy to Testnet / deploy-testnet (push) Successful in 1m12s
Documentation Validation / validate-docs (push) Failing after 8s
Documentation Validation / validate-policies-strict (push) Successful in 3s
Integration Tests / test-service-integration (push) Successful in 2m6s
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Successful in 2s
Multi-Node Blockchain Health Monitoring / health-check (push) Failing after 4s
P2P Network Verification / p2p-verification (push) Successful in 4s
Package Tests / Python package - aitbc-agent-sdk (push) Successful in 32s
Package Tests / Python package - aitbc-core (push) Successful in 14s
Package Tests / Python package - aitbc-crypto (push) Successful in 12s
Package Tests / Python package - aitbc-sdk (push) Successful in 9s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 8s
Package Tests / JavaScript package - aitbc-token (push) Successful in 17s
Python Tests / test-python (push) Successful in 15s
Security Scanning / security-scan (push) Successful in 27s
Node Failover Simulation / failover-test (push) Successful in 7s
Multi-Node Stress Testing / stress-test (push) Successful in 6s
Cross-Node Transaction Testing / transaction-test (push) Successful in 4s
feat: add SQLCipher database encryption support and consolidate agent documentation
- Add SQLCipher encryption for ait-mainnet database with configurable flag
- Add db_encryption_enabled and db_encryption_key_path config settings
- Implement encryption key loading and PRAGMA key setup via connection events
- Add shutdown_db function for proper database cleanup
- Export middleware classes in aitbc/__init__.py
- Fix import path in sync.py for settings
- Remove duplicate agent documentation from docs
2026-05-03 12:00:38 +02:00

260 lines
7.0 KiB
Markdown

# 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://github.com/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 GitHub
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 GitHub.
### 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 GitHub
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](../6_architecture/3_coordinator-api.md)
- [Architecture Guide](../6_architecture/2_components-overview.md)
- [Protocol Specification](../6_architecture/2_components-overview.md)
- [Security Best Practices](../9_security/1_security-cleanup-guide.md)
### Tools & SDKs
- [Python SDK](../2_clients/1_quick-start.md)
- [JavaScript SDK](../2_clients/1_quick-start.md)
- [Go SDK](../2_clients/1_quick-start.md)
- [Rust SDK](../2_clients/1_quick-start.md)
- [CLI Tools](../0_getting_started/3_cli.md)
### Development Environment
- [Docker Compose Setup](../8_development/2_setup.md)
- [Local Testnet](../8_development/1_overview.md)
- [Faucet for Test Tokens](../6_architecture/6_trade-exchange.md)
- [Block Explorer](../2_clients/0_readme.md#explorer-web)
### Learning Resources
- [Video Tutorials](../2_clients/1_quick-start.md)
- [Workshop Materials](../2_clients/2_job-submission.md)
- [Blog Posts](../1_project/2_roadmap.md)
- [Research Papers](../5_reference/5_zk-proofs.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 GitHub](https://github.com/oib/AITBC/issues)