refactor: consolidate blockchain explorer into single app and update backup ignore patterns
- Remove standalone explorer-web app (README, HTML, package files) - Add /web endpoint to blockchain-explorer for web interface access - Update .gitignore to exclude application backup archives (*.tar.gz, *.zip) - Add backup documentation files to .gitignore (BACKUP_INDEX.md, README.md) - Consolidate explorer functionality into main blockchain-explorer application
This commit is contained in:
71
cli/cleanup/CLI_CLEANUP_PLAN.md
Normal file
71
cli/cleanup/CLI_CLEANUP_PLAN.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# CLI Directory Cleanup Plan
|
||||
|
||||
## Current Issues Identified
|
||||
|
||||
### **Files in Root Directory (Should be Organized)**
|
||||
- `client.py` - Client functionality (should be in examples or scripts)
|
||||
- `client_enhanced.py` - Enhanced client (should be in examples or scripts)
|
||||
- `gpu_test.py` - GPU testing (should be in tests/)
|
||||
- `miner_gpu_test.py` - GPU miner testing (should be in tests/)
|
||||
- `miner.py` - Miner functionality (should be in examples or scripts)
|
||||
- `test_exchange_e2e.py` - E2E test (should be in tests/)
|
||||
- `test_gpu_access.py` - GPU access test (should be in tests/)
|
||||
- `test_gpu_marketplace_bids.py` - GPU marketplace test (should be in tests/)
|
||||
- `test_ollama_blockchain.py` - Ollama blockchain test (should be in tests/)
|
||||
- `test_ollama_gpu_provider.py` - Ollama GPU provider test (should be in tests/)
|
||||
- `test_workflow.py` - Workflow test (should be in tests/)
|
||||
- `wallet.py` - Wallet functionality (should be in examples or scripts)
|
||||
|
||||
### **Cleanup Strategy**
|
||||
|
||||
#### **1. Create Proper Directory Structure**
|
||||
```
|
||||
cli/
|
||||
├── aitbc_cli/ # Main CLI package (keep as is)
|
||||
├── examples/ # Example scripts and standalone tools
|
||||
│ ├── client.py
|
||||
│ ├── client_enhanced.py
|
||||
│ ├── miner.py
|
||||
│ └── wallet.py
|
||||
├── tests/ # Test files
|
||||
│ ├── gpu/
|
||||
│ │ ├── gpu_test.py
|
||||
│ │ ├── miner_gpu_test.py
|
||||
│ │ ├── test_gpu_access.py
|
||||
│ │ └── test_gpu_marketplace_bids.py
|
||||
│ ├── integration/
|
||||
│ │ ├── test_exchange_e2e.py
|
||||
│ │ └── test_workflow.py
|
||||
│ └── ollama/
|
||||
│ ├── test_ollama_blockchain.py
|
||||
│ └── test_ollama_gpu_provider.py
|
||||
├── scripts/ # Utility scripts
|
||||
├── docs/ # Documentation
|
||||
├── man/ # Man pages (keep as is)
|
||||
├── README.md # Documentation (keep as is)
|
||||
├── requirements.txt # Dependencies (keep as is)
|
||||
├── setup.py # Setup script (keep as is)
|
||||
└── aitbc_shell_completion.sh # Shell completion (keep as is)
|
||||
```
|
||||
|
||||
#### **2. File Categories**
|
||||
- **Examples**: Standalone scripts demonstrating CLI usage
|
||||
- **Tests**: All test files organized by type
|
||||
- **Scripts**: Utility scripts
|
||||
- **Documentation**: Documentation files
|
||||
- **Core**: Main CLI package (aitbc_cli/)
|
||||
|
||||
#### **3. Benefits of Cleanup**
|
||||
- Better organization and maintainability
|
||||
- Clear separation of concerns
|
||||
- Easier to find specific functionality
|
||||
- Professional project structure
|
||||
- Easier testing and development
|
||||
|
||||
## Execution Steps
|
||||
|
||||
1. Create new directory structure
|
||||
2. Move files to appropriate directories
|
||||
3. Update any imports if needed
|
||||
4. Update documentation
|
||||
5. Verify everything works
|
||||
138
cli/cleanup/CLI_CLEANUP_SUMMARY.md
Normal file
138
cli/cleanup/CLI_CLEANUP_SUMMARY.md
Normal file
@@ -0,0 +1,138 @@
|
||||
# CLI Directory Cleanup Summary
|
||||
|
||||
## ✅ **Cleanup Completed Successfully**
|
||||
|
||||
### **Files Organized**
|
||||
|
||||
#### **Root Directory Cleanup**
|
||||
- **Moved to examples/**: 4 files
|
||||
- `client.py` - Client functionality example
|
||||
- `client_enhanced.py` - Enhanced client example
|
||||
- `miner.py` - Miner functionality example
|
||||
- `wallet.py` - Wallet functionality example
|
||||
|
||||
- **Moved to tests/gpu/**: 4 files
|
||||
- `gpu_test.py` - GPU testing
|
||||
- `miner_gpu_test.py` - GPU miner testing
|
||||
- `test_gpu_access.py` - GPU access test
|
||||
- `test_gpu_marketplace_bids.py` - GPU marketplace test
|
||||
|
||||
- **Moved to tests/integration/**: 2 files
|
||||
- `test_exchange_e2e.py` - Exchange E2E test
|
||||
- `test_workflow.py` - Workflow test
|
||||
|
||||
- **Moved to tests/ollama/**: 2 files
|
||||
- `test_ollama_blockchain.py` - Ollama blockchain test
|
||||
- `test_ollama_gpu_provider.py` - Ollama GPU provider test
|
||||
|
||||
#### **New Directory Structure Created**
|
||||
```
|
||||
cli/
|
||||
├── aitbc_cli/ # Main CLI package (unchanged)
|
||||
├── examples/ # Example scripts (NEW)
|
||||
│ ├── client.py
|
||||
│ ├── client_enhanced.py
|
||||
│ ├── miner.py
|
||||
│ └── wallet.py
|
||||
├── tests/ # Test files (NEW)
|
||||
│ ├── gpu/ # GPU-related tests
|
||||
│ ├── integration/ # Integration tests
|
||||
│ └── ollama/ # Ollama-specific tests
|
||||
├── scripts/ # Utility scripts (NEW, empty)
|
||||
├── docs/ # Documentation (NEW, empty)
|
||||
├── man/ # Man pages (unchanged)
|
||||
├── README.md # Documentation (unchanged)
|
||||
├── requirements.txt # Dependencies (unchanged)
|
||||
├── setup.py # Setup script (unchanged)
|
||||
└── aitbc_shell_completion.sh # Shell completion (unchanged)
|
||||
```
|
||||
|
||||
## 🔍 **Existing CLI Tools Analysis**
|
||||
|
||||
### **Current CLI Commands (19 Command Groups)**
|
||||
1. **client** - Submit and manage jobs
|
||||
2. **miner** - Mining operations
|
||||
3. **wallet** - Wallet management
|
||||
4. **auth** - Authentication and API keys
|
||||
5. **blockchain** - Blockchain queries
|
||||
6. **marketplace** - GPU marketplace operations
|
||||
7. **simulate** - Simulation environment
|
||||
8. **admin** - System administration
|
||||
9. **config** - Configuration management
|
||||
10. **monitor** - System monitoring
|
||||
11. **governance** - Governance operations
|
||||
12. **exchange** - Exchange operations
|
||||
13. **agent** - Agent operations
|
||||
14. **multimodal** - Multimodal AI operations
|
||||
15. **optimize** - Optimization operations
|
||||
16. **openclaw** - OpenClaw operations
|
||||
17. **advanced** - Advanced marketplace operations
|
||||
18. **swarm** - Swarm operations
|
||||
19. **plugin** - Plugin management
|
||||
|
||||
### **Technology Stack**
|
||||
- **Framework**: Click (already in use)
|
||||
- **HTTP Client**: httpx
|
||||
- **Data Validation**: pydantic
|
||||
- **Output Formatting**: rich, tabulate
|
||||
- **Configuration**: pyyaml, python-dotenv
|
||||
- **Security**: cryptography, keyring
|
||||
- **Shell Completion**: click-completion
|
||||
|
||||
### **Key Features Already Available**
|
||||
- ✅ Rich output formatting (table, JSON, YAML)
|
||||
- ✅ Global options (--url, --api-key, --output, --verbose)
|
||||
- ✅ Configuration management with profiles
|
||||
- ✅ Authentication and API key management
|
||||
- ✅ Plugin system for extensibility
|
||||
- ✅ Shell completion support
|
||||
- ✅ Comprehensive error handling
|
||||
- ✅ Logging system
|
||||
|
||||
## 🎯 **Multi-Chain Integration Strategy**
|
||||
|
||||
### **Recommended Approach**
|
||||
1. **Add New Command Groups**: `chain` and `genesis`
|
||||
2. **Reuse Existing Infrastructure**: Use existing utils, config, and output formatting
|
||||
3. **Maintain Compatibility**: All existing commands remain unchanged
|
||||
4. **Follow Existing Patterns**: Use same command structure and conventions
|
||||
|
||||
### **Integration Points**
|
||||
- **Main CLI**: Add new commands to `aitbc_cli/main.py`
|
||||
- **Configuration**: Extend existing config system
|
||||
- **Output Formatting**: Use existing `utils.output` function
|
||||
- **Error Handling**: Use existing `utils.error` function
|
||||
- **Authentication**: Use existing auth system
|
||||
|
||||
### **Next Steps**
|
||||
1. Create `aitbc_cli/commands/chain.py` with multi-chain commands
|
||||
2. Create `aitbc_cli/commands/genesis.py` with genesis commands
|
||||
3. Create `aitbc_cli/core/` for multi-chain business logic
|
||||
4. Create `aitbc_cli/models/` for data models
|
||||
5. Add new dependencies to requirements.txt
|
||||
6. Update main.py to include new commands
|
||||
7. Create genesis templates in `templates/genesis/`
|
||||
|
||||
## 📊 **Cleanup Benefits**
|
||||
|
||||
### **Organization Benefits**
|
||||
- ✅ **Clean Root Directory**: Only essential files at root level
|
||||
- ✅ **Logical Grouping**: Related files grouped by purpose
|
||||
- ✅ **Easy Navigation**: Clear directory structure
|
||||
- ✅ **Professional Structure**: Industry-standard project organization
|
||||
- ✅ **Maintainability**: Easier to find and modify specific functionality
|
||||
|
||||
### **Development Benefits**
|
||||
- ✅ **Clear Separation**: Examples separate from core CLI
|
||||
- ✅ **Test Organization**: Tests organized by type and functionality
|
||||
- ✅ **Future Expansion**: Ready for multi-chain implementation
|
||||
- ✅ **Documentation**: Proper place for additional docs
|
||||
- ✅ **Scripts**: Utility scripts have dedicated location
|
||||
|
||||
---
|
||||
|
||||
**Status**: ✅ **CLI CLEANUP COMPLETED**
|
||||
**Files Moved**: 12 files organized into appropriate directories
|
||||
**New Directories**: 4 new directories created
|
||||
**CLI Commands**: 19 existing command groups identified
|
||||
**Integration Ready**: Clean foundation for multi-chain implementation
|
||||
Reference in New Issue
Block a user