Skip to content
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

Merged
merged 4 commits into from
Jul 21, 2020
Merged

feat: store pins in datastore #221

merged 4 commits into from
Jul 21, 2020

Conversation

achingbrain
Copy link
Member

Adds a pins datastore to store pins in.

achingbrain added a commit to ipfs/js-ipfs that referenced this pull request Feb 12, 2020
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
achingbrain added a commit to ipfs/js-ipfs that referenced this pull request Feb 13, 2020
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
achingbrain added a commit to ipfs/js-ipfs that referenced this pull request Mar 4, 2020
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
@achingbrain achingbrain requested a review from vasco-santos July 21, 2020 10:03
@achingbrain achingbrain marked this pull request as ready for review July 21, 2020 10:03
Copy link
Member

@vasco-santos vasco-santos left a 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

expect(repo).to.have.property('pins')
})

it('implements interface-datastore', () => {
Copy link
Member

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

@achingbrain achingbrain merged commit 467c430 into master Jul 21, 2020
@achingbrain achingbrain deleted the store-pins-in-datastore branch July 21, 2020 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants