- Move _ensure_genesis_for_chains() inside block production enabled check in main.py
- Prevents follower nodes from creating local genesis blocks
- Removes redundant genesis check from poa.start() since genesis creation is now controlled at startup
- Follower nodes will sync genesis from hub instead of creating their own
- Block production now requires a genesis block to exist before starting
- Prevents automatic local genesis creation and subsequent chain divergence
- Follower nodes without genesis will not produce blocks even if proposer_id is present
- Prevents block production on follower nodes when enable_block_production=false
- Fixes issue where proposer_id in secrets was overriding config setting
- PoA proposer now respects the enable_block_production configuration
- Clear env file at start to avoid appending duplicates when script runs multiple times
- Fixes issue where proposer_id was repeated many times in /run/aitbc/secrets/.env
- This was causing unwanted block production on follower nodes
- Update 01_preflight_setup.sh to create blockchain.env with defaults
- Update hermes preflight setup scripts to create blockchain.env with defaults
- Remove dependency on /opt/aitbc/.env which doesn't exist
- Use tx_data.sender and tx_data.recipient instead of reading from payload
- Use tx_data.amount instead of tx_data.payload.get('amount')
- Fixes 'transaction.to is required' error when CLI sends fields at top level
- Pydantic model already validates and aliases from/to to sender/recipient
- RPC expects from, to, amount, fee, nonce, type, signature at top level
- Payload is additional free-form object, not container for all fields
- Fixes validation error: missing field 'from' at body level
- Matches TransactionRequest OpenAPI schema
- Move transaction data into nested payload object
- Sign only the payload, not the entire request
- Submit as {"payload": {...}, "signature": "..."}
- Matches RPC server expectation for nested structure
- Ensures Ed25519 signature is properly included
- Move amount and recipient/to to top level instead of nested in payload
- Remove chain_id from top level (not in TransactionRequest schema)
- Match TransactionRequest model in apps/blockchain-node/src/aitbc_chain/rpc/transactions.py
- Fixes 422 validation error: field amount is required
- Fixes int_from_flo error by ensuring amount and fee are integers
- Check if wallet is encrypted before attempting decryption
- For unencrypted wallets (created with --no-encrypt), use private_key directly
- Checks both 'encrypted' and 'encrypted_private_key' fields for encryption status
- Fixes 'Unsupported cipher' error when using unencrypted wallets
- Changed DEFAULT_KEYSTORE_DIR from KEYSTORE_DIR to Path.home()/.aitbc/wallets
- This matches the wallet directory used by wallet create command
- Fixes 'Wallet not found' error in transactions send command
- Wallets created at ~/.aitbc/wallets/ are now accessible to transactions commands
- Restructured password resolution in transactions send/batch to check env var before TTY
- Changed from os.environ.get() to 'in os.environ' to detect empty string env vars
- Added unencrypted wallet detection to skip password for --no-encrypt wallets
- Updated genesis info to auto-detect chain_id from blockchain RPC health endpoint
- Added --rpc-url option to genesis info for custom RPC URL
- Improved error messages to show RPC URL used for detection
- Fixes termios.error when AITBC_WALLET_PASSWORD is set to empty string
- Added sys.stdin.isatty() check before getpass in transactions send and batch commands
- Added environment variable fallback (AITBC_WALLET_PASSWORD) for non-interactive environments
- Added --data-dir option to genesis info command to allow custom data directory paths
- Improved error messages in genesis info to show chain_id and data directory
- Fixes termios.error in non-interactive environments for transactions
- Fixed getpass TTY error by checking sys.stdin.isatty() before prompting
- Added environment variable fallback for non-interactive environments (AITBC_WALLET_PASSWORD)
- Added config get command as alias for show command
- Wrapped getpass calls in try/except for better error handling
- Fixes termios.error in non-interactive environments like CI/scripts
- Added @click.argument("name", required=False) to balance command
- Added @click.argument("name", required=False) to address command
- Commands now accept wallet name as positional argument or fall back to --wallet-name option
- Fixes UsageError when running "aitbc wallet balance my-agent-wallet"
- Matches scenario documentation syntax expectations
- Moved core/ directory to aitbc_cli/core/ to make it a proper subpackage
- Updated aitbc_cli.py to load from new path
- Simplified aitbc_cli/__init__.py to use normal import instead of spec_from_file_location
- Updated all core imports to use aitbc_cli.core prefix
- Copied utils files (wallet_daemon_client, error_handling, crypto_utils, subprocess) to aitbc_cli/utils/
- Fixed wallet list command to work with new structure
- This fixes ModuleNotFoundError for aitbc_cli.core submodules
- Copied all files from cli/models/ to cli/aitbc_cli/models/
- Commands use relative imports like from ..models.chain import ChainType
- Files were in cli/models/ but imports expected them in cli/aitbc_cli/models/
- Fixes ModuleNotFoundError for ChainType and other model imports
- Copied from cli/utils/ to cli/aitbc_cli/utils/
- Wallet command imports from aitbc_cli.utils.dual_mode_wallet_adapter
- File was in cli/utils/ but import expected it in cli/aitbc_cli/utils/
- Fixes ModuleNotFoundError for DualModeWalletAdapter
- Register aitbc_cli.core module pointing to core/ directory before loading
- Register aitbc_cli.core.main in sys.modules before exec_module
- Fixes No module named 'aitbc_cli.core' error when core/main.py imports
- Allows core/main.py to import from aitbc_cli.commands.* correctly
- Added sys.path.insert(0, str(CLI_DIR)) where CLI_DIR is /opt/aitbc/cli
- Ensures aitbc_cli package is importable from core/main.py
- Fixes No module named 'aitbc_cli.core' error
- core/ and aitbc_cli/ are siblings, so core/main.py needs explicit path setup
- Disabled compatibility aliases for core and models (sibling directories, not subpackages)
- Changed __getattr__ to use spec_from_file_location instead of import_module
- Prevents sys.modules corruption that broke aitbc_cli.utils imports
- Fixes wallet command ModuleNotFoundError for dual_mode_wallet_adapter
- Added sys.modules["aitbc_cli.core.main"] registration before exec_module
- Fixes ModuleNotFoundError for aitbc_cli.utils.dual_mode_wallet_adapter
- Ensures subpackage imports resolve correctly when loaded via spec_from_file_location
- Allows wallet commands to import from aitbc_cli.utils properly
- Changed from config_cmd to config as config_cmd
- The function in config.py is named config, not config_cmd
- All other import names matched their actual function names
- Removed Config from import in config.py command file
- Config class doesn't exist in aitbc_cli.config (only CLIConfig exists)
- Config was unused in the command file anyway
- Fixes ImportError that cascaded to fail all commands
- Re-enabled exchange and config commands as they don't import from ..core
- exchange imports from ..config and ..utils (both exist)
- config imports from ..config and ..utils (both exist)
- Commands with ..core imports remain disabled until aitbc_cli.core subpackage is created
- Commented out deployment command import and registration
- deployment.py imports from aitbc_cli.core.deployment which doesn't exist
- Other commands using ..core.* imports are valid (config, chain_manager, analytics, etc.)
- Prevents ModuleNotFoundError when loading CLI
- Changed from utils.dual_mode_wallet_adapter to aitbc_cli.utils.dual_mode_wallet_adapter
- Removes need for sys.path manipulation
- Works correctly with spec_from_file_location loading
- Fixes ModuleNotFoundError when core/main.py loads wallet commands
- Fixed path to include /cli directory for utils.dual_mode_wallet_adapter import
- Changed from parent.parent.parent to parent.parent.parent.parent / "cli"
- Ensures utils module can be found when running wallet commands
- Fixes ModuleNotFoundError for utils.dual_mode_wallet_adapter
- Fixed scripts/aitbc-cli to use correct module name aitbc_cli.core.main
- Prevents module resolution to hermes-agent or other cli packages
- Ensures AITBC CLI loads from correct aitbc_cli package
- Added symlink from /opt/aitbc/aitbc-cli to /usr/local/bin/aitbc-cli
- CLI now available system-wide without requiring /opt/aitbc in PATH
- Fixes hermes agent stumble when aitbc CLI not found
- Added error handling if symlink creation fails
- Provides manual PATH addition instructions as fallback
- Generate secure random passwords for all PostgreSQL database users
- Store passwords in /etc/aitbc/credentials/postgres_*_password files
- Update load-keystore-secrets.sh to load PostgreSQL passwords into runtime .env
- Set passwords for both new and existing users with ALTER USER
- Fixes PostgreSQL authentication failures in services
- Ensures secure password management for database access
- Added libpq-dev to apt-get prerequisites for psycopg2 compilation
- Added postgresql-devel to yum prerequisites for psycopg2 compilation
- Added fallback installation of psycopg2-binary when Poetry fails
- Added fallback installation of critical packages (fastapi, uvicorn, sqlmodel)
- Prevents service crashes due to missing psycopg2 module
- Ensures PostgreSQL database connectivity for services
- Added error handling for python3 secrets module failures
- Added OpenSSL fallback for credential generation
- Added timestamp-based fallback if both python3 and openssl fail
- Added fallback for proposer_id generation if not in .env
- Improved logging for each credential generation step
- Prevents setup failures when python3 secrets module unavailable
- Ensures credentials are always generated with fallback methods
- Added call to load-keystore-secrets.sh in setup_credentials function
- Generates /run/aitbc/secrets/.env during setup
- Required by blockchain-node and blockchain-rpc systemd services
- Added error handling if secrets generation fails
- Prevents service startup failures due to missing runtime secrets
- Fixes hermes setup stumble where services failed to start
- Added redis-server and redis-cli to prerequisite command checks
- Added installation cases for Redis (redis-server, redis-tools) for apt-get
- Added Redis to yum installation batch
- Redis is required for gossip configuration
- Ensures Redis is available for P2P network setup
- Add error handling for venv activation (both new and existing)
- Add error handling for pip upgrade (continues if fails)
- Add error handling for Poetry installation
- Add error handling for poetry install command
- Provide manual recovery instructions for each failure point
- Prevents script from failing completely on venv/poetry issues
- Improves hermes agent setup reliability
- Add automatic PostgreSQL service start if not running
- Add graceful handling of existing configs when venv creation fails
- Check for existing configs in /etc/aitbc before failing on venv error
- Provide manual recovery instructions when venv creation fails
- Change pyproject.toml error to warning to allow setup to continue
- Improves hermes agent setup experience by handling partial failures
- Added postgresql and psql to command checks
- Added python3-venv package check (tests venv module availability)
- Added installation cases for PostgreSQL (postgresql, postgresql-contrib, postgresql-client)
- Added installation case for python3-venv
- Updated apt-get and yum package managers to include these dependencies
- Fixes fatal venv setup error when python3-venv is missing
- Ensures PostgreSQL is available for database setup
- Updated git clone URL from Gitea to GitHub
- Updated deploy_common.sh download URL to GitHub
- Ensures public repository access for new installations
- Aligns with documentation that references GitHub as primary repo
- Added step-by-step progress markers [STEP X/10] for each setup phase
- Added clear completion markers with ✓ for each step
- Added STARTED and COMPLETED banners for easy detection
- Helps hermes agents track setup progress and identify stuck steps
- Improves debugging when setup hangs or fails