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: pin #107
feat: pin #107
Conversation
|
@AdamStone, js-ipfs has gone through a good amount of updates, including bug fixes and new features. Would you like to revisit pinning again? rebase master on your branch and continue the PR |
|
Sure, I guess I should have been rebasing rather than merging to begin with. I think the core implementation is basically done, so I'll update the description. The failing test should pass once this issue is fixed. |
package.json
Outdated
| @@ -63,6 +63,7 @@ | |||
| "bs58": "^3.0.0", | |||
| "debug": "^2.2.0", | |||
| "detect-node": "^2.0.3", | |||
| "fnv": "^0.1.3", | |||
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.
Are we sure about the licence for this module, can't find info on npm nor the repo.
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.
Ah, good point. I'll swap in something with MIT license.
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.
thanks :)
|
This is looking good @AdamStone :) Would you also like to lead the ipfs-inactive/interface-js-ipfs-core#34, so that we have the same battery of tests for js-ipfs and js-ipfs-api for the Also, |
95384e9
to
9ab49ee
Compare
|
@diasdavid Sorry for the delayed response, I see you've already started on ipfs/interface-ipfs-core#34 but I can continue with that if you like. Am I understanding correctly that it basically just involves migrating the core pinning tests from js-ipfs to interface-ipfs-core? For the datastore, I did notice the discrepancy between js-ipfs and go-ipfs when working out how to store the pin set and ended up just putting it in the block store because I didn't see a good alternative. I just read through ipfs/js-ipfs-repo#13 but found it pretty confusing at first pass. I think I'd better do a little more research before committing to take that on. |
|
@AdamStone sounds good. Let me know if you would like to go through it on IRC or a hangout, you can also join today's js-ipfs call https://github.com/ipfs/pm |
|
@AdamStone good news, we've finished the Pin interface in interface-ipfs-core, so now in order to validate this Pin implementation, you just need to make sure it passes those tests |
|
Sounds good, I'll take a look tonight. |
|
@diasdavid Can you clarify, when pin.add succeeds and returns "an array of objects that represent the files that were pinned", should this include indirectly-pinned objects when the add is recursive? |
|
Since there is the type "recursive pin", we only need to know that the head was recursively pin. So no, we don't need to return them all. |
|
@diasdavid In that case, are there any circumstances where this should return more than just one object, since |
|
The best is to see how go-ipfs does it through the CLI and match the expectations as closely as possible. |
|
@diasdavid The go-ifps cli seems pretty flexible. You can pass one or more b58 hashes or ipfs paths like I found I needed to make a few modifications to the tests, so I opened a PR in interface-ipfs-core. |
|
Any updates on pinning? |
|
@diasdavid After forking the latest js-ipfs-api, its tests seem to bypass my link to interface-ipfs-core. That is to say, when I do |
|
All these years using npm have taught me that when in doubt, start from the top. Let me know if this works for you. |
|
Still not sure why, but even with those steps I just couldn't get the command-line linking to get all the links right. Eventually I just went through and copied the links manually into the node_modules folders, and that seems to work. Although the js-ipfs-api tests are still running a bunch of other tests in addition to what I mark with |
|
It was announced yesterday on all hands that the IPFS Repo had been updated. It was an update also for me. That said, the file structure didn't change. You just need to update the test to look for v6 :) |
|
@diasdavid I rebased against master just now, but I still see the go test repo as version 5. I also haven't been able to find where in the tests or configuration it's deciding that it expects to find a particular version. So I'm not seeing what it would mean exactly to update the test to look for v6? |
|
I rebased what I have so far against current master here and in these related PRs for interface-ipfs-core and js-ifps-api. With these repos linked locally and with the changes in these PRs, all the pin tests are locally passing for me. However, there are placeholder workarounds in the code for two main blocking issues:
@diasdavid I hate to leave this PR hanging again after getting this far, I was hoping this would be the final push to get all this wrapped up while I had the time to spend on it, but sorry to say I'm basically out of time now and I don't expect I'll be able to take this any further. Hopefully someone else can find it a useful starting point. |

Updated core interface to align with interface-ipfs-core, still need to update cli and http.