{"action":"created","comment":{"url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/comments/97800598","pull_request_review_id":18421572,"id":97800598,"diff_hunk":"@@ -0,0 +1,81 @@\n+'use strict'\n+\n+const fs = require('fs')\n+const os = require('os')\n+const series = require('async/series')\n+const IPFS = require('../../src/core') // replace this by line below\n+// const IPFS = require('ipfs')\n+\n+/*\n+ * Create a new IPFS instance, using default repo (fs) on default path (~/.ipfs)\n+ */\n+const node = new IPFS(os.tmpDir() + '/' + new Date().toString())\n+\n+const fileToAdd = {\n+  path: 'hello.txt',\n+  content: fs.createReadStream('./hello.txt')\n+}\n+\n+let fileMultihash\n+\n+series([\n+  /*\n+   * Display version of js-ipfs\n+   */\n+  (cb) => {\n+    node.version((err, version) => {\n+      if (err) { return cb(err) }\n+\n+      console.log('IPFS Version:', version.version)\n+      cb()\n+    })\n+  },\n+  /*\n+   * Initialize the repo for this node\n+   */\n+  (cb) => node.init({ emptyRepo: true, bits: 2048 }, cb),\n+  /*\n+   * Load the repo config into the IPFS node\n+   */\n+  (cb) => node.load(cb),\n+  /*\n+   * Take the node online (bitswap, network and so on)\n+   */\n+  (cb) => node.goOnline(cb),\n+  /*\n+   * Add a file to IPFS - Complete Files API on:\n+   * https://github.com/ipfs/interface-ipfs-core/tree/master/API/files\n+   */\n+  (cb) => {\n+    if (node.isOnline()) {\n+      console.log('\\nNode is now ready and online')\n+    }\n+\n+    node.files.add(fileToAdd, (err, result) => {\n+      if (err) { return cb(err) }\n+\n+      console.log('\\nAdded file:')\n+      console.log(result[0])\n+      fileMultihash = result[0].hash","path":"examples/basics/index.js","position":59,"original_position":59,"commit_id":"b7ce4a70478219c318d2923338f55115ed543343","original_commit_id":"b7ce4a70478219c318d2923338f55115ed543343","user":{"login":"diasdavid","id":1211152,"avatar_url":"https://avatars.githubusercontent.com/u/1211152?v=3","gravatar_id":"","url":"https://api.github.com/users/diasdavid","html_url":"https://github.com/diasdavid","followers_url":"https://api.github.com/users/diasdavid/followers","following_url":"https://api.github.com/users/diasdavid/following{/other_user}","gists_url":"https://api.github.com/users/diasdavid/gists{/gist_id}","starred_url":"https://api.github.com/users/diasdavid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diasdavid/subscriptions","organizations_url":"https://api.github.com/users/diasdavid/orgs","repos_url":"https://api.github.com/users/diasdavid/repos","events_url":"https://api.github.com/users/diasdavid/events{/privacy}","received_events_url":"https://api.github.com/users/diasdavid/received_events","type":"User","site_admin":false},"body":"I know, I'm not a fan of that, because then the tasks can't be easily swapped.","created_at":"2017-01-25T15:21:01Z","updated_at":"2017-01-25T15:21:01Z","html_url":"https://github.com/ipfs/js-ipfs/pull/723#discussion_r97800598","pull_request_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/723","_links":{"self":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/comments/97800598"},"html":{"href":"https://github.com/ipfs/js-ipfs/pull/723#discussion_r97800598"},"pull_request":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/723"}}},"pull_request":{"url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/723","id":103106171,"html_url":"https://github.com/ipfs/js-ipfs/pull/723","diff_url":"https://github.com/ipfs/js-ipfs/pull/723.diff","patch_url":"https://github.com/ipfs/js-ipfs/pull/723.patch","issue_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/723","number":723,"state":"closed","locked":false,"title":"docs/improve newcomers experience","user":{"login":"diasdavid","id":1211152,"avatar_url":"https://avatars.githubusercontent.com/u/1211152?v=3","gravatar_id":"","url":"https://api.github.com/users/diasdavid","html_url":"https://github.com/diasdavid","followers_url":"https://api.github.com/users/diasdavid/followers","following_url":"https://api.github.com/users/diasdavid/following{/other_user}","gists_url":"https://api.github.com/users/diasdavid/gists{/gist_id}","starred_url":"https://api.github.com/users/diasdavid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diasdavid/subscriptions","organizations_url":"https://api.github.com/users/diasdavid/orgs","repos_url":"https://api.github.com/users/diasdavid/repos","events_url":"https://api.github.com/users/diasdavid/events{/privacy}","received_events_url":"https://api.github.com/users/diasdavid/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-01-25T12:05:51Z","updated_at":"2017-01-25T15:21:01Z","closed_at":"2017-01-25T14:59:28Z","merged_at":"2017-01-25T14:59:28Z","merge_commit_sha":"88aeef47f4776d3bbd1e4b1693fea5e182c9a08c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/723/commits","review_comments_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/723/comments","review_comment_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/723/comments","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs/statuses/b7ce4a70478219c318d2923338f55115ed543343","head":{"label":"ipfs:docs/improve-newcomers-experience","ref":"docs/improve-newcomers-experience","sha":"b7ce4a70478219c318d2923338f55115ed543343","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":20312497,"name":"js-ipfs","full_name":"ipfs/js-ipfs","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/js-ipfs","description":"IPFS implementation in JavaScript","fork":false,"url":"https://api.github.com/repos/ipfs/js-ipfs","forks_url":"https://api.github.com/repos/ipfs/js-ipfs/forks","keys_url":"https://api.github.com/repos/ipfs/js-ipfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/js-ipfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/js-ipfs/teams","hooks_url":"https://api.github.com/repos/ipfs/js-ipfs/hooks","issue_events_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/js-ipfs/events","assignees_url":"https://api.github.com/repos/ipfs/js-ipfs/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/js-ipfs/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/js-ipfs/tags","blobs_url":"https://api.github.com/repos/ipfs/js-ipfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/js-ipfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/js-ipfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/js-ipfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/js-ipfs/languages","stargazers_url":"https://api.github.com/repos/ipfs/js-ipfs/stargazers","contributors_url":"https://api.github.com/repos/ipfs/js-ipfs/contributors","subscribers_url":"https://api.github.com/repos/ipfs/js-ipfs/subscribers","subscription_url":"https://api.github.com/repos/ipfs/js-ipfs/subscription","commits_url":"https://api.github.com/repos/ipfs/js-ipfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/js-ipfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/js-ipfs/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/js-ipfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/js-ipfs/merges","archive_url":"https://api.github.com/repos/ipfs/js-ipfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/js-ipfs/downloads","issues_url":"https://api.github.com/repos/ipfs/js-ipfs/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/js-ipfs/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/js-ipfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/js-ipfs/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/js-ipfs/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/js-ipfs/deployments","created_at":"2014-05-30T00:31:06Z","updated_at":"2017-01-23T07:13:24Z","pushed_at":"2017-01-25T15:01:56Z","git_url":"git://github.com/ipfs/js-ipfs.git","ssh_url":"git@github.com:ipfs/js-ipfs.git","clone_url":"https://github.com/ipfs/js-ipfs.git","svn_url":"https://github.com/ipfs/js-ipfs","homepage":"https://ipfs.io","size":1560,"stargazers_count":760,"watchers_count":760,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":102,"mirror_url":null,"open_issues_count":52,"forks":102,"open_issues":52,"watchers":760,"default_branch":"master"}},"base":{"label":"ipfs:master","ref":"master","sha":"55b8171e04dac7f838b120d8876fce588bcd2f39","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":20312497,"name":"js-ipfs","full_name":"ipfs/js-ipfs","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/js-ipfs","description":"IPFS implementation in JavaScript","fork":false,"url":"https://api.github.com/repos/ipfs/js-ipfs","forks_url":"https://api.github.com/repos/ipfs/js-ipfs/forks","keys_url":"https://api.github.com/repos/ipfs/js-ipfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/js-ipfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/js-ipfs/teams","hooks_url":"https://api.github.com/repos/ipfs/js-ipfs/hooks","issue_events_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/js-ipfs/events","assignees_url":"https://api.github.com/repos/ipfs/js-ipfs/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/js-ipfs/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/js-ipfs/tags","blobs_url":"https://api.github.com/repos/ipfs/js-ipfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/js-ipfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/js-ipfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/js-ipfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/js-ipfs/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/js-ipfs/languages","stargazers_url":"https://api.github.com/repos/ipfs/js-ipfs/stargazers","contributors_url":"https://api.github.com/repos/ipfs/js-ipfs/contributors","subscribers_url":"https://api.github.com/repos/ipfs/js-ipfs/subscribers","subscription_url":"https://api.github.com/repos/ipfs/js-ipfs/subscription","commits_url":"https://api.github.com/repos/ipfs/js-ipfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/js-ipfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/js-ipfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/js-ipfs/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/js-ipfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/js-ipfs/merges","archive_url":"https://api.github.com/repos/ipfs/js-ipfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/js-ipfs/downloads","issues_url":"https://api.github.com/repos/ipfs/js-ipfs/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/js-ipfs/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/js-ipfs/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/js-ipfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/js-ipfs/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/js-ipfs/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/js-ipfs/deployments","created_at":"2014-05-30T00:31:06Z","updated_at":"2017-01-23T07:13:24Z","pushed_at":"2017-01-25T15:01:56Z","git_url":"git://github.com/ipfs/js-ipfs.git","ssh_url":"git@github.com:ipfs/js-ipfs.git","clone_url":"https://github.com/ipfs/js-ipfs.git","svn_url":"https://github.com/ipfs/js-ipfs","homepage":"https://ipfs.io","size":1560,"stargazers_count":760,"watchers_count":760,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":102,"mirror_url":null,"open_issues_count":52,"forks":102,"open_issues":52,"watchers":760,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/723"},"html":{"href":"https://github.com/ipfs/js-ipfs/pull/723"},"issue":{"href":"https://api.github.com/repos/ipfs/js-ipfs/issues/723"},"comments":{"href":"https://api.github.com/repos/ipfs/js-ipfs/issues/723/comments"},"review_comments":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/723/comments"},"review_comment":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ipfs/js-ipfs/pulls/723/commits"},"statuses":{"href":"https://api.github.com/repos/ipfs/js-ipfs/statuses/b7ce4a70478219c318d2923338f55115ed543343"}}}}
{"actor":{"display_login":"diasdavid"}}