{"action":"created","comment":{"url":"https://api.github.com/repos/libp2p/specs/pulls/comments/183203431","pull_request_review_id":114166108,"id":183203431,"diff_hunk":"@@ -0,0 +1,196 @@\n+# Rendezvous Protocol\n+\n+The protocol described in this specification is intended to provide a\n+lightweight mechanism for generalized peer discovery. It can be used\n+for bootstrap purposes, real time peer discovery, application specific\n+routing, and so on.  Any node implementing the rendezvous protocol can\n+act as a rendezvous point, allowing the discovery of relevant peers in\n+a decentralized fashion.\n+\n+## Use Cases\n+\n+Depending on the application, the protocol could be used in the\n+following context:\n+- During bootstrap, a node can use known rendezvous points to discover\n+  peers that provide critical services. For instance, rendezvous can\n+  be used to discover circuit relays for connectivity restricted\n+  nodes.\n+- During initialization, a node can use rendezvous to discover\n+  peers to connect with the rest of the application. For instance,\n+  rendezvous can be used to discover pubsub peers within a topic.\n+- In a real time setting, applications can poll rendezvous points in\n+  order to discover new peers in a timely fashion.\n+- In an application specific routing setting, rendezvous points can be\n+  used to progressively discover peers that can answer specific queries\n+  or host shards of content.\n+\n+### Replacing ws-star-rendezvous\n+\n+We intend to replace ws-star-rendezvous with a few rendezvous daemons\n+and a fleet of p2p-circuit relays.  Real-time applications will\n+utilize rendezvous both for bootstrap and in a real-time setting.\n+During bootstrap, rendezvous will be used to discover circuit relays\n+that provide connectivity for browser nodes.  Subsequently, rendezvous\n+will be utilized throughout the lifetime of the application for real\n+time peer discovery by registering and polling rendezvous points.\n+This allows us to replace a fragile centralized component with a\n+horizontally scalable ensemble of daemons.\n+\n+### Rendezvous and pubsub\n+\n+Rendezvous can be naturally combined with pubsub for effective\n+real-time discovery.  At a basic level, rendezvous can be used to\n+bootstrap pubsub: nodes can utilize rendezvous in order to discover\n+their peers within a topic.  Contrariwise, pubsub can also be used as\n+a mechanism for building rendezvous services. In this scenerio, a\n+number of rendezvous points can federate using pubsub for internal\n+real-time distribution, while still providing a simple interface to\n+clients.\n+\n+\n+## The Protocol\n+\n+The rendezvous protocol provides facilities for real-time peer\n+discovery within application specific namespaces. Peers connect to the\n+rendezvous point and register their presence in one or more\n+namespaces.\n+\n+Peers registered with the rendezvous point can be discovered by other\n+nodes by querying the rendezvous point. The query specifies the\n+namespace for limiting application scope and optionally a maximum\n+number of peers to return. The namespace can be omitted in the query,\n+which asks for all peers registered to the rendezvous point.\n+\n+The query can also include a cookie, obtained from the response to a\n+previous query, such that only registrations that weren't included in\n+the previous response will be returned. This allows peers to\n+progressively refresh their network view without overhead, which\n+greatly simplifies real time discovery. It also allows for pagination\n+of query responses, so that large numbers of peer registrations can be\n+managed.\n+\n+### Registration Lifetime\n+\n+Registration lifetime is controlled by an optional TTL parameter in\n+the `REGISTER` message.  If a TTL is specified, then the registration\n+persists until the TTL expires.  If no TTL was specified, then a default\n+of 2hrs is implied. There may be a rendezvous point-specific upper bound\n+on TTL, with a minimum such value of 72hrs. If the TTL of a registration\n+is inadmissible, the rendezvous point may reject the registration with\n+an `E_INVALID_TTL` status.\n+\n+Peers can refresh their registrations at any time with a new\n+`REGISTER` message; the TTL of the new message supersedes previous\n+registrations. Peers can also cancel existing registrations at any\n+time with an explicit `UNREGISTER` message.\n+\n+### Interaction\n+\n+Clients `A` and `B` connect to the rendezvous point `R` and register for namespace\n+`my-app` with a `REGISTER` message:\n+\n+```\n+A -> R: REGISTER{my-app, {QmA, AddrA}}\n+R -> A: {OK}\n+B -> R: REGISTER{my-app, {QmB, AddrB}}\n+R -> B: {OK}\n+```\n+\n+Client `C` connects and registers for namespace `another-app`:\n+```\n+C -> R: REGISTER{another-app, {QmC, AddrC}}\n+R -> C: {OK}\n+```\n+\n+Another client `D` can discover peers in `my-app` by sending a `DISCOVER` message; the\n+rendezvous point responds with the list of current peer reigstrations and a cookie.\n+```\n+D -> R: DISCOVER{ns: my-app}\n+R -> D: {[REGISTER{my-app, {QmA, Addr}}\n+          REGISTER{my-app, {QmB, Addr}}],\n+         c1}\n+```\n+\n+If `D` wants to discover all peers registered with `R`, then it can omit the namespace\n+in the query:\n+```\n+D -> R: DISCOVER{}\n+R -> D: {[REGISTER{my-app, {QmA, Addr}}\n+          REGISTER{my-app, {QmB, Addr}}\n+          REGISTER{another-app, {QmC, AddrC}}],\n+         c2}\n+```\n+\n+If `D` wants to progressively poll for real time discovery, it can use","path":"rendezvous/README.md","position":124,"original_position":124,"commit_id":"81e5078580ad5d6bc9d4aebbb7943ef1e292135c","original_commit_id":"81e5078580ad5d6bc9d4aebbb7943ef1e292135c","user":{"login":"vyzo","id":36426,"avatar_url":"https://avatars0.githubusercontent.com/u/36426?v=4","gravatar_id":"","url":"https://api.github.com/users/vyzo","html_url":"https://github.com/vyzo","followers_url":"https://api.github.com/users/vyzo/followers","following_url":"https://api.github.com/users/vyzo/following{/other_user}","gists_url":"https://api.github.com/users/vyzo/gists{/gist_id}","starred_url":"https://api.github.com/users/vyzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vyzo/subscriptions","organizations_url":"https://api.github.com/users/vyzo/orgs","repos_url":"https://api.github.com/users/vyzo/repos","events_url":"https://api.github.com/users/vyzo/events{/privacy}","received_events_url":"https://api.github.com/users/vyzo/received_events","type":"User","site_admin":false},"body":"Also note that explicit unregisters are expected to be rare events.\r\n","created_at":"2018-04-21T07:54:56Z","updated_at":"2018-04-21T07:54:56Z","html_url":"https://github.com/libp2p/specs/pull/44#discussion_r183203431","pull_request_url":"https://api.github.com/repos/libp2p/specs/pulls/44","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/libp2p/specs/pulls/comments/183203431"},"html":{"href":"https://github.com/libp2p/specs/pull/44#discussion_r183203431"},"pull_request":{"href":"https://api.github.com/repos/libp2p/specs/pulls/44"}},"in_reply_to_id":183167492},"pull_request":{"url":"https://api.github.com/repos/libp2p/specs/pulls/44","id":174311076,"html_url":"https://github.com/libp2p/specs/pull/44","diff_url":"https://github.com/libp2p/specs/pull/44.diff","patch_url":"https://github.com/libp2p/specs/pull/44.patch","issue_url":"https://api.github.com/repos/libp2p/specs/issues/44","number":44,"state":"open","locked":false,"title":"rendezvous protocol","user":{"login":"vyzo","id":36426,"avatar_url":"https://avatars0.githubusercontent.com/u/36426?v=4","gravatar_id":"","url":"https://api.github.com/users/vyzo","html_url":"https://github.com/vyzo","followers_url":"https://api.github.com/users/vyzo/followers","following_url":"https://api.github.com/users/vyzo/following{/other_user}","gists_url":"https://api.github.com/users/vyzo/gists{/gist_id}","starred_url":"https://api.github.com/users/vyzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vyzo/subscriptions","organizations_url":"https://api.github.com/users/vyzo/orgs","repos_url":"https://api.github.com/users/vyzo/repos","events_url":"https://api.github.com/users/vyzo/events{/privacy}","received_events_url":"https://api.github.com/users/vyzo/received_events","type":"User","site_admin":false},"body":"Scope:\r\n- real-time applications that require rendezvous.\r\n\r\nObjective:\r\n- Replace ws-star-rendezvous  with a rendezvous service daemon and a fleet of p2p-circuit relays.\r\n","created_at":"2018-03-12T09:27:08Z","updated_at":"2018-04-21T07:54:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7a4eb142c4884bbb540dca07d42929b78aa3c18b","assignee":{"login":"vyzo","id":36426,"avatar_url":"https://avatars0.githubusercontent.com/u/36426?v=4","gravatar_id":"","url":"https://api.github.com/users/vyzo","html_url":"https://github.com/vyzo","followers_url":"https://api.github.com/users/vyzo/followers","following_url":"https://api.github.com/users/vyzo/following{/other_user}","gists_url":"https://api.github.com/users/vyzo/gists{/gist_id}","starred_url":"https://api.github.com/users/vyzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vyzo/subscriptions","organizations_url":"https://api.github.com/users/vyzo/orgs","repos_url":"https://api.github.com/users/vyzo/repos","events_url":"https://api.github.com/users/vyzo/events{/privacy}","received_events_url":"https://api.github.com/users/vyzo/received_events","type":"User","site_admin":false},"assignees":[{"login":"vyzo","id":36426,"avatar_url":"https://avatars0.githubusercontent.com/u/36426?v=4","gravatar_id":"","url":"https://api.github.com/users/vyzo","html_url":"https://github.com/vyzo","followers_url":"https://api.github.com/users/vyzo/followers","following_url":"https://api.github.com/users/vyzo/following{/other_user}","gists_url":"https://api.github.com/users/vyzo/gists{/gist_id}","starred_url":"https://api.github.com/users/vyzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vyzo/subscriptions","organizations_url":"https://api.github.com/users/vyzo/orgs","repos_url":"https://api.github.com/users/vyzo/repos","events_url":"https://api.github.com/users/vyzo/events{/privacy}","received_events_url":"https://api.github.com/users/vyzo/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":525195163,"url":"https://api.github.com/repos/libp2p/specs/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/libp2p/specs/pulls/44/commits","review_comments_url":"https://api.github.com/repos/libp2p/specs/pulls/44/comments","review_comment_url":"https://api.github.com/repos/libp2p/specs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libp2p/specs/issues/44/comments","statuses_url":"https://api.github.com/repos/libp2p/specs/statuses/81e5078580ad5d6bc9d4aebbb7943ef1e292135c","head":{"label":"libp2p:rfc/rendezvous","ref":"rfc/rendezvous","sha":"81e5078580ad5d6bc9d4aebbb7943ef1e292135c","user":{"login":"libp2p","id":14838238,"avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"repo":{"id":68122771,"name":"specs","full_name":"libp2p/specs","owner":{"login":"libp2p","id":14838238,"avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libp2p/specs","description":"Technical specifications for the libp2p networking stack","fork":false,"url":"https://api.github.com/repos/libp2p/specs","forks_url":"https://api.github.com/repos/libp2p/specs/forks","keys_url":"https://api.github.com/repos/libp2p/specs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libp2p/specs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libp2p/specs/teams","hooks_url":"https://api.github.com/repos/libp2p/specs/hooks","issue_events_url":"https://api.github.com/repos/libp2p/specs/issues/events{/number}","events_url":"https://api.github.com/repos/libp2p/specs/events","assignees_url":"https://api.github.com/repos/libp2p/specs/assignees{/user}","branches_url":"https://api.github.com/repos/libp2p/specs/branches{/branch}","tags_url":"https://api.github.com/repos/libp2p/specs/tags","blobs_url":"https://api.github.com/repos/libp2p/specs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libp2p/specs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libp2p/specs/git/refs{/sha}","trees_url":"https://api.github.com/repos/libp2p/specs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libp2p/specs/statuses/{sha}","languages_url":"https://api.github.com/repos/libp2p/specs/languages","stargazers_url":"https://api.github.com/repos/libp2p/specs/stargazers","contributors_url":"https://api.github.com/repos/libp2p/specs/contributors","subscribers_url":"https://api.github.com/repos/libp2p/specs/subscribers","subscription_url":"https://api.github.com/repos/libp2p/specs/subscription","commits_url":"https://api.github.com/repos/libp2p/specs/commits{/sha}","git_commits_url":"https://api.github.com/repos/libp2p/specs/git/commits{/sha}","comments_url":"https://api.github.com/repos/libp2p/specs/comments{/number}","issue_comment_url":"https://api.github.com/repos/libp2p/specs/issues/comments{/number}","contents_url":"https://api.github.com/repos/libp2p/specs/contents/{+path}","compare_url":"https://api.github.com/repos/libp2p/specs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libp2p/specs/merges","archive_url":"https://api.github.com/repos/libp2p/specs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libp2p/specs/downloads","issues_url":"https://api.github.com/repos/libp2p/specs/issues{/number}","pulls_url":"https://api.github.com/repos/libp2p/specs/pulls{/number}","milestones_url":"https://api.github.com/repos/libp2p/specs/milestones{/number}","notifications_url":"https://api.github.com/repos/libp2p/specs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libp2p/specs/labels{/name}","releases_url":"https://api.github.com/repos/libp2p/specs/releases{/id}","deployments_url":"https://api.github.com/repos/libp2p/specs/deployments","created_at":"2016-09-13T15:45:30Z","updated_at":"2018-04-20T12:50:40Z","pushed_at":"2018-04-20T07:31:23Z","git_url":"git://github.com/libp2p/specs.git","ssh_url":"git@github.com:libp2p/specs.git","clone_url":"https://github.com/libp2p/specs.git","svn_url":"https://github.com/libp2p/specs","homepage":"https://libp2p.io","size":118,"stargazers_count":205,"watchers_count":205,"language":null,"has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":32,"open_issues":15,"watchers":205,"default_branch":"master"}},"base":{"label":"libp2p:master","ref":"master","sha":"7900cc0be41d4ea3cf8e3abf9944b50d69f0f04a","user":{"login":"libp2p","id":14838238,"avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"repo":{"id":68122771,"name":"specs","full_name":"libp2p/specs","owner":{"login":"libp2p","id":14838238,"avatar_url":"https://avatars3.githubusercontent.com/u/14838238?v=4","gravatar_id":"","url":"https://api.github.com/users/libp2p","html_url":"https://github.com/libp2p","followers_url":"https://api.github.com/users/libp2p/followers","following_url":"https://api.github.com/users/libp2p/following{/other_user}","gists_url":"https://api.github.com/users/libp2p/gists{/gist_id}","starred_url":"https://api.github.com/users/libp2p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libp2p/subscriptions","organizations_url":"https://api.github.com/users/libp2p/orgs","repos_url":"https://api.github.com/users/libp2p/repos","events_url":"https://api.github.com/users/libp2p/events{/privacy}","received_events_url":"https://api.github.com/users/libp2p/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libp2p/specs","description":"Technical specifications for the libp2p networking stack","fork":false,"url":"https://api.github.com/repos/libp2p/specs","forks_url":"https://api.github.com/repos/libp2p/specs/forks","keys_url":"https://api.github.com/repos/libp2p/specs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libp2p/specs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libp2p/specs/teams","hooks_url":"https://api.github.com/repos/libp2p/specs/hooks","issue_events_url":"https://api.github.com/repos/libp2p/specs/issues/events{/number}","events_url":"https://api.github.com/repos/libp2p/specs/events","assignees_url":"https://api.github.com/repos/libp2p/specs/assignees{/user}","branches_url":"https://api.github.com/repos/libp2p/specs/branches{/branch}","tags_url":"https://api.github.com/repos/libp2p/specs/tags","blobs_url":"https://api.github.com/repos/libp2p/specs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libp2p/specs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libp2p/specs/git/refs{/sha}","trees_url":"https://api.github.com/repos/libp2p/specs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libp2p/specs/statuses/{sha}","languages_url":"https://api.github.com/repos/libp2p/specs/languages","stargazers_url":"https://api.github.com/repos/libp2p/specs/stargazers","contributors_url":"https://api.github.com/repos/libp2p/specs/contributors","subscribers_url":"https://api.github.com/repos/libp2p/specs/subscribers","subscription_url":"https://api.github.com/repos/libp2p/specs/subscription","commits_url":"https://api.github.com/repos/libp2p/specs/commits{/sha}","git_commits_url":"https://api.github.com/repos/libp2p/specs/git/commits{/sha}","comments_url":"https://api.github.com/repos/libp2p/specs/comments{/number}","issue_comment_url":"https://api.github.com/repos/libp2p/specs/issues/comments{/number}","contents_url":"https://api.github.com/repos/libp2p/specs/contents/{+path}","compare_url":"https://api.github.com/repos/libp2p/specs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libp2p/specs/merges","archive_url":"https://api.github.com/repos/libp2p/specs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libp2p/specs/downloads","issues_url":"https://api.github.com/repos/libp2p/specs/issues{/number}","pulls_url":"https://api.github.com/repos/libp2p/specs/pulls{/number}","milestones_url":"https://api.github.com/repos/libp2p/specs/milestones{/number}","notifications_url":"https://api.github.com/repos/libp2p/specs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libp2p/specs/labels{/name}","releases_url":"https://api.github.com/repos/libp2p/specs/releases{/id}","deployments_url":"https://api.github.com/repos/libp2p/specs/deployments","created_at":"2016-09-13T15:45:30Z","updated_at":"2018-04-20T12:50:40Z","pushed_at":"2018-04-20T07:31:23Z","git_url":"git://github.com/libp2p/specs.git","ssh_url":"git@github.com:libp2p/specs.git","clone_url":"https://github.com/libp2p/specs.git","svn_url":"https://github.com/libp2p/specs","homepage":"https://libp2p.io","size":118,"stargazers_count":205,"watchers_count":205,"language":null,"has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":32,"open_issues":15,"watchers":205,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/libp2p/specs/pulls/44"},"html":{"href":"https://github.com/libp2p/specs/pull/44"},"issue":{"href":"https://api.github.com/repos/libp2p/specs/issues/44"},"comments":{"href":"https://api.github.com/repos/libp2p/specs/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/libp2p/specs/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/libp2p/specs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libp2p/specs/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/libp2p/specs/statuses/81e5078580ad5d6bc9d4aebbb7943ef1e292135c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vyzo"}}