Files
aitbc/LEGACY_CLEANUP_SUMMARY.md
aitbc 893ac594b0
All checks were successful
Integration Tests / test-service-integration (push) Successful in 49s
Documentation Validation / validate-docs (push) Successful in 15s
Security Scanning / security-scan (push) Successful in 1m15s
Python Tests / test-python (push) Successful in 1m18s
fix: correct transaction field mapping and standardize genesis path resolution in PoA consensus
🔧 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
2026-03-30 08:13:57 +02:00

2.0 KiB

Legacy Path Cleanup Summary

Legacy Path Issues Fixed

1. Genesis File Path Resolution

Before (Legacy):

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):

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!