Skip to content

Ability to query Kademlia peers via behaviour API #5626

@nazar-pc

Description

@nazar-pc

Description

Right now there are methods for adding and removing addresses, but no direct API to query addresses. There is get_closest_local_peers that returns PeerIds, but not corresponding addresses. There is find_closest, but it is private.

Motivation

I need to be able to implement a mechanism similar to Kademlia's iterative lookups, but outside Kademlia. get_closest_local_peers is exactly what I need there, except I also need peer addresses to in order to respond to a query.

Requirements

  1. get_closest_local_peers to return something like KadPeer at the minimum
  2. Ability to query addresses more directly would probably be nice as well
  3. Possibly making find_closest public as it seems to be doing the same thing as get_closest_local_peers except it also contains addresses and filters out source peer, which is exactly what I need

Open questions

Not sure what would be the desired API here yet, hence provided a few potential options

Are you planning to do it yourself in a pull request ?

Maybe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions