Merge branch 'dandelion'

master
rairyx 5 years ago
commit 0b7301aa32

@ -1,4 +1,4 @@
SRC = pubsub-interop.go SRC = raven.go
BIN = $(SRC:.go=) BIN = $(SRC:.go=)
DHT_SERVER = libp2p-bootstrap.goelzer.io DHT_SERVER = libp2p-bootstrap.goelzer.io

@ -62,6 +62,7 @@ waterfall([
fsub.on(topicName, (data) => { fsub.on(topicName, (data) => {
const messageStr = data.data const messageStr = data.data
console.log("received:" + messageStr) console.log("received:" + messageStr)
// console.log("<peer " + peerIdTruncdStr + ">: " + messageStr)
}) })
fsub.subscribe(topicName) fsub.subscribe(topicName)

@ -60,7 +60,8 @@ fn main() {
fn on_floodsub<TTopology>(&mut self, message: <libp2p::floodsub::Floodsub<TSubstream> as libp2p::core::swarm::NetworkBehaviour<TTopology>>::OutEvent) fn on_floodsub<TTopology>(&mut self, message: <libp2p::floodsub::Floodsub<TSubstream> as libp2p::core::swarm::NetworkBehaviour<TTopology>>::OutEvent)
where TSubstream: libp2p::tokio_io::AsyncRead + libp2p::tokio_io::AsyncWrite where TSubstream: libp2p::tokio_io::AsyncRead + libp2p::tokio_io::AsyncWrite
{ {
println!("{:?}: {}", &message.source,String::from_utf8_lossy(&message.data)); //println!("{:?}: {}", &message.source,String::from_utf8_lossy(&message.data));
println!("Received: {}", String::from_utf8_lossy(&message.data));
} }
} }

Binary file not shown.
Loading…
Cancel
Save