{"action":"created","issue":{"url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/139","repository_url":"https://api.github.com/repos/ipfs/js-ipfs-repo","labels_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/139/comments","events_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/139/events","html_url":"https://github.com/ipfs/js-ipfs-repo/issues/139","id":239127526,"number":139,"title":"RFC - Cleansing the 🐉🐉🐉","user":{"login":"diasdavid","id":1211152,"avatar_url":"https://avatars3.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},"labels":[],"state":"open","locked":false,"assignee":{"login":"pgte","id":47910,"avatar_url":"https://avatars2.githubusercontent.com/u/47910?v=3","gravatar_id":"","url":"https://api.github.com/users/pgte","html_url":"https://github.com/pgte","followers_url":"https://api.github.com/users/pgte/followers","following_url":"https://api.github.com/users/pgte/following{/other_user}","gists_url":"https://api.github.com/users/pgte/gists{/gist_id}","starred_url":"https://api.github.com/users/pgte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgte/subscriptions","organizations_url":"https://api.github.com/users/pgte/orgs","repos_url":"https://api.github.com/users/pgte/repos","events_url":"https://api.github.com/users/pgte/events{/privacy}","received_events_url":"https://api.github.com/users/pgte/received_events","type":"User","site_admin":false},"assignees":[{"login":"pgte","id":47910,"avatar_url":"https://avatars2.githubusercontent.com/u/47910?v=3","gravatar_id":"","url":"https://api.github.com/users/pgte","html_url":"https://github.com/pgte","followers_url":"https://api.github.com/users/pgte/followers","following_url":"https://api.github.com/users/pgte/following{/other_user}","gists_url":"https://api.github.com/users/pgte/gists{/gist_id}","starred_url":"https://api.github.com/users/pgte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgte/subscriptions","organizations_url":"https://api.github.com/users/pgte/orgs","repos_url":"https://api.github.com/users/pgte/repos","events_url":"https://api.github.com/users/pgte/events{/privacy}","received_events_url":"https://api.github.com/users/pgte/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2017-06-28T10:59:56Z","updated_at":"2017-06-28T22:41:14Z","closed_at":null,"body":"It has become extremely complicated to understand what is happening inside this module, the similar names (**store everything), the fact that the API docs were removed in favor of aegir docs but those are not getting published and how things are being initialized. \r\n\r\nThe API that we need is only:\r\n\r\n```js\r\nconst options = {\r\n  path: <path to store the repo in>,\r\n  storageBackends: {\r\n    root: <a interface-datastore compatible class> // default to fs-datastore\r\n    blocks: <a interface-datastore compatible class> // default to fs-datastore\r\n    datastore <a interface-datastore compatible class> // default to level-datastore\r\n  }\r\n}\r\nconst repo = new Repo(options)\r\n\r\nrepo.init(cb) // creates the folder structure\r\nrepo.open(cb) // locks the repo \r\nrepo.close(cb) // unlocks the repo\r\n\r\n// get and put values at the root of the repo\r\nrepo.{get(key), put(key, value}  \r\n\r\n// get and put blocks. Knows how to do the sharding and appending .data to the keys\r\nrepo.blocks.{get(key), put(key, value}  \r\n\r\n// get and put kv. Exposes the full interface-datastore API\r\nrepo.datastore.{<full interface-datastore API>}  \r\n```\r\n\r\nThe `lock` is a special case just to be compatible with go. In Node.js should continue to use fs.\r\n\r\nWhat I'm proposing\r\n\r\n- Avoid modules like 'sharding datastore' and just do the sharding from within the `blocks` file here\r\n- Refactor the code, improve comments and flow\r\n- Bring back API docs for the README.\r\n- Write more tests to ensure that there are no breaking changes in the feature that affect how files get stored and how configuration works.\r\n"},"comment":{"url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/comments/311812338","html_url":"https://github.com/ipfs/js-ipfs-repo/issues/139#issuecomment-311812338","issue_url":"https://api.github.com/repos/ipfs/js-ipfs-repo/issues/139","id":311812338,"user":{"login":"dignifiedquire","id":790842,"avatar_url":"https://avatars3.githubusercontent.com/u/790842?v=3","gravatar_id":"","url":"https://api.github.com/users/dignifiedquire","html_url":"https://github.com/dignifiedquire","followers_url":"https://api.github.com/users/dignifiedquire/followers","following_url":"https://api.github.com/users/dignifiedquire/following{/other_user}","gists_url":"https://api.github.com/users/dignifiedquire/gists{/gist_id}","starred_url":"https://api.github.com/users/dignifiedquire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dignifiedquire/subscriptions","organizations_url":"https://api.github.com/users/dignifiedquire/orgs","repos_url":"https://api.github.com/users/dignifiedquire/repos","events_url":"https://api.github.com/users/dignifiedquire/events{/privacy}","received_events_url":"https://api.github.com/users/dignifiedquire/received_events","type":"User","site_admin":false},"created_at":"2017-06-28T22:41:14Z","updated_at":"2017-06-28T22:41:14Z","body":"> Avoid modules like 'sharding datastore' and just do the sharding from within the blocks file here\r\n\r\nThis seems to be step backwards rather than an improvement. I took special care to make datastores as composable and reusable as possible :/"}}
{"actor":{"display_login":"dignifiedquire"}}