libp2p / libp2p/specs

create `interface-service-discovery` based on rendezvous proposal

Open
#47 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
1.8k
Forks
320
Avg merge
11d 15h
Merged PRs (30d)
1

Description

creating this issue here first for lack of a better place

Now that we have https://github.com/libp2p/specs/pull/44, I think we should start thinking about an additional interface for service discovery. The rational being, in the past rendezvous services (servers), provided a peer discovery mechanism, the proposal in #44 satisfies this requirements and can be adapted to be used as a pure peer discovery mechanism that implements interface-peer-discovery. However, we're lacking an interface to describe the new operations that rendezvous brings about, namely registering and discovering peers under a specific namespace. Defining an interface allows us to implement this functionality using alternative mechanisms, such as DHT.

A rendezvous service can satisfy this two use cases - pure peer discovery defined under interface-peer-discovery and service discovery interface-service-discovery.

Here is a very rough first draft (pseudo flow):

// interface-service-discovery

interface DiscoveryResponce {
  timestamp: int64;
  peers: PeerInfo[];
}

interface ServiceDiscovery {
  register(namespace: string, peer: PeerInfo): bool;
  discover(namespace?: string, limit?: int, since?: timestamp): DiscoveryResponce;
} 

I'm still not %100 sold on the naming, so take it with a grain of salt atm. The gist of the operations I want to convey with this interface can be summarized with:

  • A peer wants to be able to register and be discoverable under a certain namespace
  • A peer wants to discover other peers registered under a certain namespace

EDIT:

  • marked discover params as optional (? means optional)
  • added the word peer to in the past rendezvous services (servers), provided a...
  • added DiscoveryResponce type to allow returning a timestamp along side the peer
  • corrected DiscoveryResponce to return a list of peers and a timestamp

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading specs PR #44 and the existing interface-peer-discovery referenced in the issue. Resolve the proposed interface's naming and design, then ensure it describes namespace-based peer registration and discovery, including the response timestamp and peer list.

Written by the indexing model from the issue text.

Assessment

Domain
distributed-systems, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.