From 05f51f8a1c5ef49b283bf9be15370d791e302b72 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 16 May 2023 16:22:30 +0300 Subject: [PATCH] fix(libp2p): added back keep alive --- particle-node/src/behaviour/network.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/particle-node/src/behaviour/network.rs b/particle-node/src/behaviour/network.rs index 2beb3937ce..b3253ef0c0 100644 --- a/particle-node/src/behaviour/network.rs +++ b/particle-node/src/behaviour/network.rs @@ -19,6 +19,7 @@ use libp2p::{ ping::{Behaviour as Ping, Config as PingConfig}, swarm::NetworkBehaviour, }; +use libp2p::swarm::keep_alive::Behaviour as KeepAlive; use tokio::sync::mpsc; use connection_pool::ConnectionPoolBehaviour; @@ -31,6 +32,7 @@ use crate::connectivity::Connectivity; /// Coordinates protocols, so they can cooperate #[derive(NetworkBehaviour)] pub struct FluenceNetworkBehaviour { + keep_alive: KeepAlive, identify: Identify, ping: Ping, pub(crate) connection_pool: ConnectionPoolBehaviour, @@ -59,7 +61,10 @@ impl FluenceNetworkBehaviour { cfg.connection_pool_metrics, ); + let keep_alive = KeepAlive::default(); + let this = Self { + keep_alive, kademlia, connection_pool, identify,