Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

ipfs.resolve (or ipfs.path.resolve) is missing #174

Closed
fazo96 opened this issue Dec 21, 2015 · 5 comments
Closed

ipfs.resolve (or ipfs.path.resolve) is missing #174

fazo96 opened this issue Dec 21, 2015 · 5 comments

Comments

@fazo96
Copy link

fazo96 commented Dec 21, 2015

Maybe I haven't looked hard enough but I think ipfs.path.resolve or ipfs.resolve should be there (to solve relative paths like /ipfs/<hash>/a/b/c to /ipfs/<hash>).

If I have time later I can try adding it (with tests).

@daviddias
Copy link
Contributor

That is actually unixfs utilities, not part of the HTTP api itself. Nevertheless, it would be really nice to have a Node.js module that understands unixfs and it is able to resolve paths

@fazo96
Copy link
Author

fazo96 commented Dec 21, 2015

Uhm, I guess I could work around resolving paths by running ls on the second last then picking the hash corresponding to the last path segment.

@dignifiedquire
Copy link
Contributor

I does not look like ipfs path resolve is a command. Do we still want to do this, and if so what exactly is the goal here?

@daviddias
Copy link
Contributor

I believe that @fazo96 is looking for something similar to ipfs files stat /a/b/c but that supports ipfs hashes instead of mfs paths.

@daviddias
Copy link
Contributor

Ok, rereading this issue, you can totally do ipfs.files.cat or ipfs.files.get on a path. You can't do ipfs.object.get(path) as the object api doesn't have any resolver function.

however, the new DAG API (which comes to replace object) does and it is a WIP here: ipfs-inactive/interface-js-ipfs-core#99 please share your review and thoughts in how it should work there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants