libp2p-next (#3076)

* Changes for the next libp2p release:

  * Updates to the Kademlia APIs.
  * Updated imports due to the extracted libp2p-swarm crate.
  * ...

Still pending at least the following:

  * rust-libp2p/#1189
  * rust-libp2p/#1191
  * rust-libp2p/#1194

* Use Quorum::One.

The previous choice was apparently arbitrary.

* Use libp2p-0.11 from crates.io. Address feedback.

* Correct imports after merge.
This commit is contained in:
Roman Borschel
2019-07-24 17:32:25 +02:00
committed by Pierre Krieger
parent 5d58d583e3
commit 343f4a2a50
14 changed files with 264 additions and 202 deletions
+3 -2
View File
@@ -32,8 +32,9 @@ use consensus::import_queue::{ImportQueue, Link};
use consensus::import_queue::{BlockImportResult, BlockImportError};
use futures::{prelude::*, sync::mpsc};
use log::{warn, error, info};
use libp2p::core::{swarm::NetworkBehaviour, transport::boxed::Boxed, muxing::StreamMuxerBox};
use libp2p::{PeerId, Multiaddr, multihash::Multihash};
use libp2p::core::{transport::boxed::Boxed, muxing::StreamMuxerBox};
use libp2p::swarm::NetworkBehaviour;
use parking_lot::Mutex;
use peerset::PeersetHandle;
use runtime_primitives::{traits::{Block as BlockT, NumberFor}, ConsensusEngineId};
@@ -675,7 +676,7 @@ impl<B: BlockT + 'static, S: NetworkSpecialization<B>, H: ExHashT> Future for Ne
}
/// The libp2p swarm, customized for our needs.
type Swarm<B, S, H> = libp2p::core::Swarm<
type Swarm<B, S, H> = libp2p::swarm::Swarm<
Boxed<(PeerId, StreamMuxerBox), io::Error>,
Behaviour<B, S, H>
>;