- Remove executable permissions from configuration files (.editorconfig, .env.example, .gitignore) - Remove executable permissions from documentation files (README.md, LICENSE, SECURITY.md) - Remove executable permissions from web assets (HTML, CSS, JS files) - Remove executable permissions from data files (JSON, SQL, YAML, requirements.txt) - Remove executable permissions from source code files across all apps - Add executable permissions to Python
7.0 KiB
7.0 KiB
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
# 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
- Fork the repository on GitHub
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Add tests for new functionality
- Ensure all tests pass:
make test - Submit a pull request
Code Style
- Rust: Use
rustfmtandclippy - Python: Follow PEP 8, use
blackandflake8 - TypeScript: Use Prettier and ESLint
- Go: Use
gofmt
Pull Request Process
- Update documentation for any changes
- Add unit tests for new features
- Ensure CI/CD pipeline passes
- Request review from core team
- 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
- Check open issues on GitHub
- Comment on the issue you want to work on
- Submit your solution
- Get reviewed by core team
- 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
Tools & SDKs
Development Environment
Learning Resources
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
# 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
# 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
# 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 testlocally 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 testor 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
- Discord: Join our server
- Email: aitbc@bubuit.net
- Issues: Report on GitHub