diff --git a/examples/chat-tokio.rs b/examples/chat-tokio.rs index 2d644b0f360..e2f88201fb8 100644 --- a/examples/chat-tokio.rs +++ b/examples/chat-tokio.rs @@ -92,10 +92,13 @@ async fn main() -> Result<(), Box> { // Create a Swarm to manage peers and events. let mdns_behaviour = mdns::Behaviour::new(Default::default(), peer_id)?; - let behaviour = MyBehaviour { + let mut behaviour = MyBehaviour { floodsub: Floodsub::new(peer_id), mdns: mdns_behaviour, }; + + behaviour.floodsub.subscribe(floodsub_topic.clone()); + let mut swarm = libp2p_swarm::Swarm::with_tokio_executor(transport, behaviour, peer_id); // Reach out to another node if specified