-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: store pins in datastore #221
Conversation
Adds a `.pins` datastore to `ipfs-repo` and uses that to store pins as cbor binary keyed by b58 stringified multihashes. Each pin has several fields: ```javascript { cid: // buffer, the full CID pinned type: // string, 'recursive' or 'direct' name: // string, a human-readable name for the pin } ``` BREAKING CHANGES: * pins are now stored in a datastore, a repo miration will be necessary * ipfs.pins.add now returns an async generator * ipfs.pins.rm now returns an async generator Depends on: - [ ] ipfs/js-ipfs-repo#221 - [ ] ipfs-inactive/interface-js-ipfs-core#594
Adds a `.pins` datastore to `ipfs-repo` and uses that to store pins as cbor binary keyed by b58 stringified multihashes. Each pin has several fields: ```javascript { cid: // buffer, the full CID pinned type: // string, 'recursive' or 'direct' name: // string, a human-readable name for the pin } ``` BREAKING CHANGES: * pins are now stored in a datastore, a repo miration will be necessary * ipfs.pins.add now returns an async generator * ipfs.pins.rm now returns an async generator Depends on: - [ ] ipfs/js-ipfs-repo#221 - [ ] ipfs-inactive/interface-js-ipfs-core#594
Adds a `.pins` datastore to `ipfs-repo` and uses that to store pins as cbor binary keyed by base64 stringified multihashes (n.b. not CIDs). Each pin has several fields: ```javascript { cid: // buffer, the full CID pinned type: // string, 'recursive' or 'direct' comments: // string, human-readable comments for the pin } ``` BREAKING CHANGES: * pins are now stored in a datastore, a repo migration will be necessary * ipfs.pins.add now returns an async generator * ipfs.pins.rm now returns an async generator Depends on: - [ ] ipfs/js-ipfs-repo#221
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Just a small node on a test
test/pins-test.js
Outdated
expect(repo).to.have.property('pins') | ||
}) | ||
|
||
it('implements interface-datastore', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is redundant as datastore-level
already runs the interface tests: https://github.com/ipfs/js-datastore-level/blob/master/test/index.spec.js#L44
Adds a
pins
datastore to store pins in.