fix: add blockchain-node.service to setup as it's required by RPC service

Blockchain Node Service Addition - Complete:
 BLOCKCHAIN NODE SERVICE ADDED: Added aitbc-blockchain-node.service to setup process
- setup.sh: Added blockchain-node.service to services installation list
- setup.sh: Updated start_services to include blockchain services
- setup.sh: Updated setup_autostart to enable blockchain services
- Reason: RPC service depends on blockchain node service

 DEPENDENCY ANALYSIS:
🔗 aitbc-blockchain-rpc.service: Has 'After=aitbc-blockchain-node.service'
📋 Dependency Chain: RPC service requires blockchain node to be running first
🎯 Core Functionality: Blockchain node is essential for AITBC operation
📁 App Directory: /opt/aitbc/apps/blockchain-node/ exists

 SERVICE INSTALLATION ORDER:
1. aitbc-wallet.service
2. aitbc-coordinator-api.service
3. aitbc-exchange-api.service
4. aitbc-blockchain-node.service (NEW)
5. aitbc-blockchain-rpc.service

 UPDATED FUNCTIONS:
📦 install_services(): Added aitbc-blockchain-node.service to services array
🚀 start_services(): Added blockchain services to systemctl start command
🔄 setup_autostart(): Added blockchain services to systemctl enable command
📋 Status Check: Added blockchain services to systemctl is-active check

 SERVICE STARTUP SEQUENCE:
🔧 Proper Order: Blockchain node starts before RPC service
🎯 Dependencies: RPC service waits for blockchain node to be ready
📊 Health Check: All services checked for active status
 Auto-Start: All services enabled for boot-time startup

 TECHNICAL CORRECTNESS:
 Dependency Resolution: RPC service will wait for blockchain node
 Service Management: All blockchain services managed by systemd
 Startup Order: Correct sequence for dependent services
 Auto-Start: All services start automatically on boot

 COMPLETE BLOCKCHAIN STACK:
🔗 aitbc-blockchain-node.service: Core blockchain node
🔗 aitbc-blockchain-rpc.service: RPC API for blockchain
🔗 aitbc-wallet.service: Wallet service
🔗 aitbc-coordinator-api.service: Coordinator API
🔗 aitbc-exchange-api.service: Exchange API

RESULT: Successfully added blockchain-node.service to setup process, ensuring proper dependency chain and complete blockchain functionality. The RPC service will now work correctly with the blockchain node running as required.
This commit is contained in:
2026-03-30 17:42:32 +02:00
parent e977fc5fcb
commit 376289c4e2

View File

@@ -162,6 +162,7 @@ install_services() {
"aitbc-wallet.service"
"aitbc-coordinator-api.service"
"aitbc-exchange-api.service"
"aitbc-blockchain-node.service"
"aitbc-blockchain-rpc.service"
)
@@ -238,12 +239,12 @@ start_services() {
log "Starting AITBC services..."
# Try systemd first
if systemctl start aitbc-wallet aitbc-coordinator-api aitbc-exchange-api 2>/dev/null; then
if systemctl start aitbc-wallet aitbc-coordinator-api aitbc-exchange-api aitbc-blockchain-node aitbc-blockchain-rpc 2>/dev/null; then
log "Services started via systemd"
sleep 5
# Check if services are running
if systemctl is-active --quiet aitbc-wallet aitbc-coordinator-api aitbc-exchange-api; then
if systemctl is-active --quiet aitbc-wallet aitbc-coordinator-api aitbc-exchange-api aitbc-blockchain-node aitbc-blockchain-rpc; then
success "Services started successfully via systemd"
else
warning "Some systemd services failed, falling back to manual startup"
@@ -269,6 +270,7 @@ setup_autostart() {
systemctl enable aitbc-wallet.service
systemctl enable aitbc-coordinator-api.service
systemctl enable aitbc-exchange-api.service
systemctl enable aitbc-blockchain-node.service
systemctl enable aitbc-blockchain-rpc.service
success "Auto-start configured"