feat(consensus): implement transaction processing in PoA block proposer

- Process transactions from mempool during block proposal
- Update sender and recipient account balances
- Create transaction records with confirmed status
- Include transaction hashes in block hash computation
- Update tx_count in blocks based on processed transactions
- Add balance validation and nonce management
- Handle transaction failures gracefully with logging
- Fix get_balance endpoint to use chain_id helper
- Update
This commit is contained in:
2026-03-19 13:25:29 +01:00
parent e791aa13da
commit f2849ee4a9
4 changed files with 84 additions and 16 deletions

View File

@@ -128,8 +128,8 @@ def main() -> None:
if args.db_path:
os.environ["DB_PATH"] = str(args.db_path)
from aitbc_chain.config import Settings
settings = Settings()
from aitbc_chain.config import ChainSettings
settings = ChainSettings()
print(f"[*] Initializing database at {settings.db_path}")
init_db()