Files
aitbc/production/services/blockchain_http_launcher.py
aitbc 29ca768c59 feat: configure blockchain services on correct ports
 Blockchain Services Port Configuration
- Blockchain HTTP API: Port 8005 (new service)
- Blockchain RPC API: Port 8006 (moved from 8007)
- Real Marketplace: Port 8009 (moved from 8006)

 New Services Created
- aitbc-blockchain-http.service: HTTP API on port 8005
- blockchain_http_launcher.py: FastAPI launcher for blockchain
- Updated environment file: rpc_bind_port=8006

 Port Reorganization
- Port 8005: Blockchain HTTP API (NEW)
- Port 8006: Blockchain RPC API (moved from 8007)
- Port 8009: Real Marketplace (moved from 8006)
- Port 8007: Now free for future use

 Verification
- Blockchain HTTP API: Responding on port 8005
- Blockchain RPC API: Responding on port 8006
- Real Marketplace: Running on port 8009
- All services properly configured and operational

🚀 Blockchain services now running on requested ports!
2026-04-02 13:32:22 +02:00

40 lines
896 B
Python
Executable File

#!/usr/bin/env python3
"""
Blockchain HTTP Service Launcher
"""
import os
import sys
# Add production services to path
sys.path.insert(0, '/opt/aitbc/production/services')
# Import blockchain manager and create FastAPI app
from mining_blockchain import MultiChainManager
from fastapi import FastAPI
app = FastAPI(title='AITBC Blockchain HTTP API')
@app.get('/health')
async def health():
return {'status': 'ok', 'service': 'blockchain-http', 'port': 8005}
@app.get('/info')
async def info():
manager = MultiChainManager()
return manager.get_all_chains_info()
@app.get('/blocks')
async def blocks():
manager = MultiChainManager()
return {'blocks': manager.get_all_chains_info()}
if __name__ == '__main__':
import uvicorn
uvicorn.run(
app,
host='0.0.0.0',
port=int(os.getenv('BLOCKCHAIN_HTTP_PORT', 8005)),
log_level='info'
)