Skip to content

Commit

Permalink
feat(p2p): improve default configurations for dht and bs
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Jun 1, 2022
1 parent 4732a76 commit 791181a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion iroh-bitswap/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Default for Config {
Self {
dial_concurrency_factor_providers: 32.try_into().unwrap(),
dial_concurrency_factor_peer: 32.try_into().unwrap(),
dial_timeout: Duration::from_secs(1),
dial_timeout: Duration::from_secs(4),
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion iroh-p2p/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,14 @@ impl NodeBehaviour {

let kad = if config.kademlia {
let local_peer_id = local_key.public().to_peer_id();
// TODO: persist to store
let store = MemoryStore::new(local_peer_id.to_owned());
let kad_config = KademliaConfig::default();
// TODO: make user configurable
let mut kad_config = KademliaConfig::default();
kad_config.set_parallelism(16usize.try_into().unwrap());
// TODO: potentially lower (this is per query)
kad_config.set_query_timeout(Duration::from_secs(5));

let mut kademlia = Kademlia::with_config(local_peer_id, store, kad_config);
for multiaddr in &config.bootstrap_peers {
// TODO: move parsing into config
Expand Down

0 comments on commit 791181a

Please sign in to comment.