dht-crawler icon indicating copy to clipboard operation
dht-crawler copied to clipboard

Iterative Query Helper Method

Open 0xcaff opened this issue 7 years ago • 1 comments

Make a helper to asynchronously iteratively query to find_node and get_node. We would only need find_node for bootstrapping (find_node(self))

0xcaff avatar Sep 30 '18 15:09 0xcaff

Here's what the algorithm will look like.

find_node(target):
  peersOrResult = peer.find_node(target)
  if result
    return result
  peers.first(peer => peer.find_node())

Need to prevent visiting the same peers twice. If two peers are visited twice, there could be a cycle.

0xcaff avatar Oct 03 '18 02:10 0xcaff