feat: replace log with tracing

Signed-off-by: ljedrz <ljedrz@gmail.com>
This commit is contained in:
ljedrz 2020-07-29 14:29:09 +02:00
parent fca34088c3
commit a284c1f841
24 changed files with 160 additions and 73 deletions

105
Cargo.lock generated
View File

@ -121,6 +121,15 @@ dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "ansi_term"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "anyhow"
version = "1.0.31"
@ -348,11 +357,11 @@ dependencies = [
"futures 0.3.5",
"libp2p-core",
"libp2p-swarm",
"log 0.4.11",
"multihash",
"prost",
"prost-build",
"thiserror",
"tracing",
"unsigned-varint 0.3.3",
]
@ -607,7 +616,7 @@ version = "2.33.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129"
dependencies = [
"ansi_term",
"ansi_term 0.11.0",
"atty",
"bitflags",
"strsim",
@ -1527,13 +1536,11 @@ dependencies = [
"cid",
"dirs",
"domain",
"env_logger",
"futures 0.3.5",
"hex-literal",
"ipfs-unixfs",
"libipld",
"libp2p",
"log 0.4.11",
"multibase",
"multihash",
"prost",
@ -1544,6 +1551,9 @@ dependencies = [
"serde_json",
"sha2 0.9.1",
"thiserror",
"tracing",
"tracing-futures",
"tracing-subscriber",
"void",
]
@ -1556,7 +1566,6 @@ dependencies = [
"base64 0.12.3",
"bytes 0.5.6",
"cid",
"env_logger",
"futures 0.3.5",
"hex",
"hex-literal",
@ -1564,7 +1573,6 @@ dependencies = [
"hyper",
"ipfs",
"libipld",
"log 0.4.11",
"mime 0.3.16",
"mpart-async",
"multibase",
@ -1581,6 +1589,8 @@ dependencies = [
"tempfile",
"thiserror",
"tokio 0.2.22",
"tracing",
"tracing-subscriber",
"url",
"vergen",
"warp",
@ -2241,6 +2251,15 @@ dependencies = [
"hashbrown 0.6.3",
]
[[package]]
name = "matchers"
version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1"
dependencies = [
"regex-automata",
]
[[package]]
name = "matches"
version = "0.1.8"
@ -3126,6 +3145,16 @@ dependencies = [
"thread_local",
]
[[package]]
name = "regex-automata"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4"
dependencies = [
"byteorder 1.3.4",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.6.18"
@ -3391,6 +3420,15 @@ dependencies = [
"opaque-debug 0.2.3",
]
[[package]]
name = "sharded-slab"
version = "0.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06d5a3f5166fb5b42a5439f2eee8b9de149e235961e3eb21c5808fc3ea17ff3e"
dependencies = [
"lazy_static",
]
[[package]]
name = "shlex"
version = "0.1.1"
@ -3951,9 +3989,21 @@ checksum = "dbdf4ccd1652592b01286a5dbe1e2a77d78afaa34beadd9872a5f7396f92aaa9"
dependencies = [
"cfg-if",
"log 0.4.11",
"tracing-attributes",
"tracing-core",
]
[[package]]
name = "tracing-attributes"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0693bf8d6f2bf22c690fc61a9d21ac69efdbb894a17ed596b9af0f01e64b84b"
dependencies = [
"proc-macro2 1.0.19",
"quote 1.0.7",
"syn 1.0.35",
]
[[package]]
name = "tracing-core"
version = "0.1.11"
@ -3969,10 +4019,53 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab7bb6f14721aa00656086e9335d363c5c8747bae02ebe32ea2c7dece5689b4c"
dependencies = [
"futures 0.3.5",
"futures-task",
"pin-project",
"tracing",
]
[[package]]
name = "tracing-log"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e0f8c7178e13481ff6765bd169b33e8d554c5d2bbede5e32c356194be02b9b9"
dependencies = [
"lazy_static",
"log 0.4.11",
"tracing-core",
]
[[package]]
name = "tracing-serde"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6ccba2f8f16e0ed268fc765d9b7ff22e965e7185d32f8f1ec8294fe17d86e79"
dependencies = [
"serde",
"tracing-core",
]
[[package]]
name = "tracing-subscriber"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4f5dd7095c2481b7b3cbed71c8de53085fb3542bc3c2b4c73cba43e8f11c7ba"
dependencies = [
"ansi_term 0.12.1",
"chrono",
"lazy_static",
"matchers",
"regex",
"serde",
"serde_json",
"sharded-slab",
"smallvec 1.4.1",
"tracing-core",
"tracing-log",
"tracing-serde",
]
[[package]]
name = "try-lock"
version = "0.2.3"

View File

@ -22,7 +22,6 @@ domain = { git = "https://github.com/nlnetlabs/domain", rev="084964", features =
futures = { version = "0.3.5", features = ["compat", "io-compat"] }
libipld = { git = "https://github.com/ljedrz/rust-ipld", branch = "update_cid", features = ["dag-pb", "dag-json"] }
libp2p = "0.22"
log = "0.4"
multibase = "0.8.0"
multihash = "0.11"
prost = "0.6.1"
@ -31,6 +30,8 @@ rocksdb = { version = "0.13.0", optional = true }
serde = { version = "1.0.106", features = ["derive"] }
serde_json = "1.0.51"
thiserror = "1.0.14"
tracing = { version = "0.1", features = ["log"] }
tracing-futures = { version = "0.2", default-features = false, features = ["std", "futures-03"] }
void = "1.0.2"
ipfs-unixfs = { path = "unixfs" }
async-stream = "0.2.1"
@ -39,9 +40,9 @@ async-stream = "0.2.1"
prost-build = "0.6.1"
[dev-dependencies]
env_logger = "0.7.1"
sha2 = "0.9"
hex-literal = "0.3"
tracing-subscriber = { version = "0.2", features = ["fmt", "tracing-log"] }
[workspace]
members = [ "bitswap", "http", "unixfs" ]

View File

@ -83,7 +83,8 @@ use ipfs::{IpfsOptions, IpfsPath, Ipld, Types, UninitializedIpfs};
use libipld::ipld;
fn main() {
env_logger::init();
tracing_subscriber::fmt::init();
let options = IpfsOptions::<Types>::default();
task::block_on(async move {

View File

@ -16,8 +16,8 @@ futures = "0.3.4"
cid = "0.5"
libp2p-core = "0.20.0"
libp2p-swarm = "0.20.0"
log = "0.4.8"
multihash = "0.11"
prost = "0.6.1"
thiserror = "1.0.14"
tracing = { version = "0.1", features = ["log"] }
unsigned-varint = "0.3.2"

View File

@ -1,6 +1,6 @@
//! Bitswap protocol implementation
#[macro_use]
extern crate log;
extern crate tracing;
mod behaviour;
mod block;

View File

@ -4,7 +4,8 @@ use ipfs::{IpfsOptions, Types, UninitializedIpfs};
use libipld::ipld;
fn main() {
env_logger::init();
tracing_subscriber::fmt::init();
let options = IpfsOptions::<Types>::default();
task::block_on(async move {

View File

@ -4,7 +4,8 @@ use ipfs::{IpfsOptions, IpfsPath, TestTypes, UninitializedIpfs};
use std::str::FromStr;
fn main() {
env_logger::init();
tracing_subscriber::fmt::init();
let options = IpfsOptions::<TestTypes>::default();
let path =
IpfsPath::from_str("/ipfs/zdpuB1caPcm4QNXeegatVfLQ839Lmprd5zosXGwRUBJHwj66X").unwrap();

View File

@ -10,7 +10,8 @@ use std::env;
use std::process::exit;
fn main() {
env_logger::init();
tracing_subscriber::fmt::init();
let options = IpfsOptions::<TestTypes>::default();
// this example will wait forever attempting to fetch a CID provided at command line. It is

View File

@ -6,6 +6,8 @@ use libipld::cid::{Cid, Codec};
use multihash::Sha2_256;
fn main() {
tracing_subscriber::fmt::init();
let options = IpfsOptions::<TestTypes>::default();
// this example demonstrates

View File

@ -3,7 +3,8 @@ use ipfs::{IpfsOptions, IpfsPath, PeerId, TestTypes, UninitializedIpfs};
use std::str::FromStr;
fn main() {
env_logger::init();
tracing_subscriber::fmt::init();
let options = IpfsOptions::<TestTypes>::default();
task::block_on(async move {

View File

@ -13,11 +13,9 @@ vergen = "3.1.0"
async-std = { default-features = false, features = ["attributes"], version = "1.6" }
base64 = "0.12.0"
cid = "0.5"
env_logger = "0.7.1"
futures = "0.3.4"
ipfs = { path = "../" }
libipld = { git = "https://github.com/ljedrz/rust-ipld", branch = "update_cid", features = ["dag-pb", "dag-json"] }
log = "0.4.8"
multibase = "0.8.0"
multihash = "0.11"
# openssl is required for rsa keygen but not used by the rust-ipfs or its dependencies
@ -35,6 +33,8 @@ async-stream = "0.2.1"
pin-project = "0.4.8"
url = "2.1.1"
tar = { version = "0.4.28", default-features = false }
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = { version = "0.2", features = ["fmt", "tracing-log"] }
bytes = "0.5.4"
mpart-async = "0.4.1"
mime = "0.3.16"

View File

@ -1,6 +1,9 @@
// Required by the use of async_stream
#![recursion_limit = "512"]
#[macro_use]
extern crate tracing;
pub mod v0;
pub mod config;

View File

@ -31,7 +31,7 @@ fn main() {
);
}
env_logger::init();
tracing_subscriber::fmt::init();
let opts = Options::from_args();

View File

@ -212,7 +212,7 @@ async fn rm_query<T: IpfsTypes>(
Ok(string.into_bytes())
}
Err(e) => {
log::error!("edge serialization failed: {}", e);
error!("edge serialization failed: {}", e);
Err(HandledErr)
}
});

View File

@ -153,7 +153,7 @@ async fn inner_subscribe<T: IpfsTypes>(
Entry::Occupied(oe) => {
// the easiest case: just join in, even if there are no other subscribers at the
// moment
log::debug!("joining in existing subscription of {:?}", oe.key());
debug!("joining in existing subscription of {:?}", oe.key());
oe.get().subscribe()
}
Entry::Vacant(ve) => {
@ -204,7 +204,7 @@ async fn shovel<T: IpfsTypes>(
mut shoveled: ipfs::SubscriptionStream,
tx: broadcast::Sender<Result<PreformattedJsonMessage, StreamError>>,
) {
log::trace!(
trace!(
"started background task for shoveling messages of {:?}",
topic
);
@ -222,7 +222,7 @@ async fn shovel<T: IpfsTypes>(
Ok(None) => break,
Err(_) => {
if tx.receiver_count() == 0 {
log::debug!("timed out shoveling with zero receivers");
debug!("timed out shoveling with zero receivers");
break;
}
@ -252,7 +252,7 @@ async fn shovel<T: IpfsTypes>(
// and reusing the existing broadcast::channel. this will fail if
// we introduce other Ipfs::pubsub_subscribe using code which does
// not use the `Pubsub` thing.
log::debug!(
debug!(
"resubscribing with the existing broadcast channel to {:?}",
topic
);
@ -261,7 +261,7 @@ async fn shovel<T: IpfsTypes>(
.await
.expect("new subscriptions shouldn't fail while holding the lock");
} else {
log::trace!(
trace!(
"got a new subscriber to existing broadcast channel on {:?}",
topic
);
@ -271,7 +271,7 @@ async fn shovel<T: IpfsTypes>(
}
// really no more subscribers, unsubscribe and terminate the shoveling
// task for this stream.
log::debug!("unsubscribing from {:?}", topic);
debug!("unsubscribing from {:?}", topic);
oe.remove();
return;
} else {
@ -368,7 +368,7 @@ fn preformat(msg: impl AsRef<ipfs::PubsubMessage>) -> Result<PreformattedJsonMes
.map(Bytes::from)
.map(PreformattedJsonMessage::from)
.map_err(|e| {
log::error!("failed to serialize {:?}: {}", msg.as_ref(), e);
error!("failed to serialize {:?}: {}", msg.as_ref(), e);
StreamError::Serialization
})
}

View File

@ -43,7 +43,7 @@ async fn refs_inner<T: IpfsTypes>(
let formatter = EdgeFormatter::from_options(opts.edges, opts.format.as_deref())
.map_err(StringError::from)?;
log::trace!(
trace!(
"refs on {:?} to depth {:?} with formatter: {:?}",
opts.arg,
max_depth,
@ -67,7 +67,7 @@ async fn refs_inner<T: IpfsTypes>(
.await
.map_err(StringError::from)?
.map_err(|e| {
log::warn!("refs path on {:?} failed with {}", &opts.arg, e);
warn!("refs path on {:?} failed with {}", &opts.arg, e);
e
})
.map_err(StringError::from)?;
@ -96,7 +96,7 @@ async fn refs_inner<T: IpfsTypes>(
Ok(s.into_bytes())
}
Err(e) => {
log::error!("edge serialization failed: {}", e);
error!("edge serialization failed: {}", e);
Err(HandledErr)
}
}
@ -456,14 +456,14 @@ fn iplds_refs<T: IpfsTypes>(
};
if unique && !visited.insert(cid.clone()) {
log::trace!("skipping already visited {}", cid);
trace!("skipping already visited {}", cid);
continue;
}
let data = match ipfs.get_block(&cid).await {
Ok(Block { data, .. }) => data,
Err(e) => {
log::warn!("failed to load {}, linked from {}: {}", cid, source, e);
warn!("failed to load {}, linked from {}: {}", cid, source, e);
// TODO: yield error msg
// unsure in which cases this happens, because we'll start to search the content
// and stop only when request has been cancelled (FIXME: not yet, because dropping
@ -475,7 +475,7 @@ fn iplds_refs<T: IpfsTypes>(
let mut ipld = match decode_ipld(&cid, &data) {
Ok(ipld) => ipld,
Err(e) => {
log::warn!("failed to parse {}, linked from {}: {}", cid, source, e);
warn!("failed to parse {}, linked from {}: {}", cid, source, e);
// TODO: yield error msg
// go-ipfs on raw Qm hash:
// > failed to decode Protocol Buffers: incorrectly formatted merkledag node: unmarshal failed. proto: illegal wireType 6

View File

@ -1,5 +1,4 @@
use ipfs::{Ipfs, IpfsTypes};
use log::warn;
use serde::Serialize;
use std::borrow::Cow;
use std::convert::Infallible;

View File

@ -6,7 +6,7 @@
#![cfg_attr(feature = "nightly", doc(include = "../README.md"))]
#[macro_use]
extern crate log;
extern crate tracing;
use anyhow::{anyhow, format_err};
use async_std::path::PathBuf;
@ -705,7 +705,7 @@ impl<TRepoTypes: RepoTypes> IpfsFuture<TRepoTypes> {
.remove(&first)
.expect("just filtered this key out");
self.listening_addresses.insert(addr.clone(), (id, None));
log::trace!("guessing the first match for {} to be {}", first, addr);
trace!("guessing the first match for {} to be {}", first, addr);
maybe_sender
} else {
None

View File

@ -48,13 +48,13 @@ impl<Types: IpfsTypes> NetworkBehaviourEventProcess<MdnsEvent> for Behaviour<Typ
match event {
MdnsEvent::Discovered(list) => {
for (peer, addr) in list {
log::trace!("mdns: Discovered peer {}", peer.to_base58());
trace!("mdns: Discovered peer {}", peer.to_base58());
self.add_peer(peer, addr);
}
}
MdnsEvent::Expired(list) => {
for (peer, _) in list {
log::trace!("mdns: Expired peer {}", peer.to_base58());
trace!("mdns: Expired peer {}", peer.to_base58());
self.remove_peer(&peer);
}
}
@ -297,7 +297,7 @@ impl<Types: IpfsTypes> NetworkBehaviourEventProcess<PingEvent> for Behaviour<Typ
peer,
result: Result::Ok(PingSuccess::Ping { rtt }),
} => {
log::trace!(
trace!(
"ping: rtt to {} is {} ms",
peer.to_base58(),
rtt.as_millis()
@ -308,20 +308,20 @@ impl<Types: IpfsTypes> NetworkBehaviourEventProcess<PingEvent> for Behaviour<Typ
peer,
result: Result::Ok(PingSuccess::Pong),
} => {
log::trace!("ping: pong from {}", peer);
trace!("ping: pong from {}", peer);
}
PingEvent {
peer,
result: Result::Err(PingFailure::Timeout),
} => {
log::trace!("ping: timeout to {}", peer);
trace!("ping: timeout to {}", peer);
self.remove_peer(&peer);
}
PingEvent {
peer,
result: Result::Err(PingFailure::Other { error }),
} => {
log::error!("ping: failure with {}: {}", peer.to_base58(), error);
error!("ping: failure with {}: {}", peer.to_base58(), error);
}
}
}
@ -329,7 +329,7 @@ impl<Types: IpfsTypes> NetworkBehaviourEventProcess<PingEvent> for Behaviour<Typ
impl<Types: IpfsTypes> NetworkBehaviourEventProcess<IdentifyEvent> for Behaviour<Types> {
fn inject_event(&mut self, event: IdentifyEvent) {
log::trace!("identify: {:?}", event);
trace!("identify: {:?}", event);
}
}

View File

@ -326,7 +326,7 @@ impl NetworkBehaviour for Pubsub {
Poll::Ready(Some(dropped)) => {
let topic = Topic::new(dropped);
if self.streams.remove(&topic).is_some() {
log::debug!("unsubscribing via drop from {:?}", topic.id());
debug!("unsubscribing via drop from {:?}", topic.id());
assert!(
self.floodsub.unsubscribe(topic),
"Failed to unsubscribe a dropped subscription"
@ -356,7 +356,7 @@ impl NetworkBehaviour for Pubsub {
if let Err(se) = oe.get().unbounded_send(sent) {
// receiver has dropped
let (topic, _) = oe.remove_entry();
log::debug!("unsubscribing via SendError from {:?}", topic.id());
debug!("unsubscribing via SendError from {:?}", topic.id());
assert!(
self.floodsub.unsubscribe(topic),
"Failed to unsubscribe following SendError"
@ -382,7 +382,7 @@ impl NetworkBehaviour for Pubsub {
}
if appeared {
log::debug!("peer appeared as pubsub subscriber: {}", peer_id);
debug!("peer appeared as pubsub subscriber: {}", peer_id);
}
continue;
@ -397,7 +397,7 @@ impl NetworkBehaviour for Pubsub {
topics.swap_remove(pos);
}
if topics.is_empty() {
log::debug!("peer disappeared as pubsub subscriber: {}", peer_id);
debug!("peer disappeared as pubsub subscriber: {}", peer_id);
oe.remove();
}
}

View File

@ -88,7 +88,7 @@ impl SwarmApi {
}
pub fn connect(&mut self, address: Multiaddr) -> SubscriptionFuture<Result<(), String>> {
log::trace!("starting to connect to {}", address);
trace!("starting to connect to {}", address);
self.events.push_back(NetworkBehaviourAction::DialAddress {
address: address.clone(),
});
@ -97,7 +97,7 @@ impl SwarmApi {
}
pub fn disconnect(&mut self, address: Multiaddr) -> Option<Disconnector> {
log::trace!("disconnect {}", address);
trace!("disconnect {}", address);
// FIXME: closing a single specific connection would be allowed for ProtocolHandlers
let peer_id = self.connections.remove(&address);
@ -128,12 +128,12 @@ impl NetworkBehaviour for SwarmApi {
type OutEvent = void::Void;
fn new_handler(&mut self) -> Self::ProtocolsHandler {
log::trace!("new_handler");
trace!("new_handler");
Default::default()
}
fn addresses_of_peer(&mut self, peer_id: &PeerId) -> Vec<Multiaddr> {
log::trace!("addresses_of_peer {}", peer_id);
trace!("addresses_of_peer {}", peer_id);
self.connected_peers
.get(peer_id)
.cloned()
@ -147,7 +147,7 @@ impl NetworkBehaviour for SwarmApi {
cp: &ConnectedPoint,
) {
// TODO: could be that the connection is not yet fully established at this point
log::trace!("inject_connected {} {:?}", peer_id, cp);
trace!("inject_connected {} {:?}", peer_id, cp);
let addr = connection_point_addr(cp);
self.peers.insert(peer_id.clone());
let connections = self.connected_peers.entry(peer_id.clone()).or_default();
@ -169,7 +169,7 @@ impl NetworkBehaviour for SwarmApi {
_id: &ConnectionId,
cp: &ConnectedPoint,
) {
log::trace!("inject_connection_closed {} {:?}", peer_id, cp);
trace!("inject_connection_closed {} {:?}", peer_id, cp);
let closed_addr = connection_point_addr(cp);
let became_empty = if let Some(connections) = self.connected_peers.get_mut(peer_id) {
if let Some(index) = connections.iter().position(|addr| addr == closed_addr) {
@ -190,7 +190,7 @@ impl NetworkBehaviour for SwarmApi {
fn inject_disconnected(&mut self, peer_id: &PeerId) {
// in rust-libp2p 0.19 this at least will not be invoked for a peer we boot by banning it.
log::trace!("inject_disconnected: {}", peer_id);
trace!("inject_disconnected: {}", peer_id);
self.mark_disconnected(peer_id);
}
@ -202,7 +202,7 @@ impl NetworkBehaviour for SwarmApi {
addr: &Multiaddr,
error: &dyn std::error::Error,
) {
log::trace!("inject_addr_reach_failure {} {}", addr, error);
trace!("inject_addr_reach_failure {} {}", addr, error);
self.connect_registry
.finish_subscription(addr.clone().into(), Err(error.to_string()));
}
@ -240,8 +240,6 @@ mod tests {
#[async_std::test]
async fn swarm_api() {
env_logger::init();
let (peer1_id, trans) = mk_transport();
let mut swarm1 = Swarm::new(trans, SwarmApi::new(), peer1_id);

View File

@ -156,7 +156,7 @@ impl<TRes: Debug + Clone + PartialEq> SubscriptionRegistry<TRes> {
return;
}
log::debug!("Shutting down {:?}", self);
debug!("Shutting down {:?}", self);
let mut cancelled = 0;
let mut subscriptions = mem::take(&mut *task::block_on(async {
@ -170,7 +170,7 @@ impl<TRes: Debug + Clone + PartialEq> SubscriptionRegistry<TRes> {
}
}
log::debug!("Cancelled {} subscriptions", cancelled);
debug!("Cancelled {} subscriptions", cancelled);
}
}

View File

@ -6,7 +6,7 @@ use std::time::Duration;
#[async_std::test]
async fn exchange_block() {
env_logger::init();
tracing_subscriber::fmt::init();
let data = b"hello block\n".to_vec().into_boxed_slice();
let cid = Cid::new_v1(Codec::Raw, Sha2_256::digest(&data));

View File

@ -2,23 +2,12 @@ use async_std::future::timeout;
use cid::Cid;
use ipfs::{IpfsOptions, Node};
use libp2p::{Multiaddr, PeerId};
use log::{LevelFilter, SetLoggerError};
use std::time::Duration;
fn init_test_logging() -> Result<(), SetLoggerError> {
env_logger::builder()
.is_test(true)
.filter(Some("async_std"), LevelFilter::Error)
.try_init()
}
#[async_std::test]
async fn kademlia_local_peer_discovery() {
const BOOTSTRAPPER_COUNT: usize = 20;
// set up logging
let _ = init_test_logging();
// start up PEER_COUNT bootstrapper nodes
let mut bootstrappers = Vec::with_capacity(BOOTSTRAPPER_COUNT);
for _ in 0..BOOTSTRAPPER_COUNT {
@ -66,9 +55,6 @@ async fn kademlia_local_peer_discovery() {
#[async_std::test]
async fn kademlia_popular_content_discovery() {
// set up logging
let _ = init_test_logging();
let (bootstrapper_id, bootstrapper_addr): (PeerId, Multiaddr) = (
"QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
.parse()