Skip to content

(kademlia) How can I republish what's provided by the closets peers? #5829

Answered by epappas
epappas asked this question in Q&A
Discussion options

You must be logged in to vote

Alright, I managed to spot and solve my issue. As expected, the matter was on the lack of republication. So to sort out my used case I just lower the interval of republications as follows:

let mut kademlia_config = KademliaConfig::default();
kademlia_config.set_provider_publication_interval(Some(Duration::from_secs(60)));

// at behaviour setup
kademlia: kad::Behaviour::with_config(
  peer_id,
  kad::store::MemoryStore::new(peer_id),
  kademlia_config,
)

Although this is working for my use case, I don't find it ideal. Is there any way to trigger a re-pull of kad DHT when a new node joins?

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jxs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant