Files
aitbc/scripts/wrappers/aitbc-blockchain-node-wrapper.py
aitbc 00497a655a
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Remove force-enable block production from wrapper script
- Removes AITBC_FORCE_ENABLE_BLOCK_PRODUCTION, ENABLE_BLOCK_PRODUCTION, and enable_block_production environment variable overrides
- Block production is now controlled by env file settings (enable_block_production)
- Allows follower nodes to properly disable block production via configuration
2026-05-26 20:04:04 +02:00

35 lines
1.0 KiB
Python
Executable File

#!/usr/bin/env python3
"""
Wrapper script for aitbc-blockchain-node service
Uses centralized aitbc utilities for path configuration
"""
import sys
import os
from pathlib import Path
# Add aitbc to path
sys.path.insert(0, str(Path("/opt/aitbc")))
sys.path.insert(0, str(Path("/opt/aitbc/aitbc")))
from aitbc import ENV_FILE, NODE_ENV_FILE, REPO_DIR, DATA_DIR, LOG_DIR
# Set up environment using aitbc constants
os.environ["AITBC_ENV_FILE"] = str(ENV_FILE)
os.environ["AITBC_NODE_ENV_FILE"] = str(NODE_ENV_FILE)
os.environ["PYTHONPATH"] = f"{REPO_DIR}/apps/blockchain-node/src"
os.environ["DATA_DIR"] = str(DATA_DIR)
os.environ["LOG_DIR"] = str(LOG_DIR)
# Block production is controlled by env file settings (enable_block_production)
# The proposer runs in the event loop without blocking - no force-enable needed
# Execute the actual service
# Use combined_main to run both blockchain node and HTTP RPC server
exec_cmd = [
"/opt/aitbc/venv/bin/python",
"-m",
"aitbc_chain.main"
]
os.execvp(exec_cmd[0], exec_cmd)