Files
aitbc/docs/infrastructure/PRODUCTION_ARCHITECTURE.md
aitbc a7fbf58462
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Successful in 3s
Deploy to Testnet / deploy-testnet (push) Successful in 1m6s
Documentation Validation / validate-docs (push) Failing after 9s
Documentation Validation / validate-policies-strict (push) Successful in 5s
Multi-Node Stress Testing / stress-test (push) Successful in 3s
Node Failover Simulation / failover-test (push) Failing after 4s
docs: merge docs/project files into appropriate doc directories
- Moved ai-economics/ to docs/ai-economics/
- Moved completion/ to docs/completion/
- Merged cli/ with docs/cli/
- Merged infrastructure/ with docs/infrastructure/
- Moved planning/ to docs/planning/
- Moved requirements/ to docs/requirements/
- Moved workspace/ to docs/development/workspace/
- Moved 1_files.md to docs/reference/REPOSITORY_STRUCTURE.md
- Moved 2_roadmap.md to docs/ROADMAP.md
- Moved 3_infrastructure.md to docs/infrastructure/INFRASTRUCTURE.md
- Moved SECURITY.md to docs/security/SECURITY.md
- Moved PROJECT_STRUCTURE.md to docs/archive/GPU_PROJECT_STRUCTURE.md
- Moved WORKING_SETUP.md to docs/guides/getting-started/WORKING_SETUP.md
- Moved E2E_TEST_CREATION_SUMMARY.md to docs/reports/E2E_TEST_CREATION_SUMMARY.md
- Moved SQLMODEL_METADATA_FIX_SUMMARY.md to docs/reports/SQLMODEL_METADATA_FIX_SUMMARY.md
- Moved GITHUB_PULL_SUMMARY.md to docs/reports/GITHUB_PULL_SUMMARY.md
- Moved GIFT_CERTIFICATE_newuser.md to docs/guides/getting-started/GIFT_CERTIFICATE.md
- Moved user_profile_newuser.md to docs/guides/getting-started/USER_PROFILE.md
- Moved aitbc.md to docs/infrastructure/NODE_AITBC.md
- Moved aitbc1.md to docs/infrastructure/NODE_AITBC1.md
- Updated project/README.md with new documentation locations
- Removed empty subdirectories from docs/project/
- Created docs/MERGE_PLAN.md for reference
2026-05-09 21:52:55 +02:00

3.5 KiB

AITBC Production Environment

🏗️ Proper System Architecture

The AITBC production environment follows Linux Filesystem Hierarchy Standard (FHS) compliance:

📁 System Directory Structure

/etc/aitbc/                    # Production configurations
├── .env                       # Production environment variables
├── blockchain.env             # Blockchain service config
└── production/                # Production-specific configs

/opt/aitbc/services/           # Production service scripts
├── blockchain_http_launcher.py
├── blockchain_simple.py
├── marketplace.py
└── ...                        # Other service scripts

/var/lib/aitbc/                # Runtime data
├── data/                      # Blockchain databases
│   ├── blockchain/            # Blockchain data
│   ├── coordinator/           # Coordinator database
│   └── marketplace/           # Marketplace data
├── keystore/                  # Cryptographic keys (secure)
└── backups/                   # Production backups

/var/log/aitbc/                # Production logs
├── production/                # Production service logs
├── blockchain/                # Blockchain service logs
└── coordinator/               # Coordinator logs

🚀 Launching Production Services

Services are launched via systemd:

# Start blockchain node
systemctl start aitbc-blockchain-node

# Start blockchain RPC
systemctl start aitbc-blockchain-rpc

# Start coordinator API
systemctl start aitbc-agent-coordinator

# Check status
systemctl status aitbc-blockchain-node

⚙️ Configuration Management

Production configurations are stored in /etc/aitbc/:

  • Environment variables in .env
  • Blockchain config in blockchain.env
  • Service-specific configs in production subdirectory

📊 Monitoring and Logs

Production logs are centralized in /var/log/aitbc/:

  • Each service has its own log directory
  • Logs rotate automatically
  • Real-time monitoring available

Coordinator observability endpoints:

  • JSON metrics endpoint: http://localhost:8011/v1/metrics
  • Prometheus metrics endpoint: http://localhost:8011/metrics
  • Health endpoint: http://localhost:8011/v1/health
  • Web dashboard source: /opt/aitbc/website/dashboards/metrics.html

Current monitoring flow:

  • FastAPI request middleware records request counts, error counts, response time, and cache stats
  • metrics.py calculates live metric summaries and alert thresholds
  • /v1/metrics returns JSON for dashboard consumption
  • /metrics remains available for Prometheus-style scraping
  • Alert delivery uses webhook dispatch when AITBC_ALERT_WEBHOOK_URL is configured, otherwise alerts are logged locally

🔧 Maintenance

  • Backups: Stored in /var/lib/aitbc/backups/
  • Updates: Update code in /opt/aitbc/, restart services
  • Configuration: Edit files in /etc/aitbc/

🛡️ Security

  • All production files have proper permissions
  • Keystore at /var/lib/aitbc/keystore/ (secure, permissions 700)
  • Environment variables are protected
  • SSL certificates in /etc/aitbc/production/certs/ (if used)

📋 Architecture Status

The AITBC production environment follows FHS compliance:

  • Configurations in /etc/aitbc/
  • Service scripts in /opt/aitbc/services/
  • Runtime data in /var/lib/aitbc/
  • Logs centralized in /var/log/aitbc/
  • Repository clean of runtime files
  • Proper FHS compliance achieved