Merge pull request #45 from Actyx/acytx/dependency-upgrade
Use rust-libp2p master from 2020-02-05
This commit is contained in:
commit
1e895cc7af
648
Cargo.lock
generated
648
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -17,7 +17,7 @@ env_logger = "*"
|
||||
failure = "*"
|
||||
fnv = "*"
|
||||
futures = { version = "0.3", features = [ "compat", "io-compat", "async-await" ] }
|
||||
libp2p = "0.14.0-alpha.1"
|
||||
libp2p = { git = "https://github.com/libp2p/rust-libp2p", rev = "f2d70913765015afb26c8a934fdda6d1a50a2755" }
|
||||
log = "*"
|
||||
multibase = "*"
|
||||
multihash = "*"
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
use crate::bitswap::ledger::{Message, I, O};
|
||||
use crate::error::Error;
|
||||
use libp2p::core::{InboundUpgrade, OutboundUpgrade, UpgradeInfo, upgrade::{self, Negotiated}};
|
||||
use libp2p::core::{InboundUpgrade, OutboundUpgrade, UpgradeInfo, upgrade};
|
||||
use protobuf::ProtobufError;
|
||||
use std::{io, iter};
|
||||
use futures::future::Future;
|
||||
@ -39,7 +39,7 @@ where TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static,
|
||||
type Future = Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send>>;
|
||||
|
||||
#[inline]
|
||||
fn upgrade_inbound(self, mut socket: Negotiated<TSocket>, info: Self::Info) -> Self::Future {
|
||||
fn upgrade_inbound(self, mut socket: TSocket, info: Self::Info) -> Self::Future {
|
||||
Box::pin(async move {
|
||||
debug!("upgrade_inbound: {}", std::str::from_utf8(info).unwrap());
|
||||
let packet = upgrade::read_one(&mut socket, MAX_BUF_SIZE).await?;
|
||||
@ -108,7 +108,7 @@ impl<TSocket> OutboundUpgrade<TSocket> for Message<O>
|
||||
type Future = Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send>>;
|
||||
|
||||
#[inline]
|
||||
fn upgrade_outbound(self, mut socket: Negotiated<TSocket>, info: Self::Info) -> Self::Future {
|
||||
fn upgrade_outbound(self, mut socket: TSocket, info: Self::Info) -> Self::Future {
|
||||
Box::pin(async move {
|
||||
debug!("upgrade_outbound: {}", std::str::from_utf8(info).unwrap());
|
||||
let bytes = self.to_bytes();
|
||||
|
@ -150,7 +150,7 @@ impl<TSubstream: AsyncRead + AsyncWrite, TSwarmTypes: SwarmTypes> Behaviour<TSub
|
||||
pub async fn new(options: SwarmOptions<TSwarmTypes>, repo: Repo<TSwarmTypes>) -> Self {
|
||||
info!("Local peer id: {}", options.peer_id.to_base58());
|
||||
|
||||
let mdns = Mdns::new().await.expect("Failed to create mDNS service");
|
||||
let mdns = Mdns::new().expect("Failed to create mDNS service");
|
||||
|
||||
let store = libp2p::kad::record::store::MemoryStore::new(options.peer_id.to_owned());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user