Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Failing after 8s
CLI Tests / test-cli (push) Successful in 10s
Contract Performance Benchmarks / benchmark-gas-usage (push) Successful in 1m22s
Contract Performance Benchmarks / benchmark-execution-time (push) Successful in 1m11s
Contract Performance Benchmarks / benchmark-throughput (push) Successful in 1m13s
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Failing after 5s
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Successful in 5s
Cross-Chain Functionality Tests / test-cross-chain-bridge (push) Has been skipped
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Failing after 3s
Cross-Chain Functionality Tests / aggregate-results (push) Has been skipped
Cross-Node Transaction Testing / transaction-test (push) Successful in 5s
Deploy to Testnet / deploy-testnet (push) Successful in 1m14s
Contract Performance Benchmarks / compare-benchmarks (push) Has been cancelled
Documentation Validation / validate-docs (push) Failing after 10s
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Smart Contract Tests / test-solidity (map[name:aitbc-contracts path:contracts]) (push) Has been cancelled
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Has been cancelled
Smart Contract Tests / test-foundry (push) Has been cancelled
Smart Contract Tests / lint-solidity (push) Has been cancelled
Smart Contract Tests / deploy-contracts (push) Has been cancelled
Documentation Validation / validate-policies-strict (push) Successful in 3s
Integration Tests / test-service-integration (push) Failing after 45s
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Failing after 2s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 5s
P2P Network Verification / p2p-verification (push) Successful in 3s
Production Tests / Production Integration Tests (push) Failing after 7s
Python Tests / test-python (push) Failing after 46s
Staking Tests / test-staking-service (push) Failing after 2s
Staking Tests / test-staking-integration (push) Has been skipped
Staking Tests / test-staking-contract (push) Has been skipped
Staking Tests / run-staking-test-runner (push) Has been skipped
Systemd Sync / sync-systemd (push) Successful in 21s
API Endpoint Tests / test-api-endpoints (push) Failing after 12m19s
- Changed pytest calls to use `venv/bin/python -m pytest` with explicit config - Added `--rootdir "$PWD"` and `--import-mode=importlib` for consistent imports - Fixed PYTHONPATH to use absolute paths with $PWD prefix - Added smart contract security scanning for Solidity files - Added Circom circuit security checks for ZK proof circuits - Added ZK proof implementation security validation - Added contracts/** to security scanning workflow
178 lines
5.9 KiB
Markdown
178 lines
5.9 KiB
Markdown
# AITBC Setup Guide
|
|
|
|
## Quick Setup (New Host)
|
|
|
|
The main setup script lives at `scripts/setup.sh`.
|
|
|
|
Run this single command on any new host to install AITBC:
|
|
|
|
```bash
|
|
sudo bash <(curl -sSL https://gitea.bubuit.net/oib/aitbc/raw/branch/main/scripts/setup.sh)
|
|
```
|
|
|
|
Or clone and run manually:
|
|
|
|
```bash
|
|
sudo git clone https://gitea.bubuit.net/oib/aitbc.git /opt/aitbc
|
|
cd /opt/aitbc
|
|
sudo chmod +x scripts/setup.sh
|
|
sudo ./scripts/setup.sh
|
|
```
|
|
|
|
## What `scripts/setup.sh` Does
|
|
|
|
1. **Prerequisites Check**
|
|
- Verifies Python 3.13.5+, pip3, git, systemd
|
|
- Checks for root privileges
|
|
|
|
2. **Repository Setup**
|
|
- Clones AITBC repository to `/opt/aitbc`
|
|
- Handles multiple repository URLs for reliability
|
|
|
|
3. **Virtual Environments**
|
|
- Creates Python venvs for each service
|
|
- Installs dependencies from `requirements.txt` when available
|
|
- Falls back to core dependencies if requirements missing
|
|
|
|
4. **Runtime Directories**
|
|
- Creates standard Linux directories:
|
|
- `/var/lib/aitbc/keystore/` - Blockchain keys
|
|
- `/var/lib/aitbc/data/` - Database files
|
|
- `/var/lib/aitbc/logs/` - Application logs
|
|
- `/etc/aitbc/` - Configuration files
|
|
- Sets proper permissions and ownership
|
|
|
|
5. **PostgreSQL Databases**
|
|
- Installs PostgreSQL if not present
|
|
- Creates databases: aitbc_coordinator, aitbc_exchange, aitbc_wallet, aitbc_marketplace, aitbc_governance, aitbc_trading, aitbc_gpu, aitbc_ai, aitbc_mempool
|
|
- Creates dedicated users for each database
|
|
- Grants necessary privileges
|
|
- Uses centralized script: `/opt/aitbc/infra/scripts/setup_postgresql_databases.sh`
|
|
|
|
6. **Systemd Services**
|
|
- Installs service files to `/etc/systemd/system/`
|
|
- Enables auto-start on boot
|
|
- Provides fallback manual startup
|
|
|
|
7. **Service Management**
|
|
- Creates `/opt/aitbc/start-services.sh` for manual control
|
|
- Uses `/opt/aitbc/scripts/monitoring/health_check.sh` for monitoring
|
|
- Sets up logging to `/var/log/aitbc-*.log`
|
|
|
|
## Runtime Directories
|
|
|
|
AITBC uses standard Linux system directories for runtime data:
|
|
|
|
```
|
|
/var/lib/aitbc/
|
|
├── keystore/ # Blockchain private keys (700 permissions)
|
|
├── data/ # Database files (.db, .sqlite)
|
|
└── logs/ # Application logs
|
|
|
|
/etc/aitbc/ # Configuration files
|
|
/var/log/aitbc/ # System logging (symlink)
|
|
```
|
|
|
|
### Security Notes
|
|
- **Keystore**: Restricted to root/aitbc user only
|
|
- **Data**: Writable by services, readable by admin
|
|
- **Logs**: Rotated automatically by logrotate
|
|
|
|
## Service Endpoints
|
|
|
|
| Service | Port | Health Endpoint |
|
|
|---------|------|----------------|
|
|
| Wallet API | 8003 | `http://localhost:8003/health` |
|
|
| Exchange API | 8001 | `http://localhost:8001/api/health` |
|
|
| Coordinator API | 8000 | `http://localhost:8011/health` |
|
|
| Blockchain RPC | 8545 | `http://localhost:8545` |
|
|
|
|
## Management Commands
|
|
|
|
```bash
|
|
# Check service health
|
|
/opt/aitbc/scripts/monitoring/health_check.sh
|
|
|
|
# Restart all services
|
|
/opt/aitbc/start-services.sh
|
|
|
|
# View logs (new standard locations)
|
|
tail -f /var/lib/aitbc/logs/aitbc-wallet.log
|
|
tail -f /var/lib/aitbc/logs/aitbc-coordinator.log
|
|
tail -f /var/lib/aitbc/logs/aitbc-exchange.log
|
|
|
|
# Check keystore
|
|
ls -la /var/lib/aitbc/keystore/
|
|
|
|
# Systemd control
|
|
systemctl status aitbc-wallet
|
|
systemctl restart aitbc-coordinator-api
|
|
systemctl stop aitbc-exchange-api
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Services Not Starting
|
|
1. Check logs: `tail -f /var/lib/aitbc/logs/aitbc-*.log`
|
|
2. Verify ports: `netstat -tlnp | grep ':800'`
|
|
3. Check processes: `ps aux | grep python`
|
|
4. Verify runtime directories: `ls -la /var/lib/aitbc/`
|
|
|
|
### Missing Dependencies
|
|
The setup script handles missing `requirements.txt` files by installing core dependencies:
|
|
- fastapi
|
|
- uvicorn
|
|
- pydantic
|
|
- httpx
|
|
- python-dotenv
|
|
|
|
### Port Conflicts
|
|
Services use these default ports. If conflicts exist:
|
|
1. Kill conflicting processes: `kill <pid>`
|
|
2. Modify service files to use different ports
|
|
3. Restart services
|
|
|
|
## Development Mode
|
|
|
|
For development with manual control:
|
|
|
|
```bash
|
|
cd /opt/aitbc/apps/wallet
|
|
source .venv/bin/activate
|
|
python simple_daemon.py
|
|
|
|
cd /opt/aitbc/apps/exchange
|
|
source .venv/bin/activate
|
|
python simple_exchange_api.py
|
|
|
|
cd /opt/aitbc/apps/coordinator-api/src
|
|
source ../.venv/bin/activate
|
|
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000
|
|
```
|
|
|
|
## Production Considerations
|
|
|
|
For production deployment:
|
|
1. Configure proper environment variables
|
|
2. Set up reverse proxy (nginx)
|
|
3. Configure SSL certificates manually outside `scripts/setup.sh`
|
|
4. Set up log rotation
|
|
5. Configure monitoring and alerts
|
|
6. Use proper database setup (PostgreSQL/Redis)
|
|
|
|
## Hermes Skills Integration
|
|
|
|
AITBC includes documentation skills for Hermes agents. These skills enable automated operations and can be imported by Hermes agents to perform tasks:
|
|
|
|
- **[Documentation Skills](../skills/)** - Complete skill library for Hermes agents:
|
|
- [aitbc-basic-operations.md](../skills/aitbc-basic-operations.md) - Basic CLI operations, wallet management, blockchain status
|
|
- [aitbc-marketplace.md](../skills/aitbc-marketplace.md) - Marketplace operations, GPU provider registration, trading
|
|
- [aitbc-node-coordination.md](../skills/aitbc-node-coordination.md) - Multi-node coordination, git synchronization, blockchain sync
|
|
- [aitbc-wallet-management.md](../skills/aitbc-wallet-management.md) - Wallet creation, import/export, balance checks, deletion
|
|
- [aitbc-ai-operations.md](../skills/aitbc-ai-operations.md) - AI job submission, monitoring, resource allocation, GPU testing
|
|
- [aitbc-blockchain-troubleshooting.md](../skills/aitbc-blockchain-troubleshooting.md) - Blockchain troubleshooting, sync issues, P2P problems
|
|
- [aitbc-multi-node-operations.md](../skills/aitbc-multi-node-operations.md) - Multi-node operations, git sync, service restart, blockchain sync
|
|
- [aitbc-cli.md](../skills/aitbc-cli.md) - CLI tool reference for training agents and workflow operations
|
|
|
|
These skills are located in `docs/skills/` and follow the YAML frontmatter format required by Hermes for skill loading.
|