diff --git a/.deployment_progress b/.deployment_progress deleted file mode 100644 index c83d3a84..00000000 --- a/.deployment_progress +++ /dev/null @@ -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 diff --git a/.gitignore b/.gitignore index 3ab9e64c..c3726892 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.last_backup b/.last_backup deleted file mode 100644 index d6d7d2e7..00000000 --- a/.last_backup +++ /dev/null @@ -1 +0,0 @@ -/opt/aitbc/backups/pre_deployment_20260402_120920 diff --git a/AITBC1_TEST_COMMANDS.md b/AITBC1_TEST_COMMANDS.md deleted file mode 100644 index 8adc589c..00000000 --- a/AITBC1_TEST_COMMANDS.md +++ /dev/null @@ -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!** diff --git a/AITBC1_UPDATED_COMMANDS.md b/AITBC1_UPDATED_COMMANDS.md deleted file mode 100644 index 48080aea..00000000 --- a/AITBC1_UPDATED_COMMANDS.md +++ /dev/null @@ -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!** ๐Ÿš€ diff --git a/PROJECT_ORGANIZATION_SUMMARY.md b/PROJECT_ORGANIZATION_SUMMARY.md deleted file mode 100644 index 47551f7d..00000000 --- a/PROJECT_ORGANIZATION_SUMMARY.md +++ /dev/null @@ -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 โœ… diff --git a/PYTHON_VERSION_STATUS.md b/PYTHON_VERSION_STATUS.md deleted file mode 100644 index 4e0ffa46..00000000 --- a/PYTHON_VERSION_STATUS.md +++ /dev/null @@ -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 -``` - -### **๐Ÿ”„ 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* diff --git a/README.md b/README.md index c877ba83..45508097 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/SECURITY_VULNERABILITY_REPORT.md b/SECURITY_VULNERABILITY_REPORT.md deleted file mode 100644 index 458b3285..00000000 --- a/SECURITY_VULNERABILITY_REPORT.md +++ /dev/null @@ -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.* diff --git a/SETUP.md b/SETUP.md deleted file mode 100644 index 09d13e21..00000000 --- a/SETUP.md +++ /dev/null @@ -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 ` -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) diff --git a/backup-config/aitbc-cli.backup b/backup-config/aitbc-cli.backup deleted file mode 100755 index e9303782..00000000 --- a/backup-config/aitbc-cli.backup +++ /dev/null @@ -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/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/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/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/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/null && echo "yes" || echo "no") - F_REACHABLE=$(timeout 2 bash -c "/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/null && echo "healthy" || echo "down") - F_HEALTH=$(timeout 2 bash -c "/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/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/null && echo "yes" || echo "no") - F_REACHABLE=$(timeout 2 bash -c "/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" "$@" diff --git a/documentation/AITBC1_TEST_COMMANDS.md b/documentation/AITBC1_TEST_COMMANDS.md deleted file mode 100644 index 8adc589c..00000000 --- a/documentation/AITBC1_TEST_COMMANDS.md +++ /dev/null @@ -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!** diff --git a/documentation/AITBC1_UPDATED_COMMANDS.md b/documentation/AITBC1_UPDATED_COMMANDS.md deleted file mode 100644 index 48080aea..00000000 --- a/documentation/AITBC1_UPDATED_COMMANDS.md +++ /dev/null @@ -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!** ๐Ÿš€ diff --git a/documentation/PYTHON_VERSION_STATUS.md b/documentation/PYTHON_VERSION_STATUS.md deleted file mode 100644 index 4e0ffa46..00000000 --- a/documentation/PYTHON_VERSION_STATUS.md +++ /dev/null @@ -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 -``` - -### **๐Ÿ”„ 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* diff --git a/documentation/README.md b/documentation/README.md deleted file mode 100644 index 5e6dd5be..00000000 --- a/documentation/README.md +++ /dev/null @@ -1,715 +0,0 @@ -# AITBC - AI Training Blockchain - -**Advanced AI Platform with OpenClaw Agent Ecosystem** - -[![Documentation](https://img.shields.io/badge/Documentation-10%2F10-brightgreen.svg)](docs/README.md) -[![Quality](https://img.shields.io/badge/Quality-Perfect-green.svg)](docs/about/PHASE_3_COMPLETION_10_10_ACHIEVED.md) -[![Status](https://img.shields.io/badge/Status-Production%20Ready-blue.svg)](docs/README.md#-current-status-production-ready---march-18-2026) -[![OpenClaw](https://img.shields.io/badge/OpenClaw-Advanced%20AI%20Agents-purple.svg)](docs/openclaw/OPENCLAW_AGENT_CAPABILITIES_ADVANCED.md) -[![License](https://img.shields.io/badge/License-MIT-blue.svg)](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)** - -### **๏ฟฝ 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 -- **๏ฟฝ 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 - ---- - -## ๏ฟฝ๐Ÿ“„ **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* diff --git a/documentation/SETUP.md b/documentation/SETUP.md deleted file mode 100644 index 09d13e21..00000000 --- a/documentation/SETUP.md +++ /dev/null @@ -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 ` -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) diff --git a/scripts/maintenance/update-file-references.sh b/scripts/maintenance/update-file-references.sh index 51fcf787..cb4d2887 100755 --- a/scripts/maintenance/update-file-references.sh +++ b/scripts/maintenance/update-file-references.sh @@ -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..." diff --git a/scripts/monitoring/nightly_health_check.sh b/scripts/monitoring/nightly_health_check.sh index 9e00e5af..eb6a3ab5 100644 --- a/scripts/monitoring/nightly_health_check.sh +++ b/scripts/monitoring/nightly_health_check.sh @@ -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) diff --git a/scripts/setup.sh b/scripts/setup.sh index f80993fb..8e06447b 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -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