From 9b92e7e2a5c259b7ba824fc53ed4280715555cd8 Mon Sep 17 00:00:00 2001 From: aitbc1 Date: Sun, 29 Mar 2026 15:56:45 +0200 Subject: [PATCH] refactor: merge CLI requirements to central requirements - Remove duplicate /opt/aitbc/cli/requirements.txt file - All CLI dependencies already covered in central requirements.txt - Central requirements has newer versions of all CLI dependencies - Update workflow documentation to reflect central venv usage - Update environment configuration to use /etc/aitbc/.env - Remove duplicate dependency management This consolidates all Python dependencies in the central requirements.txt and eliminates the need for separate CLI requirements management. --- .windsurf/workflows/multi-node-blockchain-setup.md | 8 ++++---- apps/blockchain-node/src/aitbc_chain/config.py | 2 +- cli/requirements.txt | 4 ---- 3 files changed, 5 insertions(+), 9 deletions(-) delete mode 100644 cli/requirements.txt diff --git a/.windsurf/workflows/multi-node-blockchain-setup.md b/.windsurf/workflows/multi-node-blockchain-setup.md index a7e934e8..b4cfdb54 100644 --- a/.windsurf/workflows/multi-node-blockchain-setup.md +++ b/.windsurf/workflows/multi-node-blockchain-setup.md @@ -37,7 +37,7 @@ cp /opt/aitbc/.env /etc/aitbc/.env.backup 2>/dev/null || true mv /opt/aitbc/.env /etc/aitbc/.env 2>/dev/null || true # 4. Setup AITBC CLI tool -# Use central virtual environment +# Use central virtual environment (dependencies already installed) source /opt/aitbc/venv/bin/activate pip install -e /opt/aitbc/cli/ 2>/dev/null || true echo 'alias aitbc="source /opt/aitbc/venv/bin/activate && aitbc"' >> ~/.bashrc @@ -59,8 +59,8 @@ ls -la /etc/aitbc/blockchain.env ## Directory Structure - `/opt/aitbc/venv` - Central Python virtual environment -- `/opt/aitbc/requirements.txt` - Python dependencies -- `/etc/aitbc/blockchain.env` - Central environment configuration +- `/opt/aitbc/requirements.txt` - Python dependencies (includes CLI dependencies) +- `/etc/aitbc/.env` - Central environment configuration - `/var/lib/aitbc/data` - Blockchain database files - `/var/lib/aitbc/keystore` - Wallet credentials - `/var/log/aitbc/` - Service logs @@ -69,7 +69,7 @@ ls -la /etc/aitbc/blockchain.env ### Environment Configuration -The workflow uses the central `/etc/aitbc/blockchain.env` file as the configuration for both nodes: +The workflow uses the central `/etc/aitbc/.env` file as the configuration for both nodes: - **Base Configuration**: The central config contains all default settings - **Node-Specific Adaptation**: Each node adapts the config for its role (genesis vs follower) diff --git a/apps/blockchain-node/src/aitbc_chain/config.py b/apps/blockchain-node/src/aitbc_chain/config.py index 326c7245..28d3a98e 100755 --- a/apps/blockchain-node/src/aitbc_chain/config.py +++ b/apps/blockchain-node/src/aitbc_chain/config.py @@ -16,7 +16,7 @@ class ProposerConfig(BaseModel): max_txs_per_block: int class ChainSettings(BaseSettings): - model_config = SettingsConfigDict(env_file="/opt/aitbc/.env", env_file_encoding="utf-8", case_sensitive=False, extra="ignore") + model_config = SettingsConfigDict(env_file="/etc/aitbc/.env", env_file_encoding="utf-8", case_sensitive=False, extra="ignore") chain_id: str = "" supported_chains: str = "ait-devnet" # Comma-separated list of supported chain IDs diff --git a/cli/requirements.txt b/cli/requirements.txt deleted file mode 100644 index 29958f80..00000000 --- a/cli/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -click>=8.0.0 -requests>=2.25.0 -pydantic>=2.0.0 -cryptography>=3.4.0