refactor: migrate P2P network from Redis gossip to direct TCP mesh architecture
- Replaced Redis-based P2P with direct TCP connections for decentralized mesh networking - Added handshake protocol with node_id exchange for peer authentication - Implemented bidirectional connection management (inbound/outbound streams) - Added peer dialing loop to continuously reconnect to initial peers - Added ping/pong keepalive mechanism to maintain active connections - Prevented duplicate connections through endpoint
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[Unit]
|
||||
Description=AITBC Blockchain P2P Network Service
|
||||
After=network.target redis.service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
@@ -10,7 +10,7 @@ WorkingDirectory=/opt/aitbc/apps/blockchain-node
|
||||
Environment=PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin
|
||||
Environment=PYTHONPATH=/opt/aitbc/apps/blockchain-node/src:/opt/aitbc/apps/blockchain-node/scripts
|
||||
EnvironmentFile=/etc/aitbc/blockchain.env
|
||||
ExecStart=/opt/aitbc/venv/bin/python -m aitbc_chain.p2p_network --host ${p2p_bind_host} --port ${p2p_bind_port} --redis ${gossip_broadcast_url} --node-id ${proposer_id}
|
||||
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}
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
StandardOutput=journal
|
||||
|
||||
Reference in New Issue
Block a user