Files
aitbc/docs/blockchain/P2P_MESH_UPDATE.md
aitbc 19d415a235
Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Failing after 3s
CLI Tests / test-cli (push) Failing after 3s
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Successful in 2s
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Successful in 3s
Cross-Chain Functionality Tests / test-cross-chain-bridge (push) Has been skipped
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Successful in 2s
Cross-Chain Functionality Tests / aggregate-results (push) Has been skipped
Deploy to Testnet / deploy-testnet (push) Successful in 1m12s
Documentation Validation / validate-docs (push) Failing after 8s
Documentation Validation / validate-policies-strict (push) Successful in 3s
Integration Tests / test-service-integration (push) Successful in 2m6s
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Successful in 2s
Multi-Node Blockchain Health Monitoring / health-check (push) Failing after 4s
P2P Network Verification / p2p-verification (push) Successful in 4s
Package Tests / Python package - aitbc-agent-sdk (push) Successful in 32s
Package Tests / Python package - aitbc-core (push) Successful in 14s
Package Tests / Python package - aitbc-crypto (push) Successful in 12s
Package Tests / Python package - aitbc-sdk (push) Successful in 9s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 8s
Package Tests / JavaScript package - aitbc-token (push) Successful in 17s
Python Tests / test-python (push) Successful in 15s
Security Scanning / security-scan (push) Successful in 27s
Node Failover Simulation / failover-test (push) Successful in 7s
Multi-Node Stress Testing / stress-test (push) Successful in 6s
Cross-Node Transaction Testing / transaction-test (push) Successful in 4s
feat: add SQLCipher database encryption support and consolidate agent documentation
- Add SQLCipher encryption for ait-mainnet database with configurable flag
- Add db_encryption_enabled and db_encryption_key_path config settings
- Implement encryption key loading and PRAGMA key setup via connection events
- Add shutdown_db function for proper database cleanup
- Export middleware classes in aitbc/__init__.py
- Fix import path in sync.py for settings
- Remove duplicate agent documentation from docs
2026-05-03 12:00:38 +02:00

1.7 KiB

Direct TCP P2P Mesh Network Update

The AITBC blockchain network has been upgraded from a Redis-backed PubSub gossip model to a Direct TCP P2P Mesh Network running on port 7070.

Architecture Changes

  • The P2PNetworkService (p2p_network.py) now directly binds to port 7070 via asyncio.start_server.
  • The gossip_backend variable is now strictly set to memory since external block/transaction propagation is handled via P2P TCP streams rather than a centralized Redis bus.
  • Nodes identify themselves securely via a JSON handshake ({'type': 'handshake', 'node_id': '...'}).

Configuration Flags

The /etc/aitbc/blockchain.env configuration now requires explicit peer targeting instead of Redis connection strings:

# Removed:
# gossip_backend=broadcast
# gossip_broadcast_url=redis://localhost:6379

# Updated/Added:
gossip_backend=memory
p2p_bind_host=0.0.0.0
p2p_bind_port=7070
p2p_peers=aitbc1:7070,aitbc2:7070 # Comma-separated list of known nodes

Systemd Service

The systemd service (/etc/systemd/system/aitbc-blockchain-p2p.service) has been updated to reflect the new CLI arguments:

ExecStart=/opt/aitbc/venv/bin/python -m aitbc_chain.p2p_network \
  --host ${p2p_bind_host} \
  --port ${p2p_bind_port} \
  --peers ${p2p_peers} \
  --node-id ${proposer_id}

Troubleshooting

If a node is failing to sync, verify that TCP port 7070 is open between the nodes (ufw allow 7070/tcp), and check the mesh connectivity status using the journal logs:

journalctl -u aitbc-blockchain-p2p -n 50 --no-pager

You should see output similar to Successfully dialed outbound peer at aitbc1:7070 or Handshake accepted from node...