Add network routes to API

This commit is contained in:
Paul Hauner
2019-08-14 18:23:26 +10:00
parent f2dedfac50
commit c93d2baa91
11 changed files with 134 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ use futures::prelude::*;
use libp2p::{
core::identity::Keypair,
discv5::Discv5Event,
enr::Enr,
gossipsub::{Gossipsub, GossipsubEvent},
identify::{Identify, IdentifyEvent},
ping::{Ping, PingConfig, PingEvent},
@@ -78,6 +79,10 @@ impl<TSubstream: AsyncRead + AsyncWrite> Behaviour<TSubstream> {
log: behaviour_log,
})
}
pub fn discovery(&self) -> &Discovery<TSubstream> {
&self.discovery
}
}
// Implement the NetworkBehaviourEventProcess trait so that we can derive NetworkBehaviour for Behaviour