- 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
35 lines
1.0 KiB
Python
Executable File
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)
|