All checks were successful
🔧 Transaction Field Mapping: • Change sender field from "sender" to "from" in transaction parsing • Change recipient field from nested "payload.to" to direct "to" • Change value field from nested "payload.amount" to direct "amount" • Align transaction structure with RPC endpoint format 📁 Genesis File Path Resolution: • Use standardized /var/lib/aitbc/data/{chain_id}/genesis.json path • Remove
62 lines
2.0 KiB
Markdown
62 lines
2.0 KiB
Markdown
# Legacy Path Cleanup Summary
|
|
|
|
## ✅ Legacy Path Issues Fixed
|
|
|
|
### 1. Genesis File Path Resolution
|
|
**Before (Legacy):**
|
|
```python
|
|
genesis_paths = [
|
|
Path(f"/opt/aitbc/apps/blockchain-node/data/{self._config.chain_id}/genesis.json"), # Hardcoded
|
|
Path(f"./data/{self._config.chain_id}/genesis.json"), # Relative path
|
|
Path(f"/var/lib/aitbc/data/{self._config.chain_id}/genesis.json"), # Mixed
|
|
]
|
|
```
|
|
|
|
**After (Clean):**
|
|
```python
|
|
genesis_paths = [
|
|
Path(f"/var/lib/aitbc/data/{self._config.chain_id}/genesis.json"), # Standard location only
|
|
]
|
|
```
|
|
|
|
### 2. File System Cleanup
|
|
- ✅ Removed duplicate genesis file: `/opt/aitbc/apps/blockchain-node/data/ait-mainnet/genesis.json`
|
|
- ✅ Single source of truth: `/var/lib/aitbc/data/ait-mainnet/genesis.json`
|
|
- ✅ Uses standardized directory structure from configuration
|
|
|
|
### 3. Debug Logging Cleanup
|
|
- ✅ Removed temporary debug logging added during troubleshooting
|
|
- ✅ Clean, production-ready logging restored
|
|
|
|
## 🎯 Benefits Achieved
|
|
|
|
- **🗂️ Consistent Paths**: Uses standardized `/var/lib/aitbc/data/` structure
|
|
- **🔧 Maintainable**: Single location for genesis file
|
|
- **📱 Configuration-Driven**: Follows established directory standards
|
|
- **🚀 Production Ready**: Clean code without legacy workarounds
|
|
- **🛡️ Reliable**: No more path resolution ambiguity
|
|
|
|
## 📁 Current Directory Structure
|
|
|
|
```
|
|
/var/lib/aitbc/
|
|
├── data/
|
|
│ └── ait-mainnet/
|
|
│ ├── chain.db # Blockchain database
|
|
│ └── genesis.json # ✅ Single genesis file
|
|
├── keystore/
|
|
│ ├── aitbc1genesis.json # Genesis wallet
|
|
│ └── .password # Wallet passwords
|
|
└── logs/ # Service logs
|
|
```
|
|
|
|
## 🔍 Verification
|
|
|
|
- ✅ Genesis account initialization working
|
|
- ✅ Transaction processing functional
|
|
- ✅ No hardcoded paths remaining
|
|
- ✅ Uses configuration-driven paths
|
|
- ✅ Clean, maintainable codebase
|
|
|
|
The PoA proposer now uses clean, standardized paths without any legacy workarounds!
|