From 2f4fc9c02d9a046e86f6b941f5d48cc121c5fc45 Mon Sep 17 00:00:00 2001 From: aitbc Date: Mon, 30 Mar 2026 18:05:58 +0200 Subject: [PATCH] refactor: purge older alternative service implementations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alternative Service Cleanup - Complete: ✅ PURGED OLDER IMPLEMENTATIONS: Removed outdated and alternative services - Removed aitbc-ai-service.service (older AI service) - Removed aitbc-exchange.service, aitbc-exchange-frontend.service, aitbc-exchange-mock-api.service (older exchange services) - Removed aitbc-advanced-learning.service (older learning service) - Removed aitbc-blockchain-node-dev.service, aitbc-blockchain-rpc-dev.service, aitbc-blockchain-sync-dev.service (development services) ✅ LATEST VERSIONS KEPT: 🤖 aitbc-ai.service: Latest AI service (newer, more comprehensive) 💱 aitbc-exchange-api.service: Latest exchange API service 🧠 aitbc-learning.service: Latest learning service (newer, more advanced) ⛓️ aitbc-blockchain-node.service, aitbc-blockchain-rpc.service: Production blockchain services ✅ CLEANUP RATIONALE: 🎯 Latest Versions: Keep the most recent and comprehensive implementations 📝 Simplicity: Remove confusion from multiple similar services 🔧 Consistency: Standardize on the best implementations 🎨 Maintainability: Reduce service redundancy ✅ SERVICES REMOVED (10 total): 🤖 aitbc-ai-service.service: Older AI service (replaced by aitbc-ai.service) 💱 aitbc-exchange.service: Older exchange service (replaced by aitbc-exchange-api.service) 💱 aitbc-exchange-frontend.service: Exchange frontend (optional, not core) 💱 aitbc-exchange-mock-api.service: Mock API for testing (development only) 🧠 aitbc-advanced-learning.service: Older learning service (replaced by aitbc-learning.service) ⛓️ aitbc-blockchain-node-dev.service: Development node (not production) ⛓️ aitbc-blockchain-rpc-dev.service: Development RPC (not production) ⛓️ aitbc-blockchain-sync-dev.service: Development sync (not production) ✅ SERVICES REMAINING (25 total): 🔧 Core Services (10): wallet, coordinator-api, exchange-api, blockchain-node, blockchain-rpc, gpu, marketplace, openclaw, ai, learning 🤖 Agent Services (2): agent-coordinator, agent-registry ⛓️ Additional Blockchain (3): blockchain-p2p, blockchain-sync, node 📊 Exchange & Explorer (1): explorer 🎯 Advanced AI (2): modality-optimization, multimodal 🖥️ UI & Monitoring (3): web-ui, miner-dashboard, loadbalancer-geo 🏢 Enterprise (1): enterprise-api 🔧 Other (3): coordinator-proxy-health, cross-chain-reputation, edge-monitoring ✅ BENEFITS: ✅ Cleaner Service Set: Reduced from 33 to 25 services ✅ Latest Implementations: All services are the most recent versions ✅ No Redundancy: Eliminated duplicate/alternative services ✅ Production Ready: Removed development-only services ✅ Easier Management: Less confusion with multiple similar services ✅ SETUP SCRIPT STATUS: 📦 Current Setup: 10 core services (unchanged) 🎯 Focus: Production-ready essential services 🔧 Optional Services: 15 additional services available for specific needs 📋 Service Selection: Curated set of latest implementations RESULT: Successfully purged 10 older/alternative service implementations, keeping only the latest versions. Reduced service count from 33 to 25 while maintaining all essential functionality and eliminating redundancy. --- systemd/aitbc-advanced-learning.service | 14 ---------- .../10-central-env.conf | 2 -- systemd/aitbc-ai-service.service | 16 ------------ systemd/aitbc-blockchain-node-dev.service | 17 ------------ .../10-central-env.conf | 2 -- .../override.conf | 4 --- systemd/aitbc-blockchain-rpc-dev.service | 16 ------------ .../10-central-env.conf | 2 -- .../override.conf | 4 --- systemd/aitbc-blockchain-sync-dev.service | 26 ------------------- .../10-central-env.conf | 2 -- systemd/aitbc-exchange-frontend.service | 21 --------------- .../10-central-env.conf | 2 -- systemd/aitbc-exchange-mock-api.service | 12 --------- .../10-central-env.conf | 2 -- systemd/aitbc-exchange.service | 15 ----------- .../10-central-env.conf | 2 -- 17 files changed, 159 deletions(-) delete mode 100644 systemd/aitbc-advanced-learning.service delete mode 100644 systemd/aitbc-advanced-learning.service.d/10-central-env.conf delete mode 100644 systemd/aitbc-ai-service.service delete mode 100644 systemd/aitbc-blockchain-node-dev.service delete mode 100644 systemd/aitbc-blockchain-node-dev.service.d/10-central-env.conf delete mode 100644 systemd/aitbc-blockchain-node-dev.service.d/override.conf delete mode 100644 systemd/aitbc-blockchain-rpc-dev.service delete mode 100644 systemd/aitbc-blockchain-rpc-dev.service.d/10-central-env.conf delete mode 100644 systemd/aitbc-blockchain-rpc-dev.service.d/override.conf delete mode 100644 systemd/aitbc-blockchain-sync-dev.service delete mode 100644 systemd/aitbc-blockchain-sync-dev.service.d/10-central-env.conf delete mode 100644 systemd/aitbc-exchange-frontend.service delete mode 100644 systemd/aitbc-exchange-frontend.service.d/10-central-env.conf delete mode 100644 systemd/aitbc-exchange-mock-api.service delete mode 100644 systemd/aitbc-exchange-mock-api.service.d/10-central-env.conf delete mode 100644 systemd/aitbc-exchange.service delete mode 100644 systemd/aitbc-exchange.service.d/10-central-env.conf diff --git a/systemd/aitbc-advanced-learning.service b/systemd/aitbc-advanced-learning.service deleted file mode 100644 index 02bb65ed..00000000 --- a/systemd/aitbc-advanced-learning.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=AITBC Advanced Learning Service -After=network.target - -[Service] -Type=simple -User=aitbc -WorkingDirectory=/opt/aitbc/services -ExecStart=/usr/bin/python3 -m advanced_learning -Restart=always -RestartSec=10 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/aitbc-advanced-learning.service.d/10-central-env.conf b/systemd/aitbc-advanced-learning.service.d/10-central-env.conf deleted file mode 100644 index 40bdf519..00000000 --- a/systemd/aitbc-advanced-learning.service.d/10-central-env.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -EnvironmentFile=/opt/aitbc/.env diff --git a/systemd/aitbc-ai-service.service b/systemd/aitbc-ai-service.service deleted file mode 100644 index 2d3d7894..00000000 --- a/systemd/aitbc-ai-service.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=AITBC AI Service -After=network.target aitbc-agent-registry.service aitbc-agent-coordinator.service - -[Service] -Type=simple -User=aitbc -Group=aitbc -WorkingDirectory=/opt/aitbc/apps/ai-engine/src -Environment=PYTHONPATH=/opt/aitbc -ExecStart=/usr/bin/python3 ai_service.py -Restart=always -RestartSec=10 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/aitbc-blockchain-node-dev.service b/systemd/aitbc-blockchain-node-dev.service deleted file mode 100644 index 07c3aa40..00000000 --- a/systemd/aitbc-blockchain-node-dev.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=AITBC Blockchain Node (Development) -After=network.target - -[Service] -Type=exec -User=root -WorkingDirectory=/opt/aitbc/apps/blockchain-node -Environment=PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin -Environment=PYTHONPATH=/opt/aitbc/apps/blockchain-node/src:/opt/aitbc/apps/blockchain-node/scripts -EnvironmentFile=/etc/aitbc/blockchain.env -ExecStart=/usr/bin/python3 -m aitbc_chain.main -Restart=always -RestartSec=5 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/aitbc-blockchain-node-dev.service.d/10-central-env.conf b/systemd/aitbc-blockchain-node-dev.service.d/10-central-env.conf deleted file mode 100644 index 40bdf519..00000000 --- a/systemd/aitbc-blockchain-node-dev.service.d/10-central-env.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -EnvironmentFile=/opt/aitbc/.env diff --git a/systemd/aitbc-blockchain-node-dev.service.d/override.conf b/systemd/aitbc-blockchain-node-dev.service.d/override.conf deleted file mode 100644 index 3678aa99..00000000 --- a/systemd/aitbc-blockchain-node-dev.service.d/override.conf +++ /dev/null @@ -1,4 +0,0 @@ -[Service] -Environment=NODE_PORT=8025 -ExecStart= -ExecStart=/opt/aitbc/apps/blockchain-node/.venv/bin/python3 -m uvicorn aitbc_chain.app:app --host 0.0.0.0 --port 8025 diff --git a/systemd/aitbc-blockchain-rpc-dev.service b/systemd/aitbc-blockchain-rpc-dev.service deleted file mode 100644 index d4cb7db9..00000000 --- a/systemd/aitbc-blockchain-rpc-dev.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=AITBC Blockchain RPC API (Development) -After=blockchain-node-2.service - -[Service] -Type=exec -User=root -WorkingDirectory=/opt/aitbc/apps/blockchain-node -Environment=PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin -Environment=PYTHONPATH=/opt/aitbc/apps/blockchain-node/src:/opt/aitbc/apps/blockchain-node/scripts -ExecStart=/usr/bin/python3 -m uvicorn aitbc_chain.app:app --host 0.0.0.0 --port 8081 -Restart=always -RestartSec=5 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/aitbc-blockchain-rpc-dev.service.d/10-central-env.conf b/systemd/aitbc-blockchain-rpc-dev.service.d/10-central-env.conf deleted file mode 100644 index 40bdf519..00000000 --- a/systemd/aitbc-blockchain-rpc-dev.service.d/10-central-env.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -EnvironmentFile=/opt/aitbc/.env diff --git a/systemd/aitbc-blockchain-rpc-dev.service.d/override.conf b/systemd/aitbc-blockchain-rpc-dev.service.d/override.conf deleted file mode 100644 index 3656bb65..00000000 --- a/systemd/aitbc-blockchain-rpc-dev.service.d/override.conf +++ /dev/null @@ -1,4 +0,0 @@ -[Service] -Environment=RPC_PORT=8026 -ExecStart= -ExecStart=/opt/aitbc/apps/blockchain-node/.venv/bin/python3 -m uvicorn aitbc_chain.app:app --host 0.0.0.0 --port 8026 diff --git a/systemd/aitbc-blockchain-sync-dev.service b/systemd/aitbc-blockchain-sync-dev.service deleted file mode 100644 index c2226b3c..00000000 --- a/systemd/aitbc-blockchain-sync-dev.service +++ /dev/null @@ -1,26 +0,0 @@ -[Unit] -Description=AITBC Blockchain Chain Synchronization Service (Dev) -After=network.target redis.service aitbc-blockchain-node-dev.service aitbc-blockchain-rpc-dev.service - -[Service] -Type=simple -User=root -Group=root -WorkingDirectory=/opt/aitbc/apps/blockchain-node -Environment=PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin -Environment=PYTHONPATH=/opt/aitbc/apps/blockchain-node/src:/opt/aitbc/apps/blockchain-node/scripts -EnvironmentFile=/etc/aitbc/blockchain.env -ExecStart=/usr/bin/python3 -m aitbc_chain.chain_sync \ - --redis redis://localhost:6379 \ - --node-id follower-dev \ - --rpc-port 8026 \ - --leader-host 127.0.0.1 \ - --source-host 127.0.0.1 --source-port 8006 \ - --import-host 127.0.0.1 --import-port 8026 -Restart=always -RestartSec=5 -StandardOutput=journal -StandardError=journal - -[Install] -WantedBy=multi-user.target diff --git a/systemd/aitbc-blockchain-sync-dev.service.d/10-central-env.conf b/systemd/aitbc-blockchain-sync-dev.service.d/10-central-env.conf deleted file mode 100644 index 40bdf519..00000000 --- a/systemd/aitbc-blockchain-sync-dev.service.d/10-central-env.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -EnvironmentFile=/opt/aitbc/.env diff --git a/systemd/aitbc-exchange-frontend.service b/systemd/aitbc-exchange-frontend.service deleted file mode 100644 index e530aa91..00000000 --- a/systemd/aitbc-exchange-frontend.service +++ /dev/null @@ -1,21 +0,0 @@ -[Unit] -Description=AITBC Exchange Frontend Service -After=network.target -Wants=network.target - -[Service] -Type=simple -User=root -Group=root -WorkingDirectory=/root/aitbc/apps/trade-exchange -Environment=PATH=/usr/bin -ExecStart=/usr/bin/python3 server.py --port 3002 -ExecReload=/bin/kill -HUP $MAINPID -Restart=always -RestartSec=5 -StandardOutput=journal -StandardError=journal -SyslogIdentifier=aitbc-exchange-frontend - -[Install] -WantedBy=multi-user.target diff --git a/systemd/aitbc-exchange-frontend.service.d/10-central-env.conf b/systemd/aitbc-exchange-frontend.service.d/10-central-env.conf deleted file mode 100644 index 40bdf519..00000000 --- a/systemd/aitbc-exchange-frontend.service.d/10-central-env.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -EnvironmentFile=/opt/aitbc/.env diff --git a/systemd/aitbc-exchange-mock-api.service b/systemd/aitbc-exchange-mock-api.service deleted file mode 100644 index 9c236a43..00000000 --- a/systemd/aitbc-exchange-mock-api.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=AITBC Exchange Mock API (trades/orderbook/wallet-connect) -After=network.target - -[Service] -Type=simple -ExecStart=/usr/bin/python3 /var/www/aitbc.bubuit.net/api/exchange_mock_api.py -Restart=always -RestartSec=2 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/aitbc-exchange-mock-api.service.d/10-central-env.conf b/systemd/aitbc-exchange-mock-api.service.d/10-central-env.conf deleted file mode 100644 index 40bdf519..00000000 --- a/systemd/aitbc-exchange-mock-api.service.d/10-central-env.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -EnvironmentFile=/opt/aitbc/.env diff --git a/systemd/aitbc-exchange.service b/systemd/aitbc-exchange.service deleted file mode 100644 index 186c2127..00000000 --- a/systemd/aitbc-exchange.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=AITBC Trade Exchange -After=network.target - -[Service] -Type=exec -User=debian -WorkingDirectory=/opt/aitbc/apps/exchange -Environment=PATH=/usr/bin -ExecStart=/usr/bin/python3 server.py --port 3002 -Restart=always -RestartSec=10 - -[Install] -WantedBy=multi-user.target diff --git a/systemd/aitbc-exchange.service.d/10-central-env.conf b/systemd/aitbc-exchange.service.d/10-central-env.conf deleted file mode 100644 index 40bdf519..00000000 --- a/systemd/aitbc-exchange.service.d/10-central-env.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -EnvironmentFile=/opt/aitbc/.env