{"action":"created","comment":{"url":"https://api.github.com/repos/Storj/storj/pulls/comments/180746310","pull_request_review_id":111219695,"id":180746310,"diff_hunk":"@@ -0,0 +1,76 @@\n+// Copyright (C) 2018 Storj Labs, Inc.\n+// See LICENSE for copying information.\n+\n+package main\n+\n+import (\n+\t\"crypto/sha256\"\n+\t\"flag\"\n+\t\"fmt\"\n+\t\"io\"\n+\t\"os\"\n+\t\"path/filepath\"\n+\n+\t\"storj.io/storj/pkg/eestream\"\n+\t\"github.com/vivint/infectious\"\n+)\n+\n+var (\n+\tpieceBlockSize = flag.Int(\"piece_block_size\", 4*1024, \"block size of pieces\")\n+\tkey            = flag.String(\"key\", \"a key\", \"the secret key\")\n+\trsk            = flag.Int(\"required\", 20, \"rs required\")\n+\trsn            = flag.Int(\"total\", 40, \"rs total\")\n+)\n+\n+func main() {\n+\tflag.Parse()\n+\tif flag.Arg(0) == \"\" {\n+\t\tfmt.Printf(\"usage: cat data | %s <targetdir>\\n\", os.Args[0])\n+\t\tos.Exit(1)\n+\t}\n+\terr := Main()\n+\tif err != nil {\n+\t\tpanic(err)\n+\t}\n+}\n+\n+func Main() error {\n+\terr := os.MkdirAll(flag.Arg(0), 0755)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tfc, err := infectious.NewFEC(*rsk, *rsn)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tes := eestream.NewRSScheme(fc, *pieceBlockSize)\n+\tencKey := sha256.Sum256([]byte(*key))\n+\tencrypter, err := eestream.NewSecretboxEncrypter(encKey[:],\n+\t\tes.DecodedBlockSize())\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\treaders := eestream.EncodeReader(eestream.TransformReader(\n+\t\teestream.PadReader(os.Stdin, encrypter.InBlockSize()), encrypter, 0), es)\n+\terrs := make(chan error, len(readers))\n+\tfor i := range readers {\n+\t\tgo func(i int) {\n+\t\t\tfh, err := os.Create(\n+\t\t\t\tfilepath.Join(flag.Arg(0), fmt.Sprintf(\"%d.piece\", i)))\n+\t\t\tif err != nil {\n+\t\t\t\terrs <- err\n+\t\t\t\treturn\n+\t\t\t}\n+\t\t\tdefer fh.Close()\n+\t\t\t_, err = io.Copy(fh, readers[i])\n+\t\t\terrs <- err\n+\t\t}(i)\n+\t}\n+\tfor range readers {","path":"pkg/eestream/cmd/store/main.go","position":69,"original_position":69,"commit_id":"e6a8ff6e300fd72383cd4e66b5b2ce36c104fec5","original_commit_id":"e6a8ff6e300fd72383cd4e66b5b2ce36c104fec5","user":{"login":"jtolds","id":109603,"avatar_url":"https://avatars0.githubusercontent.com/u/109603?v=4","gravatar_id":"","url":"https://api.github.com/users/jtolds","html_url":"https://github.com/jtolds","followers_url":"https://api.github.com/users/jtolds/followers","following_url":"https://api.github.com/users/jtolds/following{/other_user}","gists_url":"https://api.github.com/users/jtolds/gists{/gist_id}","starred_url":"https://api.github.com/users/jtolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtolds/subscriptions","organizations_url":"https://api.github.com/users/jtolds/orgs","repos_url":"https://api.github.com/users/jtolds/repos","events_url":"https://api.github.com/users/jtolds/events{/privacy}","received_events_url":"https://api.github.com/users/jtolds/received_events","type":"User","site_admin":false},"body":"i'm not sure i understand the question, sorry. what do you mean?","created_at":"2018-04-11T13:07:08Z","updated_at":"2018-04-11T13:07:08Z","html_url":"https://github.com/Storj/storj/pull/1#discussion_r180746310","pull_request_url":"https://api.github.com/repos/Storj/storj/pulls/1","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Storj/storj/pulls/comments/180746310"},"html":{"href":"https://github.com/Storj/storj/pull/1#discussion_r180746310"},"pull_request":{"href":"https://api.github.com/repos/Storj/storj/pulls/1"}},"in_reply_to_id":180568650},"pull_request":{"url":"https://api.github.com/repos/Storj/storj/pulls/1","id":180589781,"html_url":"https://github.com/Storj/storj/pull/1","diff_url":"https://github.com/Storj/storj/pull/1.diff","patch_url":"https://github.com/Storj/storj/pull/1.patch","issue_url":"https://api.github.com/repos/Storj/storj/issues/1","number":1,"state":"open","locked":false,"title":"merge eestream","user":{"login":"jtolds","id":109603,"avatar_url":"https://avatars0.githubusercontent.com/u/109603?v=4","gravatar_id":"","url":"https://api.github.com/users/jtolds","html_url":"https://github.com/jtolds","followers_url":"https://api.github.com/users/jtolds/followers","following_url":"https://api.github.com/users/jtolds/following{/other_user}","gists_url":"https://api.github.com/users/jtolds/gists{/gist_id}","starred_url":"https://api.github.com/users/jtolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtolds/subscriptions","organizations_url":"https://api.github.com/users/jtolds/orgs","repos_url":"https://api.github.com/users/jtolds/repos","events_url":"https://api.github.com/users/jtolds/events{/privacy}","received_events_url":"https://api.github.com/users/jtolds/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-10T12:45:00Z","updated_at":"2018-04-11T13:07:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7eb57372c53f6d04342729afb8cb125697346d7b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Storj/storj/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Storj/storj/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Storj/storj/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Storj/storj/issues/1/comments","statuses_url":"https://api.github.com/repos/Storj/storj/statuses/e6a8ff6e300fd72383cd4e66b5b2ce36c104fec5","head":{"label":"jtolds:master","ref":"master","sha":"e6a8ff6e300fd72383cd4e66b5b2ce36c104fec5","user":{"login":"jtolds","id":109603,"avatar_url":"https://avatars0.githubusercontent.com/u/109603?v=4","gravatar_id":"","url":"https://api.github.com/users/jtolds","html_url":"https://github.com/jtolds","followers_url":"https://api.github.com/users/jtolds/followers","following_url":"https://api.github.com/users/jtolds/following{/other_user}","gists_url":"https://api.github.com/users/jtolds/gists{/gist_id}","starred_url":"https://api.github.com/users/jtolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtolds/subscriptions","organizations_url":"https://api.github.com/users/jtolds/orgs","repos_url":"https://api.github.com/users/jtolds/repos","events_url":"https://api.github.com/users/jtolds/events{/privacy}","received_events_url":"https://api.github.com/users/jtolds/received_events","type":"User","site_admin":false},"repo":{"id":128931025,"name":"storj","full_name":"jtolds/storj","owner":{"login":"jtolds","id":109603,"avatar_url":"https://avatars0.githubusercontent.com/u/109603?v=4","gravatar_id":"","url":"https://api.github.com/users/jtolds","html_url":"https://github.com/jtolds","followers_url":"https://api.github.com/users/jtolds/followers","following_url":"https://api.github.com/users/jtolds/following{/other_user}","gists_url":"https://api.github.com/users/jtolds/gists{/gist_id}","starred_url":"https://api.github.com/users/jtolds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtolds/subscriptions","organizations_url":"https://api.github.com/users/jtolds/orgs","repos_url":"https://api.github.com/users/jtolds/repos","events_url":"https://api.github.com/users/jtolds/events{/privacy}","received_events_url":"https://api.github.com/users/jtolds/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jtolds/storj","description":null,"fork":true,"url":"https://api.github.com/repos/jtolds/storj","forks_url":"https://api.github.com/repos/jtolds/storj/forks","keys_url":"https://api.github.com/repos/jtolds/storj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jtolds/storj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jtolds/storj/teams","hooks_url":"https://api.github.com/repos/jtolds/storj/hooks","issue_events_url":"https://api.github.com/repos/jtolds/storj/issues/events{/number}","events_url":"https://api.github.com/repos/jtolds/storj/events","assignees_url":"https://api.github.com/repos/jtolds/storj/assignees{/user}","branches_url":"https://api.github.com/repos/jtolds/storj/branches{/branch}","tags_url":"https://api.github.com/repos/jtolds/storj/tags","blobs_url":"https://api.github.com/repos/jtolds/storj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jtolds/storj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jtolds/storj/git/refs{/sha}","trees_url":"https://api.github.com/repos/jtolds/storj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jtolds/storj/statuses/{sha}","languages_url":"https://api.github.com/repos/jtolds/storj/languages","stargazers_url":"https://api.github.com/repos/jtolds/storj/stargazers","contributors_url":"https://api.github.com/repos/jtolds/storj/contributors","subscribers_url":"https://api.github.com/repos/jtolds/storj/subscribers","subscription_url":"https://api.github.com/repos/jtolds/storj/subscription","commits_url":"https://api.github.com/repos/jtolds/storj/commits{/sha}","git_commits_url":"https://api.github.com/repos/jtolds/storj/git/commits{/sha}","comments_url":"https://api.github.com/repos/jtolds/storj/comments{/number}","issue_comment_url":"https://api.github.com/repos/jtolds/storj/issues/comments{/number}","contents_url":"https://api.github.com/repos/jtolds/storj/contents/{+path}","compare_url":"https://api.github.com/repos/jtolds/storj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jtolds/storj/merges","archive_url":"https://api.github.com/repos/jtolds/storj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jtolds/storj/downloads","issues_url":"https://api.github.com/repos/jtolds/storj/issues{/number}","pulls_url":"https://api.github.com/repos/jtolds/storj/pulls{/number}","milestones_url":"https://api.github.com/repos/jtolds/storj/milestones{/number}","notifications_url":"https://api.github.com/repos/jtolds/storj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jtolds/storj/labels{/name}","releases_url":"https://api.github.com/repos/jtolds/storj/releases{/id}","deployments_url":"https://api.github.com/repos/jtolds/storj/deployments","created_at":"2018-04-10T12:43:39Z","updated_at":"2018-04-10T12:44:44Z","pushed_at":"2018-04-11T12:46:28Z","git_url":"git://github.com/jtolds/storj.git","ssh_url":"git@github.com:jtolds/storj.git","clone_url":"https://github.com/jtolds/storj.git","svn_url":"https://github.com/jtolds/storj","homepage":null,"size":75,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Storj:master","ref":"master","sha":"fa164d58afa510a4261eae31d98b5ac777748e1c","user":{"login":"Storj","id":6308081,"avatar_url":"https://avatars3.githubusercontent.com/u/6308081?v=4","gravatar_id":"","url":"https://api.github.com/users/Storj","html_url":"https://github.com/Storj","followers_url":"https://api.github.com/users/Storj/followers","following_url":"https://api.github.com/users/Storj/following{/other_user}","gists_url":"https://api.github.com/users/Storj/gists{/gist_id}","starred_url":"https://api.github.com/users/Storj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Storj/subscriptions","organizations_url":"https://api.github.com/users/Storj/orgs","repos_url":"https://api.github.com/users/Storj/repos","events_url":"https://api.github.com/users/Storj/events{/privacy}","received_events_url":"https://api.github.com/users/Storj/received_events","type":"Organization","site_admin":false},"repo":{"id":128089774,"name":"storj","full_name":"Storj/storj","owner":{"login":"Storj","id":6308081,"avatar_url":"https://avatars3.githubusercontent.com/u/6308081?v=4","gravatar_id":"","url":"https://api.github.com/users/Storj","html_url":"https://github.com/Storj","followers_url":"https://api.github.com/users/Storj/followers","following_url":"https://api.github.com/users/Storj/following{/other_user}","gists_url":"https://api.github.com/users/Storj/gists{/gist_id}","starred_url":"https://api.github.com/users/Storj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Storj/subscriptions","organizations_url":"https://api.github.com/users/Storj/orgs","repos_url":"https://api.github.com/users/Storj/repos","events_url":"https://api.github.com/users/Storj/events{/privacy}","received_events_url":"https://api.github.com/users/Storj/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Storj/storj","description":null,"fork":false,"url":"https://api.github.com/repos/Storj/storj","forks_url":"https://api.github.com/repos/Storj/storj/forks","keys_url":"https://api.github.com/repos/Storj/storj/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Storj/storj/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Storj/storj/teams","hooks_url":"https://api.github.com/repos/Storj/storj/hooks","issue_events_url":"https://api.github.com/repos/Storj/storj/issues/events{/number}","events_url":"https://api.github.com/repos/Storj/storj/events","assignees_url":"https://api.github.com/repos/Storj/storj/assignees{/user}","branches_url":"https://api.github.com/repos/Storj/storj/branches{/branch}","tags_url":"https://api.github.com/repos/Storj/storj/tags","blobs_url":"https://api.github.com/repos/Storj/storj/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Storj/storj/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Storj/storj/git/refs{/sha}","trees_url":"https://api.github.com/repos/Storj/storj/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Storj/storj/statuses/{sha}","languages_url":"https://api.github.com/repos/Storj/storj/languages","stargazers_url":"https://api.github.com/repos/Storj/storj/stargazers","contributors_url":"https://api.github.com/repos/Storj/storj/contributors","subscribers_url":"https://api.github.com/repos/Storj/storj/subscribers","subscription_url":"https://api.github.com/repos/Storj/storj/subscription","commits_url":"https://api.github.com/repos/Storj/storj/commits{/sha}","git_commits_url":"https://api.github.com/repos/Storj/storj/git/commits{/sha}","comments_url":"https://api.github.com/repos/Storj/storj/comments{/number}","issue_comment_url":"https://api.github.com/repos/Storj/storj/issues/comments{/number}","contents_url":"https://api.github.com/repos/Storj/storj/contents/{+path}","compare_url":"https://api.github.com/repos/Storj/storj/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Storj/storj/merges","archive_url":"https://api.github.com/repos/Storj/storj/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Storj/storj/downloads","issues_url":"https://api.github.com/repos/Storj/storj/issues{/number}","pulls_url":"https://api.github.com/repos/Storj/storj/pulls{/number}","milestones_url":"https://api.github.com/repos/Storj/storj/milestones{/number}","notifications_url":"https://api.github.com/repos/Storj/storj/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Storj/storj/labels{/name}","releases_url":"https://api.github.com/repos/Storj/storj/releases{/id}","deployments_url":"https://api.github.com/repos/Storj/storj/deployments","created_at":"2018-04-04T16:27:18Z","updated_at":"2018-04-11T12:57:13Z","pushed_at":"2018-04-11T12:57:12Z","git_url":"git://github.com/Storj/storj.git","ssh_url":"git@github.com:Storj/storj.git","clone_url":"https://github.com/Storj/storj.git","svn_url":"https://github.com/Storj/storj","homepage":null,"size":54,"stargazers_count":5,"watchers_count":5,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":7,"open_issues":2,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Storj/storj/pulls/1"},"html":{"href":"https://github.com/Storj/storj/pull/1"},"issue":{"href":"https://api.github.com/repos/Storj/storj/issues/1"},"comments":{"href":"https://api.github.com/repos/Storj/storj/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Storj/storj/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Storj/storj/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Storj/storj/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Storj/storj/statuses/e6a8ff6e300fd72383cd4e66b5b2ce36c104fec5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jtolds"}}