{"action":"created","comment":{"url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls/comments/127935537","pull_request_review_id":50566143,"id":127935537,"diff_hunk":"@@ -52,166 +61,271 @@ func NewRelay(ctx context.Context, h host.Host, opts ...RelayOpt) (*Relay, error\n \t\tincoming: make(chan *Conn),\n \t}\n \n-\th.SetStreamHandler(StopID, r.HandleNewStopStream)\n-\n \tfor _, opt := range opts {\n \t\tswitch opt {\n \t\tcase OptActive:\n \t\t\tr.active = true\n \t\tcase OptHop:\n-\t\t\th.SetStreamHandler(HopID, r.HandleNewHopStream)\n+\t\t\tr.hop = true\n \t\tdefault:\n \t\t\treturn nil, fmt.Errorf(\"unrecognized option: %d\", opt)\n \t\t}\n \t}\n \n+\th.SetStreamHandler(ProtoID, r.handleNewStream)\n+\n \treturn r, nil\n }\n \n-func (r *Relay) Dial(ctx context.Context, relay peer.ID, dest ma.Multiaddr) (*Conn, error) {\n-\ts, err := r.host.NewStream(ctx, relay, HopID)\n+func (r *Relay) Dial(ctx context.Context, relay pstore.PeerInfo, dest pstore.PeerInfo) (*Conn, error) {\n+\terr := r.host.Connect(ctx, relay)\n \tif err != nil {\n \t\treturn nil, err\n \t}\n \n-\tif err := writeLpMultiaddr(s, dest); err != nil {\n+\ts, err := r.host.NewStream(ctx, relay.ID, ProtoID)","path":"relay.go","position":80,"original_position":80,"commit_id":"c41f41aa59fce29ea571ccaa97136707b45b63eb","original_commit_id":"c41f41aa59fce29ea571ccaa97136707b45b63eb","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":"I will remove the Connect from the Dial method implementation as well -- and it won't need a peer info for the relay any more.","created_at":"2017-07-18T10:14:08Z","updated_at":"2017-07-18T10:14:08Z","html_url":"https://github.com/libp2p/go-libp2p-circuit/pull/3#discussion_r127935537","pull_request_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls/comments/127935537"},"html":{"href":"https://github.com/libp2p/go-libp2p-circuit/pull/3#discussion_r127935537"},"pull_request":{"href":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls/3","id":130834429,"html_url":"https://github.com/libp2p/go-libp2p-circuit/pull/3","diff_url":"https://github.com/libp2p/go-libp2p-circuit/pull/3.diff","patch_url":"https://github.com/libp2p/go-libp2p-circuit/pull/3.patch","issue_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/issues/3","number":3,"state":"open","locked":false,"title":"[WIP] Implement circuit/relay/0.1.0 spec","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":"Updates the implementation for the new v0.1.0 spec.\r\n\r\nSome notable additions:\r\n- Error codes are amended; see https://github.com/libp2p/specs/pull/24\r\n- CAN_HOP is implemented; see https://github.com/libp2p/specs/pull/28\r\n\r\nTBD: libp2p integration -- interface.","created_at":"2017-07-17T11:31:19Z","updated_at":"2017-07-18T10:14:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a457f1931ee94dfb0616c652a502293a595f7a0f","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls/3/commits","review_comments_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls/3/comments","review_comment_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/issues/3/comments","statuses_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/statuses/c41f41aa59fce29ea571ccaa97136707b45b63eb","head":{"label":"libp2p:feat/relay/v0.1.0","ref":"feat/relay/v0.1.0","sha":"c41f41aa59fce29ea571ccaa97136707b45b63eb","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":79306601,"name":"go-libp2p-circuit","full_name":"libp2p/go-libp2p-circuit","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/go-libp2p-circuit","description":"Circuit Switching for libp2p","fork":false,"url":"https://api.github.com/repos/libp2p/go-libp2p-circuit","forks_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/forks","keys_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/teams","hooks_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/hooks","issue_events_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/issues/events{/number}","events_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/events","assignees_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/assignees{/user}","branches_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/branches{/branch}","tags_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/tags","blobs_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/git/refs{/sha}","trees_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/statuses/{sha}","languages_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/languages","stargazers_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/stargazers","contributors_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/contributors","subscribers_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/subscribers","subscription_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/subscription","commits_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/commits{/sha}","git_commits_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/git/commits{/sha}","comments_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/comments{/number}","issue_comment_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/issues/comments{/number}","contents_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/contents/{+path}","compare_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/merges","archive_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/downloads","issues_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/issues{/number}","pulls_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls{/number}","milestones_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/milestones{/number}","notifications_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/labels{/name}","releases_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/releases{/id}","deployments_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/deployments","created_at":"2017-01-18T05:26:21Z","updated_at":"2017-04-11T10:59:09Z","pushed_at":"2017-07-18T08:02:14Z","git_url":"git://github.com/libp2p/go-libp2p-circuit.git","ssh_url":"git@github.com:libp2p/go-libp2p-circuit.git","clone_url":"https://github.com/libp2p/go-libp2p-circuit.git","svn_url":"https://github.com/libp2p/go-libp2p-circuit","homepage":null,"size":22,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"libp2p:master","ref":"master","sha":"75d42b133c3f2b4819f22cf2ddc904074d56fbd5","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":79306601,"name":"go-libp2p-circuit","full_name":"libp2p/go-libp2p-circuit","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/go-libp2p-circuit","description":"Circuit Switching for libp2p","fork":false,"url":"https://api.github.com/repos/libp2p/go-libp2p-circuit","forks_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/forks","keys_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/teams","hooks_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/hooks","issue_events_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/issues/events{/number}","events_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/events","assignees_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/assignees{/user}","branches_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/branches{/branch}","tags_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/tags","blobs_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/git/refs{/sha}","trees_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/statuses/{sha}","languages_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/languages","stargazers_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/stargazers","contributors_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/contributors","subscribers_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/subscribers","subscription_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/subscription","commits_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/commits{/sha}","git_commits_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/git/commits{/sha}","comments_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/comments{/number}","issue_comment_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/issues/comments{/number}","contents_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/contents/{+path}","compare_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/merges","archive_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/downloads","issues_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/issues{/number}","pulls_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls{/number}","milestones_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/milestones{/number}","notifications_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/labels{/name}","releases_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/releases{/id}","deployments_url":"https://api.github.com/repos/libp2p/go-libp2p-circuit/deployments","created_at":"2017-01-18T05:26:21Z","updated_at":"2017-04-11T10:59:09Z","pushed_at":"2017-07-18T08:02:14Z","git_url":"git://github.com/libp2p/go-libp2p-circuit.git","ssh_url":"git@github.com:libp2p/go-libp2p-circuit.git","clone_url":"https://github.com/libp2p/go-libp2p-circuit.git","svn_url":"https://github.com/libp2p/go-libp2p-circuit","homepage":null,"size":22,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls/3"},"html":{"href":"https://github.com/libp2p/go-libp2p-circuit/pull/3"},"issue":{"href":"https://api.github.com/repos/libp2p/go-libp2p-circuit/issues/3"},"comments":{"href":"https://api.github.com/repos/libp2p/go-libp2p-circuit/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libp2p/go-libp2p-circuit/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/libp2p/go-libp2p-circuit/statuses/c41f41aa59fce29ea571ccaa97136707b45b63eb"}}}}
{"actor":{"display_login":"vyzo"}}