Deleted aitbc/queue.py containing TaskQueue, JobScheduler, BackgroundTaskManager, and WorkerPool classes that were not being used in the codebase.
Refactored chain_id handling in CLI to use centralized get_chain_id utility function instead of duplicating chain_id detection logic in send_transaction, get_balance, and agent_operations functions.
- Add DataLayer, MockDataGenerator, RealDataFetcher, and get_data_layer to aitbc package exports
- Migrate blockchain-explorer/main.py to use aitbc.get_data_layer for mock/real data toggle
- Add data layer integration to search_transactions, search_blocks, and analytics_overview endpoints
- Migrate CLI blockchain commands to use chain registry instead of hardcoded chain list
- Replace hardcoded ['ait-devnet', 'ait-testnet'] with get
BEFORE:
/opt/aitbc/cli/
├── aitbc_cli/ # Python package (box in a box)
│ ├── commands/
│ ├── main.py
│ └── ...
├── setup.py
AFTER:
/opt/aitbc/cli/ # Flat structure
├── commands/ # Direct access
├── main.py # Direct access
├── auth/
├── config/
├── core/
├── models/
├── utils/
├── plugins.py
└── setup.py
CHANGES MADE:
- Moved all files from aitbc_cli/ to cli/ root
- Fixed all relative imports (from . to absolute imports)
- Updated setup.py entry point: aitbc_cli.main → main
- Added CLI directory to Python path in entry script
- Simplified deployment.py to remove dependency on deleted core.deployment
- Fixed import paths in all command files
- Recreated virtual environment with new structure
BENEFITS:
- Eliminated 'box in a box' nesting
- Simpler directory structure
- Direct access to all modules
- Cleaner imports
- Easier maintenance and development
- CLI works with both 'python main.py' and 'aitbc' commands