chore: remove legacy deployment files and update gitignore
- Removed .deployment_progress tracking file - Removed .last_backup tracking file - Removed AITBC1_TEST_COMMANDS.md and AITBC1_UPDATED_COMMANDS.md documentation - Updated .gitignore for project reorganization (project-config/, docs/, security/, backup-config/) - Enhanced .gitignore patterns for __pycache__, backups, and monitoring files - Aligned gitignore with new directory structure from project reorganization
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
consensus:started:1775124269
|
||||
consensus:failed:1775124272
|
||||
network:started:1775124272
|
||||
network:failed:1775124272
|
||||
economics:started:1775124272
|
||||
economics:failed:1775124272
|
||||
agents:started:1775124272
|
||||
agents:failed:1775124272
|
||||
contracts:started:1775124272
|
||||
contracts:failed:1775124272
|
||||
consensus:started:1775124349
|
||||
consensus:failed:1775124351
|
||||
network:started:1775124351
|
||||
network:completed:1775124352
|
||||
economics:started:1775124353
|
||||
economics:failed:1775124354
|
||||
agents:started:1775124354
|
||||
agents:failed:1775124354
|
||||
contracts:started:1775124354
|
||||
contracts:failed:1775124355
|
||||
consensus:started:1775124364
|
||||
consensus:failed:1775124365
|
||||
network:started:1775124365
|
||||
network:completed:1775124366
|
||||
economics:started:1775124366
|
||||
economics:failed:1775124368
|
||||
agents:started:1775124368
|
||||
agents:failed:1775124368
|
||||
contracts:started:1775124368
|
||||
contracts:failed:1775124369
|
||||
consensus:started:1775124518
|
||||
consensus:failed:1775124520
|
||||
network:started:1775124520
|
||||
network:completed:1775124521
|
||||
economics:started:1775124521
|
||||
economics:failed:1775124522
|
||||
agents:started:1775124522
|
||||
agents:failed:1775124522
|
||||
contracts:started:1775124522
|
||||
contracts:failed:1775124524
|
||||
consensus:started:1775124560
|
||||
consensus:failed:1775124561
|
||||
network:started:1775124561
|
||||
network:completed:1775124563
|
||||
economics:started:1775124563
|
||||
economics:failed:1775124564
|
||||
agents:started:1775124564
|
||||
agents:failed:1775124564
|
||||
contracts:started:1775124564
|
||||
contracts:failed:1775124566
|
||||
106
.gitignore
vendored
106
.gitignore
vendored
@@ -1,11 +1,13 @@
|
||||
# AITBC Monorepo ignore rules
|
||||
# Updated: 2026-03-18 - Security fixes for hardcoded passwords
|
||||
# Development files organized into dev/ subdirectories
|
||||
# Updated: 2026-04-02 - Project reorganization and security fixes
|
||||
# Development files organized into subdirectories
|
||||
|
||||
# ===================
|
||||
# Python
|
||||
# ===================
|
||||
__pycache__/
|
||||
*/__pycache__/
|
||||
**/__pycache__/
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.pyd
|
||||
@@ -105,14 +107,42 @@ target/
|
||||
*.dylib
|
||||
|
||||
# ===================
|
||||
# Secrets & Credentials (CRITICAL SECURITY)
|
||||
# ===================
|
||||
# Node.js & npm
|
||||
# ===================
|
||||
node_modules/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# ===================
|
||||
# Project Configuration (moved to project-config/)
|
||||
# ===================
|
||||
project-config/.deployment_progress
|
||||
project-config/.last_backup
|
||||
project-config/=*
|
||||
# requirements.txt, pyproject.toml, and poetry.lock are now at root level
|
||||
|
||||
# ===================
|
||||
# Documentation (moved to docs/)
|
||||
# ===================
|
||||
docs/AITBC1_*.md
|
||||
docs/PYTHON_VERSION_STATUS.md
|
||||
docs/SETUP.md
|
||||
docs/README_DOCUMENTATION.md
|
||||
|
||||
# ===================
|
||||
# Security Reports (moved to security/)
|
||||
# ===================
|
||||
security/SECURITY_*.md
|
||||
|
||||
# ===================
|
||||
# Backup Configuration (moved to backup-config/)
|
||||
# ===================
|
||||
backup-config/*.backup
|
||||
|
||||
# ===================
|
||||
# Secrets & Credentials (CRITICAL SECURITY)
|
||||
# ===================
|
||||
# Password files (NEVER commit these)
|
||||
*.password
|
||||
*.pass
|
||||
@@ -129,6 +159,9 @@ private_key.*
|
||||
# ===================
|
||||
# Backup Files (organized)
|
||||
# ===================
|
||||
backups/
|
||||
backups/*
|
||||
backups/**/*
|
||||
backup/**/*.tmp
|
||||
backup/**/*.temp
|
||||
backup/**/.DS_Store
|
||||
@@ -167,7 +200,8 @@ temp/
|
||||
# ===================
|
||||
# Wallet Files (contain private keys)
|
||||
# ===================
|
||||
# Specific wallet and private key JSON files (contain private keys)
|
||||
wallet*.json
|
||||
|
||||
# ===================
|
||||
# Project Specific
|
||||
# ===================
|
||||
@@ -184,6 +218,7 @@ apps/explorer-web/dist/
|
||||
packages/solidity/aitbc-token/typechain-types/
|
||||
packages/solidity/aitbc-token/artifacts/
|
||||
packages/solidity/aitbc-token/cache/
|
||||
packages/solidity/aitbc-token/node_modules/
|
||||
|
||||
# Local test fixtures and E2E testing
|
||||
tests/e2e/fixtures/home/**/.aitbc/cache/
|
||||
@@ -202,6 +237,7 @@ tests/e2e/fixtures/home/**/.aitbc/*.sock
|
||||
|
||||
# Local test data
|
||||
tests/fixtures/generated/
|
||||
tests/__pycache__/
|
||||
|
||||
# GPU miner local configs
|
||||
scripts/gpu/*.local.py
|
||||
@@ -222,8 +258,8 @@ docs/1_project/4_currentissue.md
|
||||
# ===================
|
||||
# Website (local deployment details)
|
||||
# ===================
|
||||
website/README.md
|
||||
website/aitbc-proxy.conf
|
||||
website/README.md.example
|
||||
website/aitbc-proxy.conf.example
|
||||
|
||||
# ===================
|
||||
# Local Config & Secrets
|
||||
@@ -248,31 +284,14 @@ infra/helm/values/prod/
|
||||
infra/helm/values/prod.yaml
|
||||
|
||||
# ===================
|
||||
# Node.js
|
||||
# ===================
|
||||
node_modules/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Build artifacts
|
||||
build/
|
||||
dist/
|
||||
target/
|
||||
|
||||
# System files
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Coverage reports
|
||||
# ===================
|
||||
htmlcov/
|
||||
.coverage
|
||||
.coverage.*
|
||||
coverage.xml
|
||||
*.cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
@@ -280,56 +299,31 @@ coverage.xml
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# Environments
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# ===================
|
||||
# AITBC specific (CRITICAL SECURITY)
|
||||
# ===================
|
||||
data/
|
||||
logs/
|
||||
*.db
|
||||
*.sqlite
|
||||
wallet*.json
|
||||
certificates/
|
||||
|
||||
# Guardian contract databases (contain spending limits)
|
||||
guardian_contracts/
|
||||
*.guardian.db
|
||||
|
||||
# Multi-chain wallet data
|
||||
.wallets/
|
||||
.wallets/*
|
||||
|
||||
# Agent protocol data
|
||||
.agent_data/
|
||||
.agent_data/*
|
||||
|
||||
# Operational and setup files
|
||||
results/
|
||||
tools/
|
||||
data/
|
||||
*.db
|
||||
*.log
|
||||
production/data/
|
||||
production/logs/
|
||||
config/
|
||||
*.env
|
||||
api_keys.txt
|
||||
*.yaml
|
||||
!*.example
|
||||
logs/
|
||||
production/logs/
|
||||
*.log
|
||||
*.log.*
|
||||
production/data/
|
||||
production/logs/
|
||||
dev/cache/logs/
|
||||
dev/test-nodes/*/data/
|
||||
backups/*/config/
|
||||
backups/*/logs/
|
||||
|
||||
# ===================
|
||||
# Monitoring & Systemd
|
||||
# ===================
|
||||
monitoring/*.pid
|
||||
systemd/*.backup
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/opt/aitbc/backups/pre_deployment_20260402_120920
|
||||
@@ -1,144 +0,0 @@
|
||||
# AITBC1 Server Test Commands
|
||||
|
||||
## 🚀 **Sync and Test Instructions**
|
||||
|
||||
Run these commands on the **aitbc1 server** to test the workflow migration:
|
||||
|
||||
### **Step 1: Sync from Gitea**
|
||||
```bash
|
||||
# Navigate to AITBC directory
|
||||
cd /opt/aitbc
|
||||
|
||||
# Pull latest changes from localhost aitbc (Gitea)
|
||||
git pull origin main
|
||||
```
|
||||
|
||||
### **Step 2: Run Comprehensive Test**
|
||||
```bash
|
||||
# Execute the automated test script
|
||||
./scripts/testing/aitbc1_sync_test.sh
|
||||
```
|
||||
|
||||
### **Step 3: Manual Verification (Optional)**
|
||||
```bash
|
||||
# Check that pre-commit config is gone
|
||||
ls -la .pre-commit-config.yaml
|
||||
# Should show: No such file or directory
|
||||
|
||||
# Check workflow files exist
|
||||
ls -la .windsurf/workflows/
|
||||
# Should show: code-quality.md, type-checking-ci-cd.md, etc.
|
||||
|
||||
# Test git operations (no warnings)
|
||||
echo "test" > test_file.txt
|
||||
git add test_file.txt
|
||||
git commit -m "test: verify no pre-commit warnings"
|
||||
git reset --hard HEAD~1
|
||||
rm test_file.txt
|
||||
|
||||
# Test type checking
|
||||
./scripts/type-checking/check-coverage.sh
|
||||
|
||||
# Test MyPy
|
||||
./venv/bin/mypy --ignore-missing-imports apps/coordinator-api/src/app/domain/job.py
|
||||
```
|
||||
|
||||
## 📋 **Expected Results**
|
||||
|
||||
### ✅ **Successful Sync**
|
||||
- Git pull completes without errors
|
||||
- Latest workflow files are available
|
||||
- No pre-commit configuration file
|
||||
|
||||
### ✅ **No Pre-commit Warnings**
|
||||
- Git add/commit operations work silently
|
||||
- No "No .pre-commit-config.yaml file was found" messages
|
||||
- Clean git operations
|
||||
|
||||
### ✅ **Workflow System Working**
|
||||
- Type checking script executes
|
||||
- MyPy runs on domain models
|
||||
- Workflow documentation accessible
|
||||
|
||||
### ✅ **File Organization**
|
||||
- `.windsurf/workflows/` contains workflow files
|
||||
- `scripts/type-checking/` contains type checking tools
|
||||
- `config/quality/` contains quality configurations
|
||||
|
||||
## 🔧 **Debugging**
|
||||
|
||||
### **If Git Pull Fails**
|
||||
```bash
|
||||
# Check remote configuration
|
||||
git remote -v
|
||||
|
||||
# Force pull if needed
|
||||
git fetch origin main
|
||||
git reset --hard origin/main
|
||||
```
|
||||
|
||||
### **If Type Checking Fails**
|
||||
```bash
|
||||
# Check dependencies
|
||||
./venv/bin/pip install mypy sqlalchemy sqlmodel fastapi
|
||||
|
||||
# Check script permissions
|
||||
chmod +x scripts/type-checking/check-coverage.sh
|
||||
|
||||
# Run manually
|
||||
./venv/bin/mypy --ignore-missing-imports apps/coordinator-api/src/app/domain/
|
||||
```
|
||||
|
||||
### **If Pre-commit Warnings Appear**
|
||||
```bash
|
||||
# Check if pre-commit is still installed
|
||||
./venv/bin/pre-commit --version
|
||||
|
||||
# Uninstall if needed
|
||||
./venv/bin/pre-commit uninstall
|
||||
|
||||
# Check git config
|
||||
git config --get pre-commit.allowMissingConfig
|
||||
# Should return: true
|
||||
```
|
||||
|
||||
## 📊 **Test Checklist**
|
||||
|
||||
- [ ] Git pull from Gitea successful
|
||||
- [ ] No pre-commit warnings on git operations
|
||||
- [ ] Workflow files present in `.windsurf/workflows/`
|
||||
- [ ] Type checking script executable
|
||||
- [ ] MyPy runs without errors
|
||||
- [ ] Documentation accessible
|
||||
- [ ] No `.pre-commit-config.yaml` file
|
||||
- [ ] All tests in script pass
|
||||
|
||||
## 🎯 **Success Indicators**
|
||||
|
||||
### **Green Lights**
|
||||
```
|
||||
[SUCCESS] Successfully pulled from Gitea
|
||||
[SUCCESS] Pre-commit config successfully removed
|
||||
[SUCCESS] Type checking test passed
|
||||
[SUCCESS] MyPy test on job.py passed
|
||||
[SUCCESS] Git commit successful (no pre-commit warnings)
|
||||
[SUCCESS] AITBC1 server sync and test completed successfully!
|
||||
```
|
||||
|
||||
### **File Structure**
|
||||
```
|
||||
/opt/aitbc/
|
||||
├── .windsurf/workflows/
|
||||
│ ├── code-quality.md
|
||||
│ ├── type-checking-ci-cd.md
|
||||
│ └── MULTI_NODE_MASTER_INDEX.md
|
||||
├── scripts/type-checking/
|
||||
│ └── check-coverage.sh
|
||||
├── config/quality/
|
||||
│ └── requirements-consolidated.txt
|
||||
└── (no .pre-commit-config.yaml file)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Run these commands on aitbc1 server to verify the workflow migration is working correctly!**
|
||||
@@ -1,135 +0,0 @@
|
||||
# AITBC1 Server - Updated Commands
|
||||
|
||||
## 🎯 **Status Update**
|
||||
The aitbc1 server test was **mostly successful**! ✅
|
||||
|
||||
### **✅ What Worked**
|
||||
- Git pull from Gitea: ✅ Successful
|
||||
- Workflow files: ✅ Available (17 files)
|
||||
- Pre-commit removal: ✅ Confirmed (no warnings)
|
||||
- Git operations: ✅ No warnings on commit
|
||||
|
||||
### **⚠️ Minor Issues Fixed**
|
||||
- Missing workflow files: ✅ Now pushed to Gitea
|
||||
- .windsurf in .gitignore: ✅ Fixed (now tracking workflows)
|
||||
|
||||
## 🚀 **Updated Commands for AITBC1**
|
||||
|
||||
### **Step 1: Pull Latest Changes**
|
||||
```bash
|
||||
# On aitbc1 server:
|
||||
cd /opt/aitbc
|
||||
git pull origin main
|
||||
```
|
||||
|
||||
### **Step 2: Install Missing Dependencies**
|
||||
```bash
|
||||
# Install MyPy for type checking
|
||||
./venv/bin/pip install mypy sqlalchemy sqlmodel fastapi
|
||||
```
|
||||
|
||||
### **Step 3: Verify New Workflow Files**
|
||||
```bash
|
||||
# Check that new workflow files are now available
|
||||
ls -la .windsurf/workflows/code-quality.md
|
||||
ls -la .windsurf/workflows/type-checking-ci-cd.md
|
||||
|
||||
# Should show both files exist
|
||||
```
|
||||
|
||||
### **Step 4: Test Type Checking**
|
||||
```bash
|
||||
# Now test type checking with dependencies installed
|
||||
./scripts/type-checking/check-coverage.sh
|
||||
|
||||
# Test MyPy directly
|
||||
./venv/bin/mypy --ignore-missing-imports apps/coordinator-api/src/app/domain/job.py
|
||||
```
|
||||
|
||||
### **Step 5: Run Full Test Again**
|
||||
```bash
|
||||
# Run the comprehensive test script again
|
||||
./scripts/testing/aitbc1_sync_test.sh
|
||||
```
|
||||
|
||||
## 📊 **Expected Results After Update**
|
||||
|
||||
### **✅ Perfect Test Output**
|
||||
```
|
||||
[SUCCESS] Successfully pulled from Gitea
|
||||
[SUCCESS] Workflow directory found
|
||||
[SUCCESS] Pre-commit config successfully removed
|
||||
[SUCCESS] Type checking script found
|
||||
[SUCCESS] Type checking test passed
|
||||
[SUCCESS] MyPy test on job.py passed
|
||||
[SUCCESS] Git commit successful (no pre-commit warnings)
|
||||
[SUCCESS] AITBC1 server sync and test completed successfully!
|
||||
```
|
||||
|
||||
### **📁 New Files Available**
|
||||
```
|
||||
.windsurf/workflows/
|
||||
├── code-quality.md # ✅ NEW
|
||||
├── type-checking-ci-cd.md # ✅ NEW
|
||||
└── MULTI_NODE_MASTER_INDEX.md # ✅ Already present
|
||||
```
|
||||
|
||||
## 🔧 **If Issues Persist**
|
||||
|
||||
### **MyPy Still Not Found**
|
||||
```bash
|
||||
# Check venv activation
|
||||
source ./venv/bin/activate
|
||||
|
||||
# Install in correct venv
|
||||
pip install mypy sqlalchemy sqlmodel fastapi
|
||||
|
||||
# Verify installation
|
||||
which mypy
|
||||
./venv/bin/mypy --version
|
||||
```
|
||||
|
||||
### **Workflow Files Still Missing**
|
||||
```bash
|
||||
# Force pull latest changes
|
||||
git fetch origin main
|
||||
git reset --hard origin/main
|
||||
|
||||
# Check files
|
||||
find .windsurf/workflows/ -name "*.md" | wc -l
|
||||
# Should show 19+ files
|
||||
```
|
||||
|
||||
## 🎉 **Success Criteria**
|
||||
|
||||
### **Complete Success Indicators**
|
||||
- ✅ **Git operations**: No pre-commit warnings
|
||||
- ✅ **Workflow files**: 19+ files available
|
||||
- ✅ **Type checking**: MyPy working and script passing
|
||||
- ✅ **Documentation**: New workflows accessible
|
||||
- ✅ **Migration**: 100% complete
|
||||
|
||||
### **Final Verification**
|
||||
```bash
|
||||
# Quick verification commands
|
||||
echo "=== Verification ==="
|
||||
echo "1. Git operations (should be silent):"
|
||||
echo "test" > verify.txt && git add verify.txt && git commit -m "verify" && git reset --hard HEAD~1 && rm verify.txt
|
||||
|
||||
echo "2. Workflow files:"
|
||||
ls .windsurf/workflows/*.md | wc -l
|
||||
|
||||
echo "3. Type checking:"
|
||||
./scripts/type-checking/check-coverage.sh | head -5
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📞 **Next Steps**
|
||||
|
||||
1. **Run the updated commands** above on aitbc1
|
||||
2. **Verify all tests pass** with new dependencies
|
||||
3. **Test the new workflow system** instead of pre-commit
|
||||
4. **Enjoy the improved documentation** and organization!
|
||||
|
||||
**The migration is essentially complete - just need to install MyPy dependencies on aitbc1!** 🚀
|
||||
@@ -1,65 +0,0 @@
|
||||
# Project Root Directory Organization
|
||||
|
||||
## Changes Made
|
||||
|
||||
### Files Moved from Root to Subdirectories:
|
||||
|
||||
#### 📁 project-config/
|
||||
- `pyproject.toml` - Python project configuration
|
||||
- `requirements.txt` - Python dependencies
|
||||
- `poetry.lock` - Dependency lock file
|
||||
- `.gitignore` - Git ignore rules
|
||||
- `.deployment_progress` - Deployment tracking
|
||||
- `=26.0` - Version marker
|
||||
|
||||
#### 📁 documentation/
|
||||
- `README.md` - Main project documentation
|
||||
- `SETUP.md` - Setup instructions
|
||||
- `PYTHON_VERSION_STATUS.md` - Python compatibility
|
||||
- `AITBC1_TEST_COMMANDS.md` - Testing commands
|
||||
- `AITBC1_UPDATED_COMMANDS.md` - Updated commands
|
||||
|
||||
#### 📁 security/
|
||||
- `SECURITY_VULNERABILITY_REPORT.md` - Security analysis
|
||||
- `SECURITY_FIXES_SUMMARY.md` - Security fixes summary
|
||||
|
||||
#### 📁 backup-config/
|
||||
- `aitbc-cli.backup` - Backup of old CLI wrapper
|
||||
|
||||
### Files Remaining in Root:
|
||||
- `LICENSE` - Project license (essential)
|
||||
- `README.md` - New root README with structure guide
|
||||
- `aitbc-cli` - CLI symlink (essential)
|
||||
- All directories (apps/, cli/, scripts/, etc.)
|
||||
|
||||
### Scripts Updated:
|
||||
- `scripts/setup.sh` - Updated requirements.txt path
|
||||
- `scripts/dependency-management/update-dependencies.sh` - Updated pyproject.toml path
|
||||
- All scripts updated via `scripts/maintenance/update-file-references.sh`
|
||||
|
||||
## Benefits:
|
||||
1. **Cleaner Root**: Only essential files at root level
|
||||
2. **Better Organization**: Logical grouping of configuration files
|
||||
3. **Easier Maintenance**: Related files grouped together
|
||||
4. **Clearer Structure**: New README explains organization
|
||||
5. **Preserved Functionality**: All references updated
|
||||
|
||||
## Root Directory Structure:
|
||||
```
|
||||
/opt/aitbc/
|
||||
├── LICENSE # Essential
|
||||
├── README.md # Essential (new)
|
||||
├── aitbc-cli # Essential (symlink)
|
||||
├── aitbc/ # Core package
|
||||
├── apps/ # Applications
|
||||
├── cli/ # CLI implementation
|
||||
├── scripts/ # Automation scripts
|
||||
├── project-config/ # Configuration files
|
||||
├── documentation/ # User docs
|
||||
├── security/ # Security reports
|
||||
├── backup-config/ # Backups
|
||||
└── [other directories...] # Unchanged
|
||||
```
|
||||
|
||||
---
|
||||
**Status**: Root directory organized ✅
|
||||
@@ -1,162 +0,0 @@
|
||||
# Python 3.13 Version Status
|
||||
|
||||
## 🎯 **Current Status Report**
|
||||
|
||||
### **✅ You're Already Running the Latest!**
|
||||
|
||||
Your current Python installation is **already up-to-date**:
|
||||
|
||||
```
|
||||
System Python: 3.13.5
|
||||
Virtual Environment: 3.13.5
|
||||
Latest Available: 3.13.5
|
||||
```
|
||||
|
||||
### **📊 Version Details**
|
||||
|
||||
#### **Current Installation**
|
||||
```bash
|
||||
# System Python
|
||||
python3.13 --version
|
||||
# Output: Python 3.13.5
|
||||
|
||||
# Virtual Environment
|
||||
./venv/bin/python --version
|
||||
# Output: Python 3.13.5
|
||||
|
||||
# venv Configuration
|
||||
cat venv/pyvenv.cfg
|
||||
# version = 3.13.5
|
||||
```
|
||||
|
||||
#### **Package Installation Status**
|
||||
All Python 3.13 packages are properly installed:
|
||||
- ✅ python3.13 (3.13.5-2)
|
||||
- ✅ python3.13-dev (3.13.5-2)
|
||||
- ✅ python3.13-venv (3.13.5-2)
|
||||
- ✅ libpython3.13-dev (3.13.5-2)
|
||||
- ✅ All supporting packages
|
||||
|
||||
### **🔍 Verification Commands**
|
||||
|
||||
#### **Check Current Version**
|
||||
```bash
|
||||
# System version
|
||||
python3.13 --version
|
||||
|
||||
# Virtual environment version
|
||||
./venv/bin/python --version
|
||||
|
||||
# Package list
|
||||
apt list --installed | grep python3.13
|
||||
```
|
||||
|
||||
#### **Check for Updates**
|
||||
```bash
|
||||
# Check for available updates
|
||||
apt update
|
||||
apt list --upgradable | grep python3.13
|
||||
|
||||
# Currently: No updates available
|
||||
# Status: Running latest version
|
||||
```
|
||||
|
||||
### **🚀 Performance Benefits of Python 3.13.5**
|
||||
|
||||
#### **Key Improvements**
|
||||
- **🚀 Performance**: 5-10% faster than 3.12
|
||||
- **🧠 Memory**: Better memory management
|
||||
- **🔧 Error Messages**: Improved error reporting
|
||||
- **🛡️ Security**: Latest security patches
|
||||
- **⚡ Compilation**: Faster startup times
|
||||
|
||||
#### **AITBC-Specific Benefits**
|
||||
- **Type Checking**: Better MyPy integration
|
||||
- **FastAPI**: Improved async performance
|
||||
- **SQLAlchemy**: Optimized database operations
|
||||
- **AI/ML**: Enhanced numpy/pandas compatibility
|
||||
|
||||
### **📋 Maintenance Checklist**
|
||||
|
||||
#### **Monthly Check**
|
||||
```bash
|
||||
# Check for Python updates
|
||||
apt update
|
||||
apt list --upgradable | grep python3.13
|
||||
|
||||
# Check venv integrity
|
||||
./venv/bin/python --version
|
||||
./venv/bin/pip list --outdated
|
||||
```
|
||||
|
||||
#### **Quarterly Maintenance**
|
||||
```bash
|
||||
# Update system packages
|
||||
apt update && apt upgrade -y
|
||||
|
||||
# Update pip packages
|
||||
./venv/bin/pip install --upgrade pip
|
||||
./venv/bin/pip list --outdated
|
||||
./venv/bin/p install --upgrade <package-name>
|
||||
```
|
||||
|
||||
### **🔄 Future Upgrade Path**
|
||||
|
||||
#### **When Python 3.14 is Released**
|
||||
```bash
|
||||
# Monitor for new releases
|
||||
apt search python3.14
|
||||
|
||||
# Upgrade path (when available)
|
||||
apt install python3.14 python3.14-venv
|
||||
|
||||
# Recreate virtual environment
|
||||
deactivate
|
||||
rm -rf venv
|
||||
python3.14 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### **🎯 Current Recommendations**
|
||||
|
||||
#### **Immediate Actions**
|
||||
- ✅ **No action needed**: Already running latest 3.13.5
|
||||
- ✅ **System is optimal**: All packages up-to-date
|
||||
- ✅ **Performance optimized**: Latest improvements applied
|
||||
|
||||
#### **Monitoring**
|
||||
- **Monthly**: Check for security updates
|
||||
- **Quarterly**: Update pip packages
|
||||
- **Annually**: Review Python version strategy
|
||||
|
||||
### **📈 Version History**
|
||||
|
||||
| Version | Release Date | Status | Notes |
|
||||
|---------|--------------|--------|-------|
|
||||
| 3.13.5 | Current | ✅ Active | Latest stable |
|
||||
| 3.13.4 | Previous | ✅ Supported | Security fixes |
|
||||
| 3.13.3 | Previous | ✅ Supported | Bug fixes |
|
||||
| 3.13.2 | Previous | ✅ Supported | Performance |
|
||||
| 3.13.1 | Previous | ✅ Supported | Stability |
|
||||
| 3.13.0 | Previous | ✅ Supported | Initial release |
|
||||
|
||||
---
|
||||
|
||||
## 🎉 **Summary**
|
||||
|
||||
**You're already running the latest and greatest Python 3.13.5!**
|
||||
|
||||
- ✅ **Latest Version**: 3.13.5 (most recent stable)
|
||||
- ✅ **All Packages Updated**: Complete installation
|
||||
- ✅ **Optimal Performance**: Latest improvements
|
||||
- ✅ **Security Current**: Latest patches applied
|
||||
- ✅ **AITBC Ready**: Perfect for your project needs
|
||||
|
||||
**No upgrade needed - you're already at the forefront!** 🚀
|
||||
|
||||
---
|
||||
|
||||
*Last Checked: April 1, 2026*
|
||||
*Status: ✅ UP TO DATE*
|
||||
*Next Check: May 1, 2026*
|
||||
@@ -27,12 +27,12 @@ This project has been organized for better maintainability. Here's the directory
|
||||
|
||||
### 📁 Documentation
|
||||
- `docs/` - Comprehensive documentation
|
||||
- `documentation/` - User guides and manuals
|
||||
- `README.md` - Main project documentation
|
||||
- `SETUP.md` - Setup instructions
|
||||
- `PYTHON_VERSION_STATUS.md` - Python compatibility
|
||||
- `AITBC1_TEST_COMMANDS.md` - Testing commands
|
||||
- `AITBC1_UPDATED_COMMANDS.md` - Updated commands
|
||||
- `README_DOCUMENTATION.md` - Detailed documentation
|
||||
|
||||
### 📁 Development
|
||||
- `dev/` - Development tools and examples
|
||||
|
||||
@@ -1,202 +0,0 @@
|
||||
# AITBC Security Vulnerability Report
|
||||
|
||||
## Executive Summary
|
||||
|
||||
**Total Vulnerabilities Found: 365**
|
||||
- Critical: 8
|
||||
- High: 105
|
||||
- Medium: 130
|
||||
- Low: 122
|
||||
|
||||
*Report generated: 2026-04-02*
|
||||
|
||||
## Immediate Critical Issues
|
||||
|
||||
### 1. pip Package Vulnerabilities (2 CVEs)
|
||||
**Packages:** pip 25.1.1
|
||||
- **CVE-2025-8869**: Arbitrary File Overwrite (High)
|
||||
- **CVE-2026-1703**: Path Traversal (High)
|
||||
- **Fix**: Upgrade pip to >=26.0
|
||||
|
||||
### 2. Code Security Issues (3 High)
|
||||
**Files:** cli/utils/kyc_aml_providers.py, cli/utils/subprocess.py
|
||||
- **B324**: Weak MD5 hash usage (2 instances)
|
||||
- **B602**: subprocess with shell=True (1 instance)
|
||||
|
||||
## Detailed Findings
|
||||
|
||||
### Dependency Vulnerabilities
|
||||
|
||||
#### Critical/High Priority Dependencies
|
||||
```bash
|
||||
# Immediate fixes needed
|
||||
pip install --upgrade pip>=26.0
|
||||
|
||||
# Check other high-risk packages
|
||||
safety check --json --output safety-report.json
|
||||
pip-audit --format=json --output=pip-audit-report.json
|
||||
```
|
||||
|
||||
#### Medium Priority Dependencies
|
||||
- cryptography >=46.0.0 ✅ (Already updated)
|
||||
- requests >=2.32.0 ✅ (Already updated)
|
||||
- httpx >=0.28.0 ✅ (Already updated)
|
||||
|
||||
### Code Security Issues
|
||||
|
||||
#### High Severity
|
||||
1. **MD5 Hash Usage** (cli/utils/kyc_aml_providers.py:127, 187)
|
||||
```python
|
||||
# Current (vulnerable)
|
||||
hash_val = int(hashlib.md5(request_id.encode()).hexdigest()[:8], 16)
|
||||
|
||||
# Fix (SHA-256)
|
||||
hash_val = int(hashlib.sha256(request_id.encode()).hexdigest()[:8], 16)
|
||||
```
|
||||
|
||||
2. **Subprocess Shell Injection** (cli/utils/subprocess.py:12)
|
||||
```python
|
||||
# Current (vulnerable)
|
||||
result = subprocess.run(cmd_str, shell=True, check=check, ...)
|
||||
|
||||
# Fix (no shell)
|
||||
result = subprocess.run(cmd, check=check, shell=False, ...)
|
||||
```
|
||||
|
||||
#### Medium Severity
|
||||
- Hardcoded credentials in test files
|
||||
- Insecure random number generation
|
||||
- Missing input validation
|
||||
|
||||
#### Low Severity
|
||||
- Use of assert statements (244 instances)
|
||||
- Broad except clauses (38 instances)
|
||||
- Subprocess usage (multiple instances)
|
||||
|
||||
## Remediation Plan
|
||||
|
||||
### Phase 1: Critical Fixes (Immediate - <24 hours)
|
||||
|
||||
1. **Update pip**
|
||||
```bash
|
||||
python3 -m pip install --upgrade pip>=26.0
|
||||
```
|
||||
|
||||
2. **Fix MD5 Usage**
|
||||
```bash
|
||||
# Replace MD5 with SHA-256 in KYC/AML providers
|
||||
sed -i 's/hashlib.md5/hashlib.sha256/g' cli/utils/kyc_aml_providers.py
|
||||
```
|
||||
|
||||
3. **Fix Subprocess Security**
|
||||
```bash
|
||||
# Remove shell=True from subprocess calls
|
||||
# Update cli/utils/subprocess.py
|
||||
```
|
||||
|
||||
### Phase 2: High Priority (1-3 days)
|
||||
|
||||
1. **Update Dependencies**
|
||||
```bash
|
||||
# Update all packages with known vulnerabilities
|
||||
pip install --upgrade -r requirements.txt
|
||||
```
|
||||
|
||||
2. **Security Testing**
|
||||
```bash
|
||||
# Run comprehensive security scans
|
||||
bandit -r cli/ -f json -o bandit-report.json
|
||||
safety check --json --output safety-report.json
|
||||
pip-audit --format=json --output=pip-audit-report.json
|
||||
```
|
||||
|
||||
### Phase 3: Medium Priority (1 week)
|
||||
|
||||
1. **Code Review & Refactoring**
|
||||
- Remove assert statements from production code
|
||||
- Add proper input validation
|
||||
- Implement secure error handling
|
||||
|
||||
2. **Security Policies**
|
||||
```bash
|
||||
# Create .bandit configuration
|
||||
# Create safety policy file
|
||||
# Set up pre-commit security hooks
|
||||
```
|
||||
|
||||
### Phase 4: Low Priority (2 weeks)
|
||||
|
||||
1. **Documentation & Training**
|
||||
- Security best practices guide
|
||||
- Developer security training
|
||||
- Security testing procedures
|
||||
|
||||
## Automated Security Setup
|
||||
|
||||
### Pre-commit Hooks
|
||||
```yaml
|
||||
# .pre-commit-config.yaml
|
||||
repos:
|
||||
- repo: https://github.com/pycqa/bandit
|
||||
rev: 1.7.0
|
||||
hooks:
|
||||
- id: bandit
|
||||
args: ['-r', 'cli/']
|
||||
- repo: https://github.com/pyupio/safety
|
||||
rev: 2.3.0
|
||||
hooks:
|
||||
- id: safety
|
||||
args: ['--json', '--output', 'safety-report.json']
|
||||
```
|
||||
|
||||
### CI/CD Security Pipeline
|
||||
```yaml
|
||||
# .github/workflows/security.yml
|
||||
name: Security Scan
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
security:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run Safety
|
||||
run: safety check --json --output safety-report.json
|
||||
- name: Run Bandit
|
||||
run: bandit -r cli/ -f json -o bandit-report.json
|
||||
- name: Run pip-audit
|
||||
run: pip-audit --format=json --output=pip-audit-report.json
|
||||
```
|
||||
|
||||
## Compliance & Standards
|
||||
|
||||
### Security Standards Met
|
||||
- ✅ CWE-327: Use of Broken or Risky Cryptographic Algorithm
|
||||
- ✅ CWE-78: Improper Neutralization of Special Elements
|
||||
- ✅ CWE-703: Improper Check or Handling of Exceptional Conditions
|
||||
|
||||
### Ongoing Monitoring
|
||||
- Daily dependency scans
|
||||
- Weekly code security reviews
|
||||
- Monthly penetration testing
|
||||
- Quarterly security assessments
|
||||
|
||||
## Risk Assessment
|
||||
|
||||
### Current Risk Level: **HIGH**
|
||||
- **Critical**: 8 vulnerabilities require immediate attention
|
||||
- **High**: 105 vulnerabilities could lead to system compromise
|
||||
- **Business Impact**: Data breach, system compromise, financial loss
|
||||
|
||||
### Post-Remediation Risk: **LOW**
|
||||
- All critical vulnerabilities addressed
|
||||
- Automated security monitoring in place
|
||||
- Regular security updates scheduled
|
||||
|
||||
## Contact & Support
|
||||
|
||||
**Security Team**: security@aitbc.io
|
||||
**Emergency**: security-emergency@aitbc.io
|
||||
**GitHub**: https://github.com/oib/AITBC/security
|
||||
|
||||
---
|
||||
*This report will be updated as vulnerabilities are addressed and new ones are discovered.*
|
||||
152
SETUP.md
152
SETUP.md
@@ -1,152 +0,0 @@
|
||||
# AITBC Setup Guide
|
||||
|
||||
## Quick Setup (New Host)
|
||||
|
||||
Run this single command on any new host to install AITBC:
|
||||
|
||||
```bash
|
||||
sudo bash <(curl -sSL https://raw.githubusercontent.com/oib/aitbc/main/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 setup.sh
|
||||
sudo ./setup.sh
|
||||
```
|
||||
|
||||
## What the Setup Script 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. **Systemd Services**
|
||||
- Installs service files to `/etc/systemd/system/`
|
||||
- Enables auto-start on boot
|
||||
- Provides fallback manual startup
|
||||
|
||||
6. **Service Management**
|
||||
- Creates `/opt/aitbc/start-services.sh` for manual control
|
||||
- Creates `/opt/aitbc/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:8000/health` |
|
||||
| Blockchain RPC | 8545 | `http://localhost:8545` |
|
||||
|
||||
## Management Commands
|
||||
|
||||
```bash
|
||||
# Check service health
|
||||
/opt/aitbc/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
|
||||
4. Set up log rotation
|
||||
5. Configure monitoring and alerts
|
||||
6. Use proper database setup (PostgreSQL/Redis)
|
||||
@@ -1,706 +0,0 @@
|
||||
#!/bin/bash
|
||||
# AITBC CLI Wrapper with Training Compatibility
|
||||
# Maps training script commands to actual CLI commands
|
||||
|
||||
CLI_DIR="/opt/aitbc/cli"
|
||||
PYTHON_CLI="$CLI_DIR/aitbc_cli.py"
|
||||
|
||||
if [ ! -f "$PYTHON_CLI" ]; then
|
||||
echo "Error: AITBC CLI not found at $PYTHON_CLI"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Command mappings for training compatibility
|
||||
case "$1" in
|
||||
# Version/Help
|
||||
--version|-v)
|
||||
echo "aitbc-cli v2.0.0"
|
||||
exit 0
|
||||
;;
|
||||
--help|-h)
|
||||
echo "AITBC CLI - AI Training Blockchain Command Line Interface"
|
||||
echo ""
|
||||
echo "Usage: aitbc-cli [command] [options]"
|
||||
echo ""
|
||||
echo "Wallet Commands:"
|
||||
echo " create, delete, rename, list, balance, export, import"
|
||||
echo ""
|
||||
echo "Transaction Commands:"
|
||||
echo " send, transactions, batch"
|
||||
echo ""
|
||||
echo "Blockchain Commands:"
|
||||
echo " blockchain, chain, mine-start, mine-stop, mine-status"
|
||||
echo ""
|
||||
echo "Network Commands:"
|
||||
echo " network, agent, openclaw"
|
||||
echo ""
|
||||
echo "AI Commands:"
|
||||
echo " ai-ops, ai-submit, resource, ollama"
|
||||
echo ""
|
||||
echo "Marketplace Commands:"
|
||||
echo " marketplace, market-list, market-create"
|
||||
echo ""
|
||||
echo "Other Commands:"
|
||||
echo " workflow, analytics, simulate"
|
||||
exit 0
|
||||
;;
|
||||
|
||||
# Wallet command aliases
|
||||
export)
|
||||
shift
|
||||
python3 "$PYTHON_CLI" export "$@"
|
||||
exit $?
|
||||
;;
|
||||
sync)
|
||||
echo "Wallet sync: Synchronized with blockchain"
|
||||
exit 0
|
||||
;;
|
||||
backup)
|
||||
shift
|
||||
echo "Wallet backup: Creating backup..."
|
||||
python3 "$PYTHON_CLI" export "$@"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
# Blockchain command aliases
|
||||
blockchain)
|
||||
shift
|
||||
# Check for NODE_URL environment variable
|
||||
RPC_URL="${NODE_URL:-http://localhost:8006}"
|
||||
case "$1" in
|
||||
--info|info)
|
||||
python3 "$PYTHON_CLI" chain --rpc-url "$RPC_URL" 2>/dev/null || python3 "$PYTHON_CLI" chain
|
||||
;;
|
||||
--height|height)
|
||||
python3 "$PYTHON_CLI" chain --rpc-url "$RPC_URL" 2>/dev/null | grep -i height || python3 "$PYTHON_CLI" chain | grep -i height
|
||||
;;
|
||||
*)
|
||||
python3 "$PYTHON_CLI" chain "$@"
|
||||
;;
|
||||
esac
|
||||
exit $?
|
||||
;;
|
||||
|
||||
# Mining command aliases
|
||||
mining)
|
||||
shift
|
||||
case "$1" in
|
||||
start|--start)
|
||||
python3 "$PYTHON_CLI" mine-start "${@:2}"
|
||||
;;
|
||||
stop|--stop)
|
||||
python3 "$PYTHON_CLI" mine-stop
|
||||
;;
|
||||
status|--status)
|
||||
python3 "$PYTHON_CLI" mine-status
|
||||
;;
|
||||
*)
|
||||
python3 "$PYTHON_CLI" mine-status
|
||||
;;
|
||||
esac
|
||||
exit $?
|
||||
;;
|
||||
|
||||
# AI command aliases
|
||||
ai)
|
||||
shift
|
||||
case "$1" in
|
||||
submit|job)
|
||||
shift
|
||||
python3 "$PYTHON_CLI" ai-submit "$@"
|
||||
;;
|
||||
list|status|result)
|
||||
echo "AI jobs:"
|
||||
echo " No active jobs"
|
||||
;;
|
||||
service|ops)
|
||||
python3 "$PYTHON_CLI" ai-ops "$@"
|
||||
;;
|
||||
*)
|
||||
python3 "$PYTHON_CLI" ai-ops "$@"
|
||||
;;
|
||||
esac
|
||||
exit $?
|
||||
;;
|
||||
|
||||
# System command stub
|
||||
system)
|
||||
shift
|
||||
case "$1" in
|
||||
--status|status)
|
||||
echo "System status: OK"
|
||||
echo " Version: aitbc-cli v2.0.0"
|
||||
echo " Services: Running"
|
||||
echo " Nodes: 2 connected"
|
||||
;;
|
||||
*)
|
||||
echo "System: Operation completed"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
;;
|
||||
|
||||
# Block command stub
|
||||
block)
|
||||
shift
|
||||
case "$1" in
|
||||
info)
|
||||
python3 "$PYTHON_CLI" chain | grep -E "Height|Latest|Proposer"
|
||||
;;
|
||||
*)
|
||||
echo "Block information retrieved"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
;;
|
||||
|
||||
# Agent command stub
|
||||
agent)
|
||||
shift
|
||||
case "$1" in
|
||||
message|send)
|
||||
echo "Agent message sent"
|
||||
;;
|
||||
messages|receive)
|
||||
echo "Agent messages:"
|
||||
echo " No new messages"
|
||||
;;
|
||||
*)
|
||||
python3 "$PYTHON_CLI" agent "$@"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
;;
|
||||
|
||||
# Network command - Real implementation
|
||||
network)
|
||||
shift
|
||||
case "$1" in
|
||||
--status|status)
|
||||
python3 "$PYTHON_CLI" network
|
||||
;;
|
||||
--peers|peers|--sync|sync)
|
||||
echo "Network peers:"
|
||||
# Real connectivity test to genesis node
|
||||
if timeout 2 bash -c "</dev/tcp/localhost/8006" 2>/dev/null; then
|
||||
echo " - genesis (localhost:8006) - Connected ✓"
|
||||
else
|
||||
echo " - genesis (localhost:8006) - Unreachable ✗"
|
||||
fi
|
||||
# Real connectivity test to follower node
|
||||
if timeout 2 bash -c "</dev/tcp/10.1.223.40/8007" 2>/dev/null; then
|
||||
echo " - aitbc1 (10.1.223.40:8007) - Connected ✓"
|
||||
else
|
||||
echo " - aitbc1 (10.1.223.40:8007) - Unreachable ✗"
|
||||
fi
|
||||
# Check actual blockchain sync status
|
||||
GENESIS_HEIGHT=$(curl -s http://localhost:8006/status 2>/dev/null | grep -o '"height":[0-9]*' | cut -d: -f2 || echo "unknown")
|
||||
FOLLOWER_HEIGHT=$(curl -s http://10.1.223.40:8007/status 2>/dev/null | grep -o '"height":[0-9]*' | cut -d: -f2 || echo "unknown")
|
||||
echo " Sync: Genesis=$GENESIS_HEIGHT, Follower=$FOLLOWER_HEIGHT"
|
||||
;;
|
||||
--ping|ping)
|
||||
NODE="${2:-aitbc1}"
|
||||
if [ "$NODE" = "aitbc1" ] || [ "$NODE" = "10.1.223.40" ]; then
|
||||
HOST="10.1.223.40"
|
||||
PORT="8007"
|
||||
else
|
||||
HOST="localhost"
|
||||
PORT="8006"
|
||||
fi
|
||||
# Real TCP connectivity test
|
||||
START=$(date +%s%N)
|
||||
if timeout 3 bash -c "</dev/tcp/$HOST/$PORT" 2>/dev/null; then
|
||||
END=$(date +%s%N)
|
||||
LATENCY=$(( (END - START) / 1000000 ))
|
||||
echo "Ping: Node $NODE reachable (latency: ${LATENCY}ms)"
|
||||
else
|
||||
echo "Ping: Node $NODE unreachable"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
--propagate|propagate)
|
||||
echo "Data propagation test:"
|
||||
# Real test - try to get data from both nodes
|
||||
GENESIS_DATA=$(curl -s http://localhost:8006/status 2>/dev/null | head -1)
|
||||
FOLLOWER_DATA=$(curl -s http://10.1.223.40:8007/status 2>/dev/null | head -1)
|
||||
if [ -n "$GENESIS_DATA" ] && [ -n "$FOLLOWER_DATA" ]; then
|
||||
echo " Genesis: Data available ✓"
|
||||
echo " Follower: Data available ✓"
|
||||
echo " Propagation: Complete"
|
||||
else
|
||||
echo " Propagation: Partial (some nodes unreachable)"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
python3 "$PYTHON_CLI" network "$@"
|
||||
;;
|
||||
esac
|
||||
exit $?
|
||||
;;
|
||||
|
||||
# Contract command stubs
|
||||
contract)
|
||||
shift
|
||||
case "$1" in
|
||||
list|deploy|call)
|
||||
echo "Smart contracts:"
|
||||
echo " Available: OpenClawDAO, AIPowerRental, AIServiceAMM"
|
||||
;;
|
||||
*)
|
||||
echo "Contract operation completed"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
;;
|
||||
|
||||
# Marketplace command - Real implementation
|
||||
marketplace)
|
||||
shift
|
||||
case "$1" in
|
||||
buy)
|
||||
echo "Marketplace buy order:"
|
||||
# Try to get real marketplace data
|
||||
MARKET_DATA=$(curl -s http://localhost:8006/marketplace/listings 2>/dev/null)
|
||||
if [ -n "$MARKET_DATA" ]; then
|
||||
echo " Order placed via API"
|
||||
echo " Status: pending"
|
||||
else
|
||||
echo " Order ID: ord-$(date +%s)"
|
||||
echo " Status: simulated (API unavailable)"
|
||||
fi
|
||||
;;
|
||||
sell)
|
||||
echo "Marketplace sell listing:"
|
||||
echo " Listing ID: lst-$(date +%s)"
|
||||
echo " Status: active"
|
||||
;;
|
||||
orders|my-orders)
|
||||
echo "Active orders:"
|
||||
# Query real marketplace API
|
||||
ORDERS=$(curl -s http://localhost:8006/marketplace/orders 2>/dev/null)
|
||||
ORDER_COUNT=$(echo "$ORDERS" | grep -c "id" 2>/dev/null || echo "0")
|
||||
echo " Total orders: $ORDER_COUNT"
|
||||
echo " Buy orders: 0"
|
||||
echo " Sell orders: $ORDER_COUNT"
|
||||
;;
|
||||
list|status)
|
||||
echo "Marketplace listings:"
|
||||
# Real marketplace query
|
||||
LISTINGS=$(python3 "$PYTHON_CLI" marketplace --action list 2>/dev/null)
|
||||
if [ -n "$LISTINGS" ] && [ "$LISTINGS" != "No marketplace items found" ]; then
|
||||
echo "$LISTINGS"
|
||||
else
|
||||
echo " Active items: 0"
|
||||
echo " Status: marketplace module not loaded"
|
||||
fi
|
||||
;;
|
||||
cancel)
|
||||
echo "Order cancelled:"
|
||||
echo " Order ID: ${2:-unknown}"
|
||||
echo " Status: cancelled"
|
||||
;;
|
||||
search)
|
||||
QUERY="${2:-gpu}"
|
||||
echo "Marketplace search: '$QUERY'"
|
||||
echo " Results: 0 items found"
|
||||
;;
|
||||
create)
|
||||
shift
|
||||
python3 "$PYTHON_CLI" market-create "$@"
|
||||
;;
|
||||
bot|auto)
|
||||
echo "Marketplace bot:"
|
||||
# Check if bot can connect to marketplace
|
||||
if timeout 2 bash -c "</dev/tcp/localhost/8006" 2>/dev/null; then
|
||||
echo " Status: monitoring (genesis node)"
|
||||
echo " Strategy: balanced"
|
||||
echo " Auto-trading: enabled"
|
||||
else
|
||||
echo " Status: offline (no connection)"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
python3 "$PYTHON_CLI" marketplace "$@"
|
||||
;;
|
||||
esac
|
||||
exit $?
|
||||
;;
|
||||
|
||||
# Analytics command stubs
|
||||
analytics)
|
||||
shift
|
||||
case "$1" in
|
||||
report|metrics|export|data)
|
||||
echo "Analytics report generated"
|
||||
echo " Transactions: 45"
|
||||
echo " Volume: 12,500 AIT"
|
||||
echo " Active users: 8"
|
||||
echo " Period: 24h"
|
||||
;;
|
||||
performance|performance-report)
|
||||
echo "Performance report:"
|
||||
echo " Response time: 2.0s"
|
||||
echo " Throughput: 1000 TPS"
|
||||
echo " Uptime: 99.9%"
|
||||
;;
|
||||
predictive|forecast)
|
||||
echo "Predictive analytics:"
|
||||
echo " Trend: upward"
|
||||
echo " Forecast: +15% growth"
|
||||
;;
|
||||
optimize|optimization)
|
||||
echo "Analytics optimization: Complete"
|
||||
echo " Recommendations: 3 applied"
|
||||
;;
|
||||
*)
|
||||
python3 "$PYTHON_CLI" analytics "$@"
|
||||
;;
|
||||
esac
|
||||
exit $?
|
||||
;;
|
||||
|
||||
# Security command stubs
|
||||
security)
|
||||
shift
|
||||
case "$1" in
|
||||
audit)
|
||||
echo "Security audit: PASSED"
|
||||
echo " Wallets: 2 secured"
|
||||
echo " Transactions: 45 verified"
|
||||
;;
|
||||
scan)
|
||||
echo "Vulnerability scan: No issues found"
|
||||
;;
|
||||
compliance|gdpr)
|
||||
echo "Compliance check: Compliant"
|
||||
;;
|
||||
*)
|
||||
echo "Security operation completed"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
;;
|
||||
|
||||
# Workflow command stubs
|
||||
workflow)
|
||||
shift
|
||||
case "$1" in
|
||||
create|setup)
|
||||
echo "Workflow created: wf-$(date +%s)"
|
||||
echo " Status: active"
|
||||
echo " Steps: 5"
|
||||
;;
|
||||
monitor|status|check)
|
||||
echo "Workflow monitor:"
|
||||
echo " Active workflows: 3"
|
||||
echo " Completed: 45"
|
||||
echo " Failed: 0"
|
||||
;;
|
||||
execute|run)
|
||||
echo "Workflow executed: Success"
|
||||
;;
|
||||
schedule|cron)
|
||||
echo "Workflow scheduled: Daily at 00:00"
|
||||
;;
|
||||
*)
|
||||
python3 "$PYTHON_CLI" workflow "$@"
|
||||
;;
|
||||
esac
|
||||
exit $?
|
||||
;;
|
||||
|
||||
# Resource command - Real implementation
|
||||
resource)
|
||||
shift
|
||||
case "$1" in
|
||||
status)
|
||||
echo "Resource status:"
|
||||
# Real CPU usage
|
||||
CPU_USAGE=$(top -bn1 | grep "Cpu(s)" | awk '{print $2}' | cut -d'%' -f1)
|
||||
CPU_CORES=$(nproc)
|
||||
echo " CPU: ${CPU_USAGE:-0}% (${CPU_CORES} cores)"
|
||||
# Real Memory usage
|
||||
MEM_TOTAL=$(free -m | awk '/Mem:/ {print $2}')
|
||||
MEM_USED=$(free -m | awk '/Mem:/ {print $3}')
|
||||
if [ -n "$MEM_TOTAL" ] && [ "$MEM_TOTAL" -gt 0 ]; then
|
||||
MEM_PCT=$(awk "BEGIN {printf \"%.0f\", $MEM_USED*100/$MEM_TOTAL}")
|
||||
else
|
||||
MEM_PCT="0"
|
||||
fi
|
||||
echo " Memory: ${MEM_PCT}% (${MEM_USED}MB / ${MEM_TOTAL}MB)"
|
||||
# Real Disk usage
|
||||
DISK_PCT=$(df -h / | tail -1 | awk '{print $5}' | tr -d '%')
|
||||
DISK_FREE=$(df -h / | tail -1 | awk '{print $4}')
|
||||
echo " Storage: ${DISK_PCT}% used (${DISK_FREE} free)"
|
||||
# Check for GPU
|
||||
if command -v nvidia-smi &> /dev/null; then
|
||||
GPU_COUNT=$(nvidia-smi -L 2>/dev/null | wc -l)
|
||||
GPU_UTIL=$(nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits 2>/dev/null | head -1)
|
||||
echo " GPU: ${GPU_UTIL:-0}% (${GPU_COUNT} devices)"
|
||||
else
|
||||
echo " GPU: Not available"
|
||||
fi
|
||||
;;
|
||||
allocate)
|
||||
# Real allocation attempt
|
||||
echo "Resource allocation request:"
|
||||
echo " CPU: ${2:-2} cores requested"
|
||||
echo " Memory: ${3:-4}GB requested"
|
||||
echo " Status: queued (requires orchestrator)"
|
||||
;;
|
||||
optimize)
|
||||
echo "Resource optimization analysis:"
|
||||
BEFORE_MEM=$(free -m | awk '/Mem:/ {print $3}')
|
||||
# Run sync to clear caches
|
||||
sync && echo 3 > /proc/sys/vm/drop_caches 2>/dev/null || true
|
||||
AFTER_MEM=$(free -m | awk '/Mem:/ {print $3}')
|
||||
SAVED=$((BEFORE_MEM - AFTER_MEM))
|
||||
echo " Memory freed: ${SAVED}MB"
|
||||
echo " Status: completed"
|
||||
;;
|
||||
benchmark)
|
||||
echo "Running resource benchmark..."
|
||||
# CPU benchmark (simple calculation test)
|
||||
START=$(date +%s%N)
|
||||
for i in $(seq 1 1000000); do : ; done
|
||||
END=$(date +%s%N)
|
||||
CPU_TIME=$(( (END - START) / 1000000 ))
|
||||
echo " CPU: ${CPU_TIME}ms (1M iterations)"
|
||||
# Memory throughput test
|
||||
DD_RESULT=$(dd if=/dev/zero of=/tmp/memtest bs=1M count=100 2>&1 | tail -1)
|
||||
echo " Memory: $DD_RESULT"
|
||||
rm -f /tmp/memtest
|
||||
echo " Status: completed"
|
||||
;;
|
||||
release|free)
|
||||
echo "Resource release:"
|
||||
# Clear system caches
|
||||
sync && echo 3 > /proc/sys/vm/drop_caches 2>/dev/null || true
|
||||
echo " System caches cleared"
|
||||
echo " Status: resources freed"
|
||||
;;
|
||||
*)
|
||||
python3 "$PYTHON_CLI" resource "$@"
|
||||
;;
|
||||
esac
|
||||
exit $?
|
||||
;;
|
||||
|
||||
# Economic command - Real implementation
|
||||
economic)
|
||||
shift
|
||||
case "$1" in
|
||||
model|modeling)
|
||||
echo "Economic model analysis:"
|
||||
# Get real transaction data
|
||||
TX_DATA=$(curl -s http://localhost:8006/transactions/count 2>/dev/null || echo "0")
|
||||
echo " Transactions: $TX_DATA"
|
||||
echo " Model: supply-demand"
|
||||
;;
|
||||
forecast|predict)
|
||||
echo "Economic forecast:"
|
||||
# Calculate growth from real blockchain data
|
||||
HEIGHT_NOW=$(curl -s http://localhost:8006/status 2>/dev/null | grep -o '"height":[0-9]*' | cut -d: -f2 || echo "0")
|
||||
echo " Current height: $HEIGHT_NOW"
|
||||
echo " Trend: based on block growth"
|
||||
;;
|
||||
optimize|optimization)
|
||||
echo "Economic optimization:"
|
||||
# Get real marketplace data if available
|
||||
MARKET_ITEMS=$(curl -s http://localhost:8006/marketplace/listings 2>/dev/null | grep -c "id" || echo "0")
|
||||
echo " Active listings: $MARKET_ITEMS"
|
||||
echo " Optimization: based on demand patterns"
|
||||
;;
|
||||
analyze|analysis)
|
||||
echo "Economic analysis:"
|
||||
# Real blockchain metrics
|
||||
BLOCK_TIME=$(curl -s http://localhost:8006/status 2>/dev/null | grep -o '"timestamp":"[^"]*"' | cut -d'"' -f4 || echo "N/A")
|
||||
echo " Last block: $BLOCK_TIME"
|
||||
;;
|
||||
trends)
|
||||
echo "Economic trends:"
|
||||
# Real data from nodes
|
||||
GENESIS_TX=$(curl -s http://localhost:8006/transactions/count 2>/dev/null || echo "0")
|
||||
FOLLOWER_TX=$(curl -s http://10.1.223.40:8007/transactions/count 2>/dev/null || echo "0")
|
||||
echo " Genesis activity: $GENESIS_TX"
|
||||
echo " Follower activity: $FOLLOWER_TX"
|
||||
;;
|
||||
sync)
|
||||
echo "Economic sync:"
|
||||
# Check node synchronization
|
||||
G_HEIGHT=$(curl -s http://localhost:8006/status 2>/dev/null | grep -o '"height":[0-9]*' | cut -d: -f2 || echo "0")
|
||||
F_HEIGHT=$(curl -s http://10.1.223.40:8007/status 2>/dev/null | grep -o '"height":[0-9]*' | cut -d: -f2 || echo "0")
|
||||
if [ "$G_HEIGHT" = "$F_HEIGHT" ]; then
|
||||
echo " Status: Synchronized (height: $G_HEIGHT)"
|
||||
else
|
||||
echo " Status: Desync (Genesis: $G_HEIGHT, Follower: $F_HEIGHT)"
|
||||
fi
|
||||
;;
|
||||
revenue|sharing)
|
||||
echo "Revenue analysis:"
|
||||
# Get mining rewards
|
||||
REWARDS=$(curl -s http://localhost:8006/mining/rewards 2>/dev/null || echo "0")
|
||||
echo " Total mined: ${REWARDS} AIT"
|
||||
;;
|
||||
cost|cost-optimization)
|
||||
echo "Cost analysis:"
|
||||
# Real resource costs
|
||||
CPU_COST=$(top -bn1 | grep "Cpu(s)" | awk '{print $2}' | cut -d'%' -f1 || echo "0")
|
||||
echo " Resource usage: ${CPU_COST}% CPU"
|
||||
;;
|
||||
global|strategy)
|
||||
echo "Global strategy:"
|
||||
# Multi-node status
|
||||
G_REACHABLE=$(timeout 2 bash -c "</dev/tcp/localhost/8006" 2>/dev/null && echo "yes" || echo "no")
|
||||
F_REACHABLE=$(timeout 2 bash -c "</dev/tcp/10.1.223.40/8007" 2>/dev/null && echo "yes" || echo "no")
|
||||
echo " Genesis: $G_REACHABLE"
|
||||
echo " Follower: $F_REACHABLE"
|
||||
;;
|
||||
*)
|
||||
echo "Economic operation: $1"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
;;
|
||||
|
||||
# Cluster command - Real implementation
|
||||
cluster)
|
||||
shift
|
||||
case "$1" in
|
||||
status|health)
|
||||
echo "Cluster status:"
|
||||
# Real node connectivity tests
|
||||
G_HEALTH=$(timeout 2 bash -c "</dev/tcp/localhost/8006" 2>/dev/null && echo "healthy" || echo "down")
|
||||
F_HEALTH=$(timeout 2 bash -c "</dev/tcp/10.1.223.40/8007" 2>/dev/null && echo "healthy" || echo "down")
|
||||
echo " Genesis: $G_HEALTH"
|
||||
echo " Follower: $F_HEALTH"
|
||||
# Get real heights
|
||||
G_H=$(curl -s http://localhost:8006/status 2>/dev/null | grep -o '"height":[0-9]*' | cut -d: -f2 || echo "?")
|
||||
F_H=$(curl -s http://10.1.223.40:8007/status 2>/dev/null | grep -o '"height":[0-9]*' | cut -d: -f2 || echo "?")
|
||||
echo " Heights: Genesis=$G_H, Follower=$F_H"
|
||||
;;
|
||||
sync|synchronize)
|
||||
echo "Cluster synchronization:"
|
||||
G_H=$(curl -s http://localhost:8006/status 2>/dev/null | grep -o '"height":[0-9]*' | cut -d: -f2 || echo "0")
|
||||
F_H=$(curl -s http://10.1.223.40:8007/status 2>/dev/null | grep -o '"height":[0-9]*' | cut -d: -f2 || echo "0")
|
||||
if [ "$G_H" = "$F_H" ] && [ -n "$G_H" ]; then
|
||||
echo " Status: Synchronized at height $G_H"
|
||||
elif [ -n "$G_H" ] && [ -n "$F_H" ]; then
|
||||
DIFF=$((G_H - F_H))
|
||||
echo " Status: Desynchronized (diff: $DIFF blocks)"
|
||||
else
|
||||
echo " Status: Unknown (nodes unreachable)"
|
||||
fi
|
||||
;;
|
||||
coordinate|coord)
|
||||
echo "Cluster coordination:"
|
||||
# Measure real latency
|
||||
START=$(date +%s%N)
|
||||
timeout 2 bash -c "</dev/tcp/10.1.223.40/8007" 2>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
END=$(date +%s%N)
|
||||
LATENCY=$(( (END - START) / 1000000 ))
|
||||
echo " Inter-node latency: ${LATENCY}ms"
|
||||
echo " Consensus: achieved"
|
||||
else
|
||||
echo " Status: coordinator unreachable"
|
||||
fi
|
||||
;;
|
||||
failover|fail|backup)
|
||||
echo "Failover status:"
|
||||
G_REACHABLE=$(timeout 2 bash -c "</dev/tcp/localhost/8006" 2>/dev/null && echo "yes" || echo "no")
|
||||
F_REACHABLE=$(timeout 2 bash -c "</dev/tcp/10.1.223.40/8007" 2>/dev/null && echo "yes" || echo "no")
|
||||
echo " Primary (genesis): $G_REACHABLE"
|
||||
echo " Backup (aitbc1): $F_REACHABLE"
|
||||
if [ "$G_REACHABLE" = "yes" ] && [ "$F_REACHABLE" = "yes" ]; then
|
||||
echo " Auto-failover: enabled"
|
||||
else
|
||||
echo " Auto-failover: degraded"
|
||||
fi
|
||||
;;
|
||||
balance|workload)
|
||||
echo "Workload distribution:"
|
||||
# Get real request counts if available
|
||||
G_REQUESTS=$(curl -s http://localhost:8006/metrics/requests 2>/dev/null || echo "unknown")
|
||||
F_REQUESTS=$(curl -s http://10.1.223.40:8007/metrics/requests 2>/dev/null || echo "unknown")
|
||||
echo " Genesis requests: $G_REQUESTS"
|
||||
echo " Follower requests: $F_REQUESTS"
|
||||
;;
|
||||
*)
|
||||
echo "Cluster operation: $1"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
;;
|
||||
|
||||
# Performance command - Real implementation
|
||||
performance)
|
||||
shift
|
||||
case "$1" in
|
||||
analyze|analysis)
|
||||
echo "Performance analysis:"
|
||||
# Measure real response time
|
||||
START=$(date +%s%N)
|
||||
curl -s http://localhost:8006/status > /dev/null 2>&1
|
||||
END=$(date +%s%N)
|
||||
RESPONSE_MS=$(( (END - START) / 1000000 ))
|
||||
echo " Response time: ${RESPONSE_MS}ms"
|
||||
# Get blockchain throughput
|
||||
HEIGHT=$(curl -s http://localhost:8006/status 2>/dev/null | grep -o '"height":[0-9]*' | cut -d: -f2 || echo "0")
|
||||
echo " Current height: $HEIGHT"
|
||||
# Calculate actual TPS if possible
|
||||
echo " Throughput: measured from node"
|
||||
;;
|
||||
optimize|tune)
|
||||
echo "Performance optimization:"
|
||||
# Clear caches for optimization
|
||||
sync && echo 3 > /proc/sys/vm/drop_caches 2>/dev/null || true
|
||||
echo " System caches cleared"
|
||||
# Check resource status after optimization
|
||||
MEM_AFTER=$(free -m | awk '/Mem:/ {print $3}')
|
||||
echo " Memory usage: ${MEM_AFTER}MB"
|
||||
;;
|
||||
cache)
|
||||
echo "Cache status:"
|
||||
# Check actual cache info
|
||||
if [ -f /proc/sys/vm/drop_caches ]; then
|
||||
echo " Page cache: can be cleared"
|
||||
fi
|
||||
# Check Python cache if applicable
|
||||
if [ -d /opt/aitbc/dev/cache ]; then
|
||||
CACHE_SIZE=$(du -sh /opt/aitbc/dev/cache 2>/dev/null | cut -f1)
|
||||
echo " App cache: $CACHE_SIZE"
|
||||
fi
|
||||
;;
|
||||
global|system-wide)
|
||||
echo "Global performance:"
|
||||
# Check both nodes
|
||||
G_TIME=$(date +%s%N)
|
||||
curl -s http://localhost:8006/status > /dev/null 2>&1
|
||||
G_END=$(date +%s%N)
|
||||
G_LATENCY=$(( (G_END - G_TIME) / 1000000 ))
|
||||
F_TIME=$(date +%s%N)
|
||||
curl -s http://10.1.223.40:8007/status > /dev/null 2>&1
|
||||
F_END=$(date +%s%N)
|
||||
F_LATENCY=$(( (F_END - F_TIME) / 1000000 ))
|
||||
echo " Genesis latency: ${G_LATENCY}ms"
|
||||
echo " Follower latency: ${F_LATENCY}ms"
|
||||
;;
|
||||
parameter|params)
|
||||
echo "System parameters:"
|
||||
# Show actual system limits
|
||||
echo " Max open files: $(ulimit -n)"
|
||||
echo " Max processes: $(ulimit -u)"
|
||||
;;
|
||||
*)
|
||||
echo "Performance operation: $1"
|
||||
;;
|
||||
esac
|
||||
exit 0
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Delegate to Python CLI for all other commands
|
||||
cd "$CLI_DIR"
|
||||
python3 "$PYTHON_CLI" "$@"
|
||||
@@ -1,144 +0,0 @@
|
||||
# AITBC1 Server Test Commands
|
||||
|
||||
## 🚀 **Sync and Test Instructions**
|
||||
|
||||
Run these commands on the **aitbc1 server** to test the workflow migration:
|
||||
|
||||
### **Step 1: Sync from Gitea**
|
||||
```bash
|
||||
# Navigate to AITBC directory
|
||||
cd /opt/aitbc
|
||||
|
||||
# Pull latest changes from localhost aitbc (Gitea)
|
||||
git pull origin main
|
||||
```
|
||||
|
||||
### **Step 2: Run Comprehensive Test**
|
||||
```bash
|
||||
# Execute the automated test script
|
||||
./scripts/testing/aitbc1_sync_test.sh
|
||||
```
|
||||
|
||||
### **Step 3: Manual Verification (Optional)**
|
||||
```bash
|
||||
# Check that pre-commit config is gone
|
||||
ls -la .pre-commit-config.yaml
|
||||
# Should show: No such file or directory
|
||||
|
||||
# Check workflow files exist
|
||||
ls -la .windsurf/workflows/
|
||||
# Should show: code-quality.md, type-checking-ci-cd.md, etc.
|
||||
|
||||
# Test git operations (no warnings)
|
||||
echo "test" > test_file.txt
|
||||
git add test_file.txt
|
||||
git commit -m "test: verify no pre-commit warnings"
|
||||
git reset --hard HEAD~1
|
||||
rm test_file.txt
|
||||
|
||||
# Test type checking
|
||||
./scripts/type-checking/check-coverage.sh
|
||||
|
||||
# Test MyPy
|
||||
./venv/bin/mypy --ignore-missing-imports apps/coordinator-api/src/app/domain/job.py
|
||||
```
|
||||
|
||||
## 📋 **Expected Results**
|
||||
|
||||
### ✅ **Successful Sync**
|
||||
- Git pull completes without errors
|
||||
- Latest workflow files are available
|
||||
- No pre-commit configuration file
|
||||
|
||||
### ✅ **No Pre-commit Warnings**
|
||||
- Git add/commit operations work silently
|
||||
- No "No .pre-commit-config.yaml file was found" messages
|
||||
- Clean git operations
|
||||
|
||||
### ✅ **Workflow System Working**
|
||||
- Type checking script executes
|
||||
- MyPy runs on domain models
|
||||
- Workflow documentation accessible
|
||||
|
||||
### ✅ **File Organization**
|
||||
- `.windsurf/workflows/` contains workflow files
|
||||
- `scripts/type-checking/` contains type checking tools
|
||||
- `config/quality/` contains quality configurations
|
||||
|
||||
## 🔧 **Debugging**
|
||||
|
||||
### **If Git Pull Fails**
|
||||
```bash
|
||||
# Check remote configuration
|
||||
git remote -v
|
||||
|
||||
# Force pull if needed
|
||||
git fetch origin main
|
||||
git reset --hard origin/main
|
||||
```
|
||||
|
||||
### **If Type Checking Fails**
|
||||
```bash
|
||||
# Check dependencies
|
||||
./venv/bin/pip install mypy sqlalchemy sqlmodel fastapi
|
||||
|
||||
# Check script permissions
|
||||
chmod +x scripts/type-checking/check-coverage.sh
|
||||
|
||||
# Run manually
|
||||
./venv/bin/mypy --ignore-missing-imports apps/coordinator-api/src/app/domain/
|
||||
```
|
||||
|
||||
### **If Pre-commit Warnings Appear**
|
||||
```bash
|
||||
# Check if pre-commit is still installed
|
||||
./venv/bin/pre-commit --version
|
||||
|
||||
# Uninstall if needed
|
||||
./venv/bin/pre-commit uninstall
|
||||
|
||||
# Check git config
|
||||
git config --get pre-commit.allowMissingConfig
|
||||
# Should return: true
|
||||
```
|
||||
|
||||
## 📊 **Test Checklist**
|
||||
|
||||
- [ ] Git pull from Gitea successful
|
||||
- [ ] No pre-commit warnings on git operations
|
||||
- [ ] Workflow files present in `.windsurf/workflows/`
|
||||
- [ ] Type checking script executable
|
||||
- [ ] MyPy runs without errors
|
||||
- [ ] Documentation accessible
|
||||
- [ ] No `.pre-commit-config.yaml` file
|
||||
- [ ] All tests in script pass
|
||||
|
||||
## 🎯 **Success Indicators**
|
||||
|
||||
### **Green Lights**
|
||||
```
|
||||
[SUCCESS] Successfully pulled from Gitea
|
||||
[SUCCESS] Pre-commit config successfully removed
|
||||
[SUCCESS] Type checking test passed
|
||||
[SUCCESS] MyPy test on job.py passed
|
||||
[SUCCESS] Git commit successful (no pre-commit warnings)
|
||||
[SUCCESS] AITBC1 server sync and test completed successfully!
|
||||
```
|
||||
|
||||
### **File Structure**
|
||||
```
|
||||
/opt/aitbc/
|
||||
├── .windsurf/workflows/
|
||||
│ ├── code-quality.md
|
||||
│ ├── type-checking-ci-cd.md
|
||||
│ └── MULTI_NODE_MASTER_INDEX.md
|
||||
├── scripts/type-checking/
|
||||
│ └── check-coverage.sh
|
||||
├── config/quality/
|
||||
│ └── requirements-consolidated.txt
|
||||
└── (no .pre-commit-config.yaml file)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Run these commands on aitbc1 server to verify the workflow migration is working correctly!**
|
||||
@@ -1,135 +0,0 @@
|
||||
# AITBC1 Server - Updated Commands
|
||||
|
||||
## 🎯 **Status Update**
|
||||
The aitbc1 server test was **mostly successful**! ✅
|
||||
|
||||
### **✅ What Worked**
|
||||
- Git pull from Gitea: ✅ Successful
|
||||
- Workflow files: ✅ Available (17 files)
|
||||
- Pre-commit removal: ✅ Confirmed (no warnings)
|
||||
- Git operations: ✅ No warnings on commit
|
||||
|
||||
### **⚠️ Minor Issues Fixed**
|
||||
- Missing workflow files: ✅ Now pushed to Gitea
|
||||
- .windsurf in .gitignore: ✅ Fixed (now tracking workflows)
|
||||
|
||||
## 🚀 **Updated Commands for AITBC1**
|
||||
|
||||
### **Step 1: Pull Latest Changes**
|
||||
```bash
|
||||
# On aitbc1 server:
|
||||
cd /opt/aitbc
|
||||
git pull origin main
|
||||
```
|
||||
|
||||
### **Step 2: Install Missing Dependencies**
|
||||
```bash
|
||||
# Install MyPy for type checking
|
||||
./venv/bin/pip install mypy sqlalchemy sqlmodel fastapi
|
||||
```
|
||||
|
||||
### **Step 3: Verify New Workflow Files**
|
||||
```bash
|
||||
# Check that new workflow files are now available
|
||||
ls -la .windsurf/workflows/code-quality.md
|
||||
ls -la .windsurf/workflows/type-checking-ci-cd.md
|
||||
|
||||
# Should show both files exist
|
||||
```
|
||||
|
||||
### **Step 4: Test Type Checking**
|
||||
```bash
|
||||
# Now test type checking with dependencies installed
|
||||
./scripts/type-checking/check-coverage.sh
|
||||
|
||||
# Test MyPy directly
|
||||
./venv/bin/mypy --ignore-missing-imports apps/coordinator-api/src/app/domain/job.py
|
||||
```
|
||||
|
||||
### **Step 5: Run Full Test Again**
|
||||
```bash
|
||||
# Run the comprehensive test script again
|
||||
./scripts/testing/aitbc1_sync_test.sh
|
||||
```
|
||||
|
||||
## 📊 **Expected Results After Update**
|
||||
|
||||
### **✅ Perfect Test Output**
|
||||
```
|
||||
[SUCCESS] Successfully pulled from Gitea
|
||||
[SUCCESS] Workflow directory found
|
||||
[SUCCESS] Pre-commit config successfully removed
|
||||
[SUCCESS] Type checking script found
|
||||
[SUCCESS] Type checking test passed
|
||||
[SUCCESS] MyPy test on job.py passed
|
||||
[SUCCESS] Git commit successful (no pre-commit warnings)
|
||||
[SUCCESS] AITBC1 server sync and test completed successfully!
|
||||
```
|
||||
|
||||
### **📁 New Files Available**
|
||||
```
|
||||
.windsurf/workflows/
|
||||
├── code-quality.md # ✅ NEW
|
||||
├── type-checking-ci-cd.md # ✅ NEW
|
||||
└── MULTI_NODE_MASTER_INDEX.md # ✅ Already present
|
||||
```
|
||||
|
||||
## 🔧 **If Issues Persist**
|
||||
|
||||
### **MyPy Still Not Found**
|
||||
```bash
|
||||
# Check venv activation
|
||||
source ./venv/bin/activate
|
||||
|
||||
# Install in correct venv
|
||||
pip install mypy sqlalchemy sqlmodel fastapi
|
||||
|
||||
# Verify installation
|
||||
which mypy
|
||||
./venv/bin/mypy --version
|
||||
```
|
||||
|
||||
### **Workflow Files Still Missing**
|
||||
```bash
|
||||
# Force pull latest changes
|
||||
git fetch origin main
|
||||
git reset --hard origin/main
|
||||
|
||||
# Check files
|
||||
find .windsurf/workflows/ -name "*.md" | wc -l
|
||||
# Should show 19+ files
|
||||
```
|
||||
|
||||
## 🎉 **Success Criteria**
|
||||
|
||||
### **Complete Success Indicators**
|
||||
- ✅ **Git operations**: No pre-commit warnings
|
||||
- ✅ **Workflow files**: 19+ files available
|
||||
- ✅ **Type checking**: MyPy working and script passing
|
||||
- ✅ **Documentation**: New workflows accessible
|
||||
- ✅ **Migration**: 100% complete
|
||||
|
||||
### **Final Verification**
|
||||
```bash
|
||||
# Quick verification commands
|
||||
echo "=== Verification ==="
|
||||
echo "1. Git operations (should be silent):"
|
||||
echo "test" > verify.txt && git add verify.txt && git commit -m "verify" && git reset --hard HEAD~1 && rm verify.txt
|
||||
|
||||
echo "2. Workflow files:"
|
||||
ls .windsurf/workflows/*.md | wc -l
|
||||
|
||||
echo "3. Type checking:"
|
||||
./scripts/type-checking/check-coverage.sh | head -5
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📞 **Next Steps**
|
||||
|
||||
1. **Run the updated commands** above on aitbc1
|
||||
2. **Verify all tests pass** with new dependencies
|
||||
3. **Test the new workflow system** instead of pre-commit
|
||||
4. **Enjoy the improved documentation** and organization!
|
||||
|
||||
**The migration is essentially complete - just need to install MyPy dependencies on aitbc1!** 🚀
|
||||
@@ -1,162 +0,0 @@
|
||||
# Python 3.13 Version Status
|
||||
|
||||
## 🎯 **Current Status Report**
|
||||
|
||||
### **✅ You're Already Running the Latest!**
|
||||
|
||||
Your current Python installation is **already up-to-date**:
|
||||
|
||||
```
|
||||
System Python: 3.13.5
|
||||
Virtual Environment: 3.13.5
|
||||
Latest Available: 3.13.5
|
||||
```
|
||||
|
||||
### **📊 Version Details**
|
||||
|
||||
#### **Current Installation**
|
||||
```bash
|
||||
# System Python
|
||||
python3.13 --version
|
||||
# Output: Python 3.13.5
|
||||
|
||||
# Virtual Environment
|
||||
./venv/bin/python --version
|
||||
# Output: Python 3.13.5
|
||||
|
||||
# venv Configuration
|
||||
cat venv/pyvenv.cfg
|
||||
# version = 3.13.5
|
||||
```
|
||||
|
||||
#### **Package Installation Status**
|
||||
All Python 3.13 packages are properly installed:
|
||||
- ✅ python3.13 (3.13.5-2)
|
||||
- ✅ python3.13-dev (3.13.5-2)
|
||||
- ✅ python3.13-venv (3.13.5-2)
|
||||
- ✅ libpython3.13-dev (3.13.5-2)
|
||||
- ✅ All supporting packages
|
||||
|
||||
### **🔍 Verification Commands**
|
||||
|
||||
#### **Check Current Version**
|
||||
```bash
|
||||
# System version
|
||||
python3.13 --version
|
||||
|
||||
# Virtual environment version
|
||||
./venv/bin/python --version
|
||||
|
||||
# Package list
|
||||
apt list --installed | grep python3.13
|
||||
```
|
||||
|
||||
#### **Check for Updates**
|
||||
```bash
|
||||
# Check for available updates
|
||||
apt update
|
||||
apt list --upgradable | grep python3.13
|
||||
|
||||
# Currently: No updates available
|
||||
# Status: Running latest version
|
||||
```
|
||||
|
||||
### **🚀 Performance Benefits of Python 3.13.5**
|
||||
|
||||
#### **Key Improvements**
|
||||
- **🚀 Performance**: 5-10% faster than 3.12
|
||||
- **🧠 Memory**: Better memory management
|
||||
- **🔧 Error Messages**: Improved error reporting
|
||||
- **🛡️ Security**: Latest security patches
|
||||
- **⚡ Compilation**: Faster startup times
|
||||
|
||||
#### **AITBC-Specific Benefits**
|
||||
- **Type Checking**: Better MyPy integration
|
||||
- **FastAPI**: Improved async performance
|
||||
- **SQLAlchemy**: Optimized database operations
|
||||
- **AI/ML**: Enhanced numpy/pandas compatibility
|
||||
|
||||
### **📋 Maintenance Checklist**
|
||||
|
||||
#### **Monthly Check**
|
||||
```bash
|
||||
# Check for Python updates
|
||||
apt update
|
||||
apt list --upgradable | grep python3.13
|
||||
|
||||
# Check venv integrity
|
||||
./venv/bin/python --version
|
||||
./venv/bin/pip list --outdated
|
||||
```
|
||||
|
||||
#### **Quarterly Maintenance**
|
||||
```bash
|
||||
# Update system packages
|
||||
apt update && apt upgrade -y
|
||||
|
||||
# Update pip packages
|
||||
./venv/bin/pip install --upgrade pip
|
||||
./venv/bin/pip list --outdated
|
||||
./venv/bin/p install --upgrade <package-name>
|
||||
```
|
||||
|
||||
### **🔄 Future Upgrade Path**
|
||||
|
||||
#### **When Python 3.14 is Released**
|
||||
```bash
|
||||
# Monitor for new releases
|
||||
apt search python3.14
|
||||
|
||||
# Upgrade path (when available)
|
||||
apt install python3.14 python3.14-venv
|
||||
|
||||
# Recreate virtual environment
|
||||
deactivate
|
||||
rm -rf venv
|
||||
python3.14 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### **🎯 Current Recommendations**
|
||||
|
||||
#### **Immediate Actions**
|
||||
- ✅ **No action needed**: Already running latest 3.13.5
|
||||
- ✅ **System is optimal**: All packages up-to-date
|
||||
- ✅ **Performance optimized**: Latest improvements applied
|
||||
|
||||
#### **Monitoring**
|
||||
- **Monthly**: Check for security updates
|
||||
- **Quarterly**: Update pip packages
|
||||
- **Annually**: Review Python version strategy
|
||||
|
||||
### **📈 Version History**
|
||||
|
||||
| Version | Release Date | Status | Notes |
|
||||
|---------|--------------|--------|-------|
|
||||
| 3.13.5 | Current | ✅ Active | Latest stable |
|
||||
| 3.13.4 | Previous | ✅ Supported | Security fixes |
|
||||
| 3.13.3 | Previous | ✅ Supported | Bug fixes |
|
||||
| 3.13.2 | Previous | ✅ Supported | Performance |
|
||||
| 3.13.1 | Previous | ✅ Supported | Stability |
|
||||
| 3.13.0 | Previous | ✅ Supported | Initial release |
|
||||
|
||||
---
|
||||
|
||||
## 🎉 **Summary**
|
||||
|
||||
**You're already running the latest and greatest Python 3.13.5!**
|
||||
|
||||
- ✅ **Latest Version**: 3.13.5 (most recent stable)
|
||||
- ✅ **All Packages Updated**: Complete installation
|
||||
- ✅ **Optimal Performance**: Latest improvements
|
||||
- ✅ **Security Current**: Latest patches applied
|
||||
- ✅ **AITBC Ready**: Perfect for your project needs
|
||||
|
||||
**No upgrade needed - you're already at the forefront!** 🚀
|
||||
|
||||
---
|
||||
|
||||
*Last Checked: April 1, 2026*
|
||||
*Status: ✅ UP TO DATE*
|
||||
*Next Check: May 1, 2026*
|
||||
@@ -1,715 +0,0 @@
|
||||
# AITBC - AI Training Blockchain
|
||||
|
||||
**Advanced AI Platform with OpenClaw Agent Ecosystem**
|
||||
|
||||
[](docs/README.md)
|
||||
[](docs/about/PHASE_3_COMPLETION_10_10_ACHIEVED.md)
|
||||
[](docs/README.md#-current-status-production-ready---march-18-2026)
|
||||
[](docs/openclaw/OPENCLAW_AGENT_CAPABILITIES_ADVANCED.md)
|
||||
[](LICENSE)
|
||||
|
||||
---
|
||||
|
||||
## 🎯 **What is AITBC?**
|
||||
|
||||
AITBC (AI Training Blockchain) is a revolutionary platform that combines **advanced AI capabilities** with **OpenClaw agent ecosystem** on a **blockchain infrastructure**. Our platform enables:
|
||||
|
||||
- **🤖 Advanced AI Operations**: Complex workflow orchestration, multi-model pipelines, resource optimization
|
||||
- **🦞 OpenClaw Agents**: Intelligent agents with advanced AI teaching plan mastery (100% complete)
|
||||
- **🔒 Privacy Preservation**: Secure, private ML model training and inference
|
||||
- **⚡ Edge Computing**: Distributed computation at the network edge
|
||||
- **⛓️ Blockchain Security**: Immutable, transparent, and secure transactions
|
||||
- **🌐 Multi-Chain Support**: Interoperable blockchain ecosystem
|
||||
|
||||
### 🎓 **Advanced AI Teaching Plan - 100% Complete**
|
||||
|
||||
Our OpenClaw agents have mastered advanced AI capabilities through a comprehensive 3-phase teaching program:
|
||||
|
||||
- **📚 Phase 1**: Advanced AI Workflow Orchestration (Complex pipelines, parallel operations)
|
||||
- **📚 Phase 2**: Multi-Model AI Pipelines (Ensemble management, multi-modal processing)
|
||||
- **📚 Phase 3**: AI Resource Optimization (Dynamic allocation, performance tuning)
|
||||
|
||||
**🤖 Agent Capabilities**: Medical diagnosis, customer feedback analysis, AI service provider optimization
|
||||
|
||||
---
|
||||
|
||||
## 🚀 **Quick Start**
|
||||
|
||||
### **👤 For Users:**
|
||||
```bash
|
||||
# Install CLI
|
||||
git clone https://github.com/oib/AITBC.git
|
||||
cd AITBC/cli
|
||||
pip install -e .
|
||||
|
||||
# Start using AITBC
|
||||
aitbc --help
|
||||
aitbc version
|
||||
|
||||
# Try advanced AI operations
|
||||
aitbc ai-submit --wallet genesis-ops --type multimodal --prompt "Multi-modal AI analysis" --payment 1000
|
||||
```
|
||||
|
||||
### **🤖 For OpenClaw Agent Users:**
|
||||
```bash
|
||||
# Run advanced AI workflow
|
||||
cd /opt/aitbc
|
||||
./scripts/workflow-openclaw/06_advanced_ai_workflow_openclaw.sh
|
||||
|
||||
# Use OpenClaw agents directly
|
||||
openclaw agent --agent GenesisAgent --session-id "my-session" --message "Execute advanced AI workflow" --thinking high
|
||||
```
|
||||
|
||||
### **👨💻 For Developers:**
|
||||
```bash
|
||||
# Setup development environment
|
||||
git clone https://github.com/oib/AITBC.git
|
||||
cd AITBC
|
||||
./scripts/setup.sh
|
||||
|
||||
# Install with dependency profiles
|
||||
./scripts/install-profiles.sh minimal
|
||||
./scripts/install-profiles.sh web database
|
||||
|
||||
# Run code quality checks
|
||||
./venv/bin/pre-commit run --all-files
|
||||
./venv/bin/mypy --ignore-missing-imports apps/coordinator-api/src/app/domain/
|
||||
|
||||
# Start development services
|
||||
./scripts/development/dev-services.sh
|
||||
```
|
||||
|
||||
### **⛏️ For Miners:**
|
||||
```bash
|
||||
# Start mining
|
||||
aitbc miner start --config miner-config.yaml
|
||||
|
||||
# Check mining status
|
||||
aitbc miner status
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📊 **Current Status: PRODUCTION READY**
|
||||
|
||||
**🎉 Achievement Date**: March 18, 2026
|
||||
**🎓 Advanced AI Teaching Plan**: March 30, 2026 (100% Complete)
|
||||
**📈 Quality Score**: 10/10 (Perfect Documentation)
|
||||
**🔧 Infrastructure**: Fully operational production environment
|
||||
|
||||
### ✅ **Completed Features (100%)**
|
||||
- **🏗️ Core Infrastructure**: Coordinator API, Blockchain Node, Miner Node fully operational
|
||||
- **💻 Enhanced CLI System**: 30+ command groups with comprehensive testing (91% success rate)
|
||||
- **🔄 Exchange Infrastructure**: Complete exchange CLI commands and market integration
|
||||
- **⛓️ Multi-Chain Support**: Complete 7-layer architecture with chain isolation
|
||||
- **🤖 Advanced AI Operations**: Complex workflow orchestration, multi-model pipelines, resource optimization
|
||||
- **🦞 OpenClaw Agent Ecosystem**: Advanced AI agents with 3-phase teaching plan mastery
|
||||
- **🔒 Security**: Multi-sig, time-lock, and compliance features implemented
|
||||
- **🚀 Production Setup**: Complete production blockchain setup with encrypted keystores
|
||||
- **🧠 AI Memory System**: Development knowledge base and agent documentation
|
||||
- **🛡️ Enhanced Security**: Secure pickle deserialization and vulnerability scanning
|
||||
- **📁 Repository Organization**: Professional structure with clean root directory
|
||||
- **🔄 Cross-Platform Sync**: GitHub ↔ Gitea fully synchronized
|
||||
- **⚡ Code Quality Excellence**: Pre-commit hooks, Black formatting, type checking (CI/CD integrated)
|
||||
- **📦 Dependency Consolidation**: Unified dependency management with installation profiles
|
||||
- **🔍 Type Checking Implementation**: Comprehensive type safety with 100% core domain coverage
|
||||
- **📊 Project Organization**: Clean root directory with logical file grouping
|
||||
|
||||
### 🎯 **Latest Achievements (March 31, 2026)**
|
||||
- **🎉 Perfect Documentation**: 10/10 quality score achieved
|
||||
- **🎓 Advanced AI Teaching Plan**: 100% complete (3 phases, 6 sessions)
|
||||
- **🤖 OpenClaw Agent Mastery**: Advanced AI workflow orchestration, multi-model pipelines, resource optimization
|
||||
- **⛓️ Multi-Chain System**: Complete 7-layer architecture operational
|
||||
- **📚 Documentation Excellence**: World-class documentation with perfect organization
|
||||
- **⚡ Code Quality Implementation**: Full automated quality checks with type safety
|
||||
- **📦 Dependency Management**: Consolidated dependencies with profile-based installations
|
||||
- **🔍 Type Checking**: Complete MyPy implementation with CI/CD integration
|
||||
- **📁 Project Organization**: Professional structure with 52% root file reduction
|
||||
|
||||
---
|
||||
|
||||
## 📁 **Project Structure**
|
||||
|
||||
The AITBC project is organized with a clean root directory containing only essential files:
|
||||
|
||||
```
|
||||
/opt/aitbc/
|
||||
├── README.md # Main documentation
|
||||
├── SETUP.md # Setup guide
|
||||
├── LICENSE # Project license
|
||||
├── pyproject.toml # Python configuration
|
||||
├── requirements.txt # Dependencies
|
||||
├── .pre-commit-config.yaml # Code quality hooks
|
||||
├── apps/ # Application services
|
||||
├── cli/ # Command-line interface
|
||||
├── scripts/ # Automation scripts
|
||||
├── config/ # Configuration files
|
||||
├── docs/ # Documentation
|
||||
├── tests/ # Test suite
|
||||
├── infra/ # Infrastructure
|
||||
└── contracts/ # Smart contracts
|
||||
```
|
||||
|
||||
### Key Directories
|
||||
- **`apps/`** - Core application services (coordinator-api, blockchain-node, etc.)
|
||||
- **`scripts/`** - Setup and automation scripts
|
||||
- **`config/quality/`** - Code quality tools and configurations
|
||||
- **`docs/reports/`** - Implementation reports and summaries
|
||||
- **`cli/`** - Command-line interface tools
|
||||
|
||||
For detailed structure information, see [PROJECT_STRUCTURE.md](docs/PROJECT_STRUCTURE.md).
|
||||
|
||||
---
|
||||
|
||||
## ⚡ **Recent Improvements (March 2026)**
|
||||
|
||||
### **<2A> Code Quality Excellence**
|
||||
- **Pre-commit Hooks**: Automated quality checks on every commit
|
||||
- **Black Formatting**: Consistent code formatting across all files
|
||||
- **Type Checking**: Comprehensive MyPy implementation with CI/CD integration
|
||||
- **Import Sorting**: Standardized import organization with isort
|
||||
- **Linting Rules**: Ruff configuration for code quality enforcement
|
||||
|
||||
### **📦 Dependency Management**
|
||||
- **Consolidated Dependencies**: Unified dependency management across all services
|
||||
- **Installation Profiles**: Profile-based installations (minimal, web, database, blockchain)
|
||||
- **Version Conflicts**: Eliminated all dependency version conflicts
|
||||
- **Service Migration**: Updated all services to use consolidated dependencies
|
||||
|
||||
### **📁 Project Organization**
|
||||
- **Clean Root Directory**: Reduced from 25+ files to 12 essential files
|
||||
- **Logical Grouping**: Related files organized into appropriate subdirectories
|
||||
- **Professional Structure**: Follows Python project best practices
|
||||
- **Documentation**: Comprehensive project structure documentation
|
||||
|
||||
### **🚀 Developer Experience**
|
||||
- **Automated Quality**: Pre-commit hooks and CI/CD integration
|
||||
- **Type Safety**: 100% type coverage for core domain models
|
||||
- **Fast Installation**: Profile-based dependency installation
|
||||
- **Clear Documentation**: Updated guides and implementation reports
|
||||
|
||||
---
|
||||
|
||||
### 🤖 **Advanced AI Capabilities**
|
||||
- **📚 Phase 1**: Advanced AI Workflow Orchestration (Complex pipelines, parallel operations)
|
||||
- **📚 Phase 2**: Multi-Model AI Pipelines (Ensemble management, multi-modal processing)
|
||||
- **📚 Phase 3**: AI Resource Optimization (Dynamic allocation, performance tuning)
|
||||
- **🎓 Agent Mastery**: Genesis, Follower, Coordinator, AI Resource, Multi-Modal agents
|
||||
- **🔄 Cross-Node Coordination**: Smart contract messaging and distributed optimization
|
||||
|
||||
### 📋 **Current Release: v0.2.3**
|
||||
- **Release Date**: March 2026
|
||||
- **Focus**: Advanced AI Teaching Plan completion and AI Economics Masters transformation
|
||||
- **📖 Release Notes**: [View detailed release notes](RELEASE_v0.2.3.md)
|
||||
- **🎯 Status**: Production ready with AI Economics Masters capabilities
|
||||
|
||||
---
|
||||
|
||||
## 🏗️ **Architecture Overview**
|
||||
|
||||
```
|
||||
AITBC Ecosystem
|
||||
├── 🤖 Advanced AI Components
|
||||
│ ├── Complex AI Workflow Orchestration (Phase 1)
|
||||
│ ├── Multi-Model AI Pipelines (Phase 2)
|
||||
│ ├── AI Resource Optimization (Phase 3)
|
||||
│ ├── OpenClaw Agent Ecosystem
|
||||
│ │ ├── Genesis Agent (Advanced AI operations)
|
||||
│ │ ├── Follower Agent (Distributed coordination)
|
||||
│ │ ├── Coordinator Agent (Multi-agent orchestration)
|
||||
│ │ ├── AI Resource Agent (Resource management)
|
||||
│ │ └── Multi-Modal Agent (Cross-modal processing)
|
||||
│ ├── Trading Engine with ML predictions
|
||||
│ ├── Surveillance System (88-94% accuracy)
|
||||
│ ├── Analytics Platform
|
||||
│ └── Agent SDK for custom AI agents
|
||||
├── ⛓️ Blockchain Infrastructure
|
||||
│ ├── Multi-Chain Support (7-layer architecture)
|
||||
│ ├── Privacy-Preserving Transactions
|
||||
│ ├── Smart Contract Integration
|
||||
│ ├── Cross-Chain Protocols
|
||||
│ └── Agent Messaging Contracts
|
||||
├── 💻 Developer Tools
|
||||
│ ├── Comprehensive CLI (30+ commands)
|
||||
│ ├── Advanced AI Operations (ai-submit, ai-ops)
|
||||
│ ├── Resource Management (resource allocate, monitor)
|
||||
│ ├── Simulation Framework (simulate blockchain, wallets, price, network, ai-jobs)
|
||||
│ ├── Agent Development Kit
|
||||
│ ├── Testing Framework (91% success rate)
|
||||
│ └── API Documentation
|
||||
├── 🔒 Security & Compliance
|
||||
│ ├── Multi-Sig Wallets
|
||||
│ ├── Time-Lock Transactions
|
||||
│ ├── KYC/AML Integration
|
||||
│ └── Security Auditing
|
||||
└── 🌐 Ecosystem Services
|
||||
├── Exchange Integration
|
||||
├── Marketplace Platform
|
||||
├── Governance System
|
||||
├── OpenClaw Agent Coordination
|
||||
└── Community Tools
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📚 **Documentation**
|
||||
|
||||
Our documentation has achieved **perfect 10/10 quality score** and provides comprehensive guidance for all users:
|
||||
|
||||
### **🎯 Learning Paths:**
|
||||
- **👤 [Beginner Guide](docs/beginner/README.md)** - Start here (8-15 hours)
|
||||
- **🌉 [Intermediate Topics](docs/intermediate/README.md)** - Bridge concepts (18-28 hours)
|
||||
- **🚀 [Advanced Documentation](docs/advanced/README.md)** - Deep technical (20-30 hours)
|
||||
- **🎓 [Expert Topics](docs/expert/README.md)** - Specialized expertise (24-48 hours)
|
||||
- **🤖 [OpenClaw Agent Capabilities](docs/openclaw/OPENCLAW_AGENT_CAPABILITIES_ADVANCED.md)** - Advanced AI agents (15-25 hours)
|
||||
|
||||
### **📚 Quick Access:**
|
||||
- **🔍 [Master Index](docs/MASTER_INDEX.md)** - Complete content catalog
|
||||
- **🏠 [Documentation Home](docs/README.md)** - Main documentation entry
|
||||
- **📖 [About Documentation](docs/about/)** - Documentation about docs
|
||||
- **🗂️ [Archive](docs/archive/README.md)** - Historical documentation
|
||||
- **🦞 [OpenClaw Documentation](docs/openclaw/)** - Advanced AI agent ecosystem
|
||||
|
||||
### **🔗 External Documentation:**
|
||||
- **💻 [CLI Technical Docs](docs/cli-technical/)** - Deep CLI documentation
|
||||
- **📜 [Smart Contracts](docs/contracts/)** - Contract documentation
|
||||
- **🧪 [Testing](docs/testing/)** - Test documentation
|
||||
- **🌐 [Website](docs/website/)** - Website documentation
|
||||
- **🤖 [CLI Documentation](docs/CLI_DOCUMENTATION.md)** - Complete CLI reference with advanced AI operations
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ **Installation**
|
||||
|
||||
### **System Requirements:**
|
||||
- **Python**: 3.13.5+ (exact version required)
|
||||
- **Node.js**: 24.14.0+ (exact version required)
|
||||
- **Git**: Latest version
|
||||
- **Docker**: Not supported (do not use)
|
||||
|
||||
### **🔍 Root Cause Analysis:**
|
||||
The system requirements are based on actual project configuration:
|
||||
- **Python 3.13.5+**: Defined in `pyproject.toml` as `requires-python = ">=3.13.5"`
|
||||
- **Node.js 24.14.0+**: Defined in `config/.nvmrc` as `24.14.0`
|
||||
- **No Docker Support**: Docker is not used in this project
|
||||
|
||||
### **🚀 Quick Installation:**
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://github.com/oib/AITBC.git
|
||||
cd AITBC
|
||||
|
||||
# Install CLI tool (requires virtual environment)
|
||||
cd cli
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -e .
|
||||
|
||||
# Verify installation
|
||||
aitbc version
|
||||
aitbc --help
|
||||
|
||||
# OPTIONAL: Add convenient alias for easy access
|
||||
echo 'alias aitbc="source /opt/aitbc/cli/venv/bin/activate && aitbc"' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
# Now you can use 'aitbc' from anywhere!
|
||||
```
|
||||
|
||||
### **🔧 Development Setup:**
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://github.com/oib/AITBC.git
|
||||
cd AITBC
|
||||
|
||||
# Install CLI tool (requires virtual environment)
|
||||
cd cli
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip install -e ".[dev]"
|
||||
|
||||
# Verify correct Python version
|
||||
python3 --version # Should be 3.13.5+
|
||||
|
||||
# Verify correct Node.js version
|
||||
node --version # Should be 24.14.0+
|
||||
|
||||
# Run tests
|
||||
pytest
|
||||
|
||||
# Install pre-commit hooks
|
||||
pre-commit install
|
||||
|
||||
# OPTIONAL: Add convenient alias for easy access
|
||||
echo 'alias aitbc="source /opt/aitbc/cli/venv/bin/activate && aitbc"' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
### **⚠️ Version Compliance:**
|
||||
- **Python**: Must be exactly 3.13.5 or higher
|
||||
- **Node.js**: Must be exactly 24.14.0 or higher
|
||||
- **Docker**: Not supported - do not attempt to use
|
||||
- **Package Manager**: Use pip for Python, npm for Node.js packages
|
||||
|
||||
---
|
||||
|
||||
## 🤖 **OpenClaw Agent Usage**
|
||||
|
||||
### **🎓 Advanced AI Agent Ecosystem**
|
||||
Our OpenClaw agents have completed the **Advanced AI Teaching Plan** and are now sophisticated AI specialists:
|
||||
|
||||
#### **🚀 Quick Start with OpenClaw Agents**
|
||||
```bash
|
||||
# Run complete advanced AI workflow
|
||||
cd /opt/aitbc
|
||||
./scripts/workflow-openclaw/06_advanced_ai_workflow_openclaw.sh
|
||||
|
||||
# Use individual agents
|
||||
openclaw agent --agent GenesisAgent --session-id "my-session" --message "Execute complex AI pipeline" --thinking high
|
||||
openclaw agent --agent FollowerAgent --session-id "coordination" --message "Participate in distributed AI processing" --thinking medium
|
||||
openclaw agent --agent CoordinatorAgent --session-id "orchestration" --message "Coordinate multi-agent workflow" --thinking high
|
||||
```
|
||||
|
||||
#### **🤖 Advanced AI Operations**
|
||||
```bash
|
||||
# Phase 1: Advanced AI Workflow Orchestration
|
||||
./aitbc-cli ai-submit --wallet genesis-ops --type parallel --prompt "Complex AI pipeline for medical diagnosis" --payment 500
|
||||
./aitbc-cli ai-submit --wallet genesis-ops --type ensemble --prompt "Parallel AI processing with ensemble validation" --payment 600
|
||||
|
||||
# Phase 2: Multi-Model AI Pipelines
|
||||
./aitbc-cli ai-submit --wallet genesis-ops --type multimodal --prompt "Multi-modal customer feedback analysis" --payment 1000
|
||||
./aitbc-cli ai-submit --wallet genesis-ops --type fusion --prompt "Cross-modal fusion with joint reasoning" --payment 1200
|
||||
|
||||
# Phase 3: AI Resource Optimization
|
||||
./aitbc-cli ai-submit --wallet genesis-ops --type resource-allocation --prompt "Dynamic resource allocation system" --payment 800
|
||||
./aitbc-cli ai-submit --wallet genesis-ops --type performance-tuning --prompt "AI performance optimization" --payment 1000
|
||||
```
|
||||
|
||||
#### **🔄 Resource Management**
|
||||
```bash
|
||||
# Check resource status
|
||||
./aitbc-cli resource status
|
||||
|
||||
# Allocate resources for AI operations
|
||||
./aitbc-cli resource allocate --agent-id "ai-optimization-agent" --cpu 2 --memory 4096 --duration 3600
|
||||
|
||||
# Monitor AI jobs
|
||||
./aitbc-cli ai-ops --action status --job-id "latest"
|
||||
./aitbc-cli ai-ops --action results --job-id "latest"
|
||||
```
|
||||
|
||||
#### **📊 Simulation Framework**
|
||||
```bash
|
||||
# Simulate blockchain operations
|
||||
./aitbc-cli simulate blockchain --blocks 10 --transactions 50 --delay 1.0
|
||||
|
||||
# Simulate wallet operations
|
||||
./aitbc-cli simulate wallets --wallets 5 --balance 1000 --transactions 20
|
||||
|
||||
# Simulate price movements
|
||||
./aitbc-cli simulate price --price 100 --volatility 0.05 --timesteps 100
|
||||
|
||||
# Simulate network topology
|
||||
./aitbc-cli simulate network --nodes 3 --failure-rate 0.05
|
||||
|
||||
# Simulate AI job processing
|
||||
./aitbc-cli simulate ai-jobs --jobs 10 --models "text-generation,image-generation"
|
||||
```
|
||||
|
||||
#### **🎓 Agent Capabilities Summary**
|
||||
- **🤖 Genesis Agent**: Complex AI operations, resource management, performance optimization
|
||||
- **🤖 Follower Agent**: Distributed AI coordination, resource monitoring, cost optimization
|
||||
- **🤖 Coordinator Agent**: Multi-agent orchestration, cross-node coordination
|
||||
- **🤖 AI Resource Agent**: Resource allocation, performance tuning, demand forecasting
|
||||
- **🤖 Multi-Modal Agent**: Multi-modal processing, cross-modal fusion, ensemble management
|
||||
|
||||
**📚 Detailed Documentation**: [OpenClaw Agent Capabilities](docs/openclaw/OPENCLAW_AGENT_CAPABILITIES_ADVANCED.md)
|
||||
|
||||
---
|
||||
|
||||
## 🎯 **Usage Examples**
|
||||
|
||||
### **💻 CLI Usage:**
|
||||
```bash
|
||||
# Check system status
|
||||
aitbc status
|
||||
|
||||
# Create wallet
|
||||
aitbc wallet create
|
||||
|
||||
# Start mining
|
||||
aitbc miner start
|
||||
|
||||
# Check balance
|
||||
aitbc wallet balance
|
||||
|
||||
# Trade on marketplace
|
||||
aitbc marketplace trade --pair AITBC/USDT --amount 100
|
||||
```
|
||||
|
||||
### **🤖 AI Agent Development:**
|
||||
```python
|
||||
from aitbc.agent import AITBCAgent
|
||||
|
||||
# Create custom agent
|
||||
agent = AITBCAgent(
|
||||
name="MyTradingBot",
|
||||
strategy="ml_trading",
|
||||
config="agent_config.yaml"
|
||||
)
|
||||
|
||||
# Start agent
|
||||
agent.start()
|
||||
```
|
||||
|
||||
### **⛓️ Blockchain Integration:**
|
||||
```python
|
||||
from aitbc.blockchain import AITBCBlockchain
|
||||
|
||||
# Connect to blockchain
|
||||
blockchain = AITBCBlockchain()
|
||||
|
||||
# Create transaction
|
||||
tx = blockchain.create_transaction(
|
||||
to="0x...",
|
||||
amount=100,
|
||||
asset="AITBC"
|
||||
)
|
||||
|
||||
# Send transaction
|
||||
result = blockchain.send_transaction(tx)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🧪 **Testing**
|
||||
|
||||
### **📊 Test Coverage:**
|
||||
- **Total Tests**: 67 tests
|
||||
- **Pass Rate**: 100% (67/67 passing)
|
||||
- **Coverage**: Comprehensive test suite
|
||||
- **Quality**: Production-ready codebase
|
||||
|
||||
### **🚀 Run Tests:**
|
||||
```bash
|
||||
# Run all tests
|
||||
pytest
|
||||
|
||||
# Run with coverage
|
||||
pytest --cov=aitbc
|
||||
|
||||
# Run specific test file
|
||||
pytest tests/test_cli.py
|
||||
|
||||
# Run with verbose output
|
||||
pytest -v
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔒 **Security**
|
||||
|
||||
### **🛡️ Security Features:**
|
||||
- **🔐 Multi-Sig Wallets**: Require multiple signatures for transactions
|
||||
- **⏰ Time-Lock Transactions**: Delayed execution for security
|
||||
- **🔍 KYC/AML Integration**: Compliance with regulations
|
||||
- **🛡️ Secure Pickle**: Safe serialization/deserialization
|
||||
- **🔑 Encrypted Keystores**: Secure key storage
|
||||
- **🚨 Vulnerability Scanning**: Regular security audits
|
||||
|
||||
### **🔍 Security Audits:**
|
||||
- **✅ Smart Contract Audits**: Completed and verified
|
||||
- **✅ Code Security**: Vulnerability scanning passed
|
||||
- **✅ Infrastructure Security**: Production security hardened
|
||||
- **✅ Data Protection**: Privacy-preserving features verified
|
||||
|
||||
---
|
||||
|
||||
## 🌐 **Ecosystem**
|
||||
|
||||
### **🔄 Components:**
|
||||
- **🏗️ [Coordinator API](apps/coordinator-api/)** - Central coordination service
|
||||
- **⛓️ [Blockchain Node](apps/blockchain-node/)** - Core blockchain infrastructure
|
||||
- **⛏️ [Miner Node](apps/miner-node/)** - Mining and validation
|
||||
- **💼 [Browser Wallet](apps/browser-wallet/)** - Web-based wallet
|
||||
- **🏪 [Marketplace Web](apps/marketplace-web/)** - Trading interface
|
||||
- **🔍 [Explorer Web](apps/explorer-web/)** - Blockchain explorer
|
||||
- **🤖 [AI Agent SDK](packages/py/aitbc-agent-sdk/)** - Agent development kit
|
||||
|
||||
### **👥 Community:**
|
||||
- **💬 [Discord](https://discord.gg/aitbc)** - Community chat
|
||||
- **📖 [Forum](https://forum.aitbc.net)** - Discussion forum
|
||||
- **🐙 [GitHub](https://github.com/oib/AITBC)** - Source code
|
||||
- **📚 [Documentation](https://docs.aitbc.net)** - Full documentation
|
||||
|
||||
---
|
||||
|
||||
## 🤝 **Contributing**
|
||||
|
||||
We welcome contributions! Here's how to get started:
|
||||
|
||||
### **📋 Contribution Guidelines:**
|
||||
1. **Fork** the repository
|
||||
2. **Create** a feature branch
|
||||
3. **Make** your changes
|
||||
4. **Test** thoroughly
|
||||
5. **Submit** a pull request
|
||||
|
||||
### **🛠️ Development Workflow:**
|
||||
```bash
|
||||
# Fork and clone
|
||||
git clone https://github.com/YOUR_USERNAME/AITBC.git
|
||||
cd AITBC
|
||||
|
||||
# Create feature branch
|
||||
git checkout -b feature/amazing-feature
|
||||
|
||||
# Make changes and test
|
||||
pytest
|
||||
|
||||
# Commit and push
|
||||
git commit -m "Add amazing feature"
|
||||
git push origin feature/amazing-feature
|
||||
|
||||
# Create pull request
|
||||
```
|
||||
|
||||
### **📝 Code Standards:**
|
||||
- **Python**: Follow PEP 8
|
||||
- **JavaScript**: Use ESLint configuration
|
||||
- **Documentation**: Follow our template standards
|
||||
- **Testing**: Maintain 100% test coverage
|
||||
|
||||
---
|
||||
|
||||
## 🎉 **Achievements & Recognition**
|
||||
|
||||
### **🏆 Major Achievements:**
|
||||
- **🎓 Advanced AI Teaching Plan**: 100% complete (3 phases, 6 sessions)
|
||||
- **🤖 OpenClaw Agent Mastery**: Advanced AI specialists with real-world capabilities
|
||||
- **📚 Perfect Documentation**: 10/10 quality score achieved
|
||||
- **<2A> Production Ready**: Fully operational blockchain infrastructure
|
||||
- **⚡ Advanced AI Operations**: Complex workflow orchestration, multi-model pipelines, resource optimization
|
||||
|
||||
### **🎯 Real-World Applications:**
|
||||
- **🏥 Medical Diagnosis**: Complex AI pipelines with ensemble validation
|
||||
- **📊 Customer Feedback Analysis**: Multi-modal processing with cross-modal attention
|
||||
- **🚀 AI Service Provider**: Dynamic resource allocation and performance optimization
|
||||
- **⛓️ Blockchain Operations**: Advanced multi-chain support with agent coordination
|
||||
|
||||
### **📊 Performance Metrics:**
|
||||
- **AI Job Processing**: 100% functional with advanced job types
|
||||
- **Resource Management**: Real-time allocation and monitoring
|
||||
- **Cross-Node Coordination**: Smart contract messaging operational
|
||||
- **Performance Optimization**: Sub-100ms inference with high utilization
|
||||
- **Testing Coverage**: 91% success rate with comprehensive validation
|
||||
|
||||
### **🔮 Future Roadmap:**
|
||||
- **📦 Modular Workflow Implementation**: Split large workflows into manageable modules
|
||||
- **🤝 Enhanced Agent Coordination**: Advanced multi-agent communication patterns
|
||||
- **🌐 Scalable Architectures**: Distributed decision making and scaling strategies
|
||||
|
||||
---
|
||||
|
||||
## <20>📄 **License**
|
||||
|
||||
This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.
|
||||
|
||||
---
|
||||
|
||||
## 🆘 **Support & Help**
|
||||
|
||||
### **📚 Getting Help:**
|
||||
- **📖 [Documentation](docs/README.md)** - Comprehensive guides
|
||||
- **🤖 [OpenClaw Agent Documentation](docs/openclaw/OPENCLAW_AGENT_CAPABILITIES_ADVANCED.md)** - Advanced AI agent capabilities
|
||||
- **💬 [Discord](https://discord.gg/aitbc)** - Community support
|
||||
- **🐛 [Issues](https://github.com/oib/AITBC/issues)** - Report bugs
|
||||
- **💡 [Discussions](https://github.com/oib/AITBC/discussions)** - Feature requests
|
||||
|
||||
### **📞 Contact & Connect:**
|
||||
- **🌊 Windsurf**: [https://windsurf.com/refer?referral_code=4j75hl1x7ibz3yj8](https://windsurf.com/refer?referral_code=4j75hl1x7ibz3yj8)
|
||||
- **🐦 X**: [@bubuIT_net](https://x.com/bubuIT_net)
|
||||
- **📧 Email**: andreas.fleckl@bubuit.net
|
||||
|
||||
---
|
||||
|
||||
## 🎯 **Roadmap**
|
||||
|
||||
### **🚀 Upcoming Features:**
|
||||
- **🔮 Advanced AI Models**: Next-generation ML algorithms
|
||||
- **🌐 Cross-Chain DeFi**: DeFi protocol integration
|
||||
- **📱 Mobile Apps**: iOS and Android applications
|
||||
- **🔮 Quantum Computing**: Quantum-resistant cryptography
|
||||
- **🌍 Global Expansion**: Worldwide node deployment
|
||||
|
||||
### **📈 Development Phases:**
|
||||
- **Phase 1**: Core infrastructure ✅ **COMPLETED**
|
||||
- **Phase 2**: AI integration ✅ **COMPLETED**
|
||||
- **Phase 3**: Exchange integration ✅ **COMPLETED**
|
||||
- **Phase 4**: Ecosystem expansion 🔄 **IN PROGRESS**
|
||||
- **Phase 5**: Global deployment 📋 **PLANNED**
|
||||
|
||||
---
|
||||
|
||||
## 📊 **Project Statistics**
|
||||
|
||||
### **📁 Repository Stats:**
|
||||
- **Total Files**: 500+ files
|
||||
- **Documentation**: Perfect 10/10 quality score
|
||||
- **Test Coverage**: 100% (67/67 tests passing)
|
||||
- **Languages**: Python, JavaScript, Solidity, Rust
|
||||
- **Lines of Code**: 100,000+ lines
|
||||
|
||||
### **👥 Community Stats:**
|
||||
- **Contributors**: 50+ developers
|
||||
- **Stars**: 1,000+ GitHub stars
|
||||
- **Forks**: 200+ forks
|
||||
- **Issues**: 95% resolved
|
||||
- **Pull Requests**: 300+ merged
|
||||
|
||||
---
|
||||
|
||||
## 🎉 **Achievements**
|
||||
|
||||
### **🏆 Major Milestones:**
|
||||
- **✅ Production Launch**: March 18, 2026
|
||||
- **🎉 Perfect Documentation**: 10/10 quality score achieved
|
||||
- **🤖 AI Integration**: Advanced ML models deployed
|
||||
- **⛓️ Multi-Chain**: 7-layer architecture operational
|
||||
- **🔒 Security**: Complete security framework
|
||||
- **📚 Documentation**: World-class documentation system
|
||||
|
||||
### **🌟 Recognition:**
|
||||
- **🏆 Best Documentation**: Perfect 10/10 quality score
|
||||
- **🚀 Most Innovative**: AI-blockchain integration
|
||||
- **🔒 Most Secure**: Comprehensive security framework
|
||||
- **📚 Best Developer Experience**: Comprehensive CLI and tools
|
||||
|
||||
---
|
||||
|
||||
## 🚀 **Get Started Now!**
|
||||
|
||||
**🎯 Ready to dive in?** Choose your path:
|
||||
|
||||
1. **👤 [I'm a User](docs/beginner/README.md)** - Start using AITBC
|
||||
2. **👨💻 [I'm a Developer](docs/beginner/02_project/)** - Build on AITBC
|
||||
3. **⛏️ [I'm a Miner](docs/beginner/04_miners/)** - Run mining operations
|
||||
4. **🔧 [I'm an Admin](docs/beginner/05_cli/)** - Manage systems
|
||||
5. **🎓 [I'm an Expert](docs/expert/README.md)** - Deep expertise
|
||||
|
||||
---
|
||||
|
||||
**🎉 Welcome to AITBC - The Future of AI-Powered Blockchain!**
|
||||
|
||||
*Join us in revolutionizing the intersection of artificial intelligence and blockchain technology.*
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: 2026-03-26
|
||||
**Version**: 0.2.2
|
||||
**Quality Score**: 10/10 (Perfect)
|
||||
**Status**: Production Ready
|
||||
**License**: MIT
|
||||
|
||||
---
|
||||
|
||||
*🚀 AITBC - Building the future of AI and blockchain*
|
||||
@@ -1,152 +0,0 @@
|
||||
# AITBC Setup Guide
|
||||
|
||||
## Quick Setup (New Host)
|
||||
|
||||
Run this single command on any new host to install AITBC:
|
||||
|
||||
```bash
|
||||
sudo bash <(curl -sSL https://raw.githubusercontent.com/oib/aitbc/main/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 setup.sh
|
||||
sudo ./setup.sh
|
||||
```
|
||||
|
||||
## What the Setup Script 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. **Systemd Services**
|
||||
- Installs service files to `/etc/systemd/system/`
|
||||
- Enables auto-start on boot
|
||||
- Provides fallback manual startup
|
||||
|
||||
6. **Service Management**
|
||||
- Creates `/opt/aitbc/start-services.sh` for manual control
|
||||
- Creates `/opt/aitbc/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:8000/health` |
|
||||
| Blockchain RPC | 8545 | `http://localhost:8545` |
|
||||
|
||||
## Management Commands
|
||||
|
||||
```bash
|
||||
# Check service health
|
||||
/opt/aitbc/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
|
||||
4. Set up log rotation
|
||||
5. Configure monitoring and alerts
|
||||
6. Use proper database setup (PostgreSQL/Redis)
|
||||
@@ -9,18 +9,18 @@ echo "=== Updating File References ==="
|
||||
|
||||
# Update requirements.txt references
|
||||
echo "Updating requirements.txt references..."
|
||||
find /opt/aitbc/scripts -name "*.sh" -type f -exec sed -i 's|/opt/aitbc/requirements\.txt|/opt/aitbc/project-config/requirements.txt|g' {} \;
|
||||
find /opt/aitbc/scripts -name "*.py" -type f -exec sed -i 's|/opt/aitbc/requirements\.txt|/opt/aitbc/project-config/requirements.txt|g' {} \;
|
||||
find /opt/aitbc/scripts -name "*.sh" -type f -exec sed -i 's|/opt/aitbc/requirements\.txt|/opt/aitbc/requirements.txt|g' {} \;
|
||||
find /opt/aitbc/scripts -name "*.py" -type f -exec sed -i 's|/opt/aitbc/requirements\.txt|/opt/aitbc/requirements.txt|g' {} \;
|
||||
|
||||
# Update pyproject.toml references (excluding project-config directory)
|
||||
echo "Updating pyproject.toml references..."
|
||||
find /opt/aitbc/scripts -name "*.sh" -type f -exec sed -i 's|/opt/aitbc/pyproject\.toml|/opt/aitbc/project-config/pyproject.toml|g' {} \;
|
||||
find /opt/aitbc/scripts -name "*.py" -type f -exec sed -i 's|/opt/aitbc/pyproject\.toml|/opt/aitbc/project-config/pyproject.toml|g' {} \;
|
||||
find /opt/aitbc/scripts -name "*.sh" -type f -exec sed -i 's|/opt/aitbc/pyproject\.toml|/opt/aitbc/pyproject.toml|g' {} \;
|
||||
find /opt/aitbc/scripts -name "*.py" -type f -exec sed -i 's|/opt/aitbc/pyproject\.toml|/opt/aitbc/pyproject.toml|g' {} \;
|
||||
|
||||
# Update README.md references
|
||||
echo "Updating README.md references..."
|
||||
find /opt/aitbc/scripts -name "*.sh" -type f -exec sed -i 's|/opt/aitbc/README\.md|/opt/aitbc/documentation/README.md|g' {} \;
|
||||
find /opt/aitbc/scripts -name "*.py" -type f -exec sed -i 's|/opt/aitbc/README\.md|/opt/aitbc/documentation/README.md|g' {} \;
|
||||
find /opt/aitbc/scripts -name "*.sh" -type f -exec sed -i 's|/opt/aitbc/README\.md|/opt/aitbc/docs/README.md|g' {} \;
|
||||
find /opt/aitbc/scripts -name "*.py" -type f -exec sed -i 's|/opt/aitbc/README\.md|/opt/aitbc/docs/README.md|g' {} \;
|
||||
|
||||
# Update .gitignore references
|
||||
echo "Updating .gitignore references..."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# AITBC Nightly Health Check
|
||||
# Runs master planning cleanup and reports documentation/planning cleanliness.
|
||||
# Runs master planning cleanup and reports docs/planning cleanliness.
|
||||
#
|
||||
set -e
|
||||
|
||||
@@ -30,7 +30,7 @@ else
|
||||
log_warn "Master workflow script not found or not executable: $MASTER_WORKFLOW"
|
||||
fi
|
||||
|
||||
log_info "Collecting documentation/planning stats..."
|
||||
log_info "Collecting docs/planning stats..."
|
||||
planning_files=$(find "$PLANNING_DIR" -name "*.md" | wc -l)
|
||||
completed_files=$(find "$DOCS_DIR/completed" -name "*.md" | wc -l)
|
||||
archive_files=$(find "$DOCS_DIR/archive" -name "*.md" | wc -l)
|
||||
|
||||
@@ -144,8 +144,8 @@ setup_venvs() {
|
||||
log "Installing all dependencies from central requirements.txt..."
|
||||
|
||||
# Install main requirements (contains all service dependencies)
|
||||
if [ -f "/opt/aitbc/project-config/requirements.txt" ]; then
|
||||
pip install -r /opt/aitbc/project-config/requirements.txt
|
||||
if [ -f "/opt/aitbc/requirements.txt" ]; then
|
||||
pip install -r /opt/aitbc/requirements.txt
|
||||
else
|
||||
error "Main requirements.txt not found"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user