-
Tl;DR; I need to find a way in kademlia for new nodes to be able to see what's already provided. I have the following setup
In this setup, the following works
During my tests ✅Connecting from Node A, I can find and be served of resource X (Node B) Any idea, how can I propagate to new peers, what's already is being provided in the network? my swarm build is nothing special: let mut swarm = libp2p::SwarmBuilder::with_existing_identity(id_keys)
.with_tokio()
.with_tcp(tcp::Config::default(), noise::Config::new, yamux::Config::default)?
.with_quic()
.with_dns()?
.with_websocket((tls::Config::new, noise::Config::new), yamux::Config::default)
.await?
.with_behaviour(|key| Behaviour {
...
kademlia: kad::Behaviour::new(
peer_id,
kad::store::MemoryStore::new(key.public().to_peer_id()),
),
...
})?
.with_swarm_config(|c| c.with_idle_connection_timeout(Duration::from_secs(60)))
.build(); |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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? |
Beta Was this translation helpful? Give feedback.
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:
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?