diff --git a/pubsub/rust/src/main.rs b/pubsub/rust/src/main.rs index ebba018..5cf097b 100644 --- a/pubsub/rust/src/main.rs +++ b/pubsub/rust/src/main.rs @@ -60,7 +60,6 @@ fn main() { fn on_floodsub(&mut self, message: as libp2p::core::swarm::NetworkBehaviour>::OutEvent) where TSubstream: libp2p::tokio_io::AsyncRead + libp2p::tokio_io::AsyncWrite { - dbg!(message.clone()); println!("{:?}: {}", &message.source,String::from_utf8_lossy(&message.data)); } } @@ -86,7 +85,8 @@ fn main() { 0u16 }; - libp2p::Swarm::listen_on(&mut swarm, multiaddr![Ip4([0, 0, 0, 0]), Tcp(port)]).unwrap(); + let address = libp2p::Swarm::listen_on(&mut swarm, multiaddr![Ip4([0, 0, 0, 0]), Tcp(port)]).unwrap(); + println!("Now listening on {:?}", address); // Read full lines from stdin println!("Type your message to send to remote hosts:"); @@ -99,6 +99,7 @@ fn main() { match framed_stdin.poll().expect("Error while polling stdin") { Async::Ready(Some(line)) => { let to_send = format!("{}", line); + println!("sending: {}", line); swarm.floodsub.publish(&floodsub_topic, to_send.as_bytes()) }, Async::Ready(None) => break, // Stdin closed