Replace hardcoded IPs with environment variables
Fixed hardcoded IP addresses in production code by replacing them with environment variables or config settings: - apps/blockchain-node/src/aitbc_chain/sync_cli.py: Use AITBC_SYNC_SOURCE and AITBC_SYNC_IMPORT_URL env vars for RPC URLs - apps/blockchain-node/src/aitbc_chain/app.py: Use AITBC_TRUSTED_IPS env var for rate limiting bypass - apps/coordinator-api/src/app/routers/client.py: Use settings.blockchain_rpc_url for RPC endpoint - dev/scripts/dev_heartbeat.py: Use AITBC_LOCAL_RPC and AITBC_GENESIS_RPC env vars for RPC URLs - cli/aitbc_cli.py: Use AITBC_FOLLOWER_HOST and AITBC_FOLLOWER_PORT env vars for network peer display This makes the codebase more portable and configurable for different deployment environments.
This commit is contained in:
@@ -14,8 +14,8 @@ REPO_ROOT = Path("/opt/aitbc")
|
||||
LOGS_DIR = REPO_ROOT / "logs"
|
||||
|
||||
# AITBC blockchain config
|
||||
LOCAL_RPC = "http://localhost:8006"
|
||||
GENESIS_RPC = "http://10.1.223.93:8006"
|
||||
LOCAL_RPC = os.getenv("AITBC_LOCAL_RPC", "http://localhost:8006")
|
||||
GENESIS_RPC = os.getenv("AITBC_GENESIS_RPC", "http://localhost:8006")
|
||||
MAX_HEIGHT_DIFF = 10 # acceptable block height difference between nodes
|
||||
|
||||
def sh(cmd, cwd=REPO_ROOT):
|
||||
|
||||
Reference in New Issue
Block a user