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

mounting files api #2060

Open
jbenet opened this issue Dec 12, 2015 · 2 comments
Open

mounting files api #2060

jbenet opened this issue Dec 12, 2015 · 2 comments
Labels
need/community-input Needs input from the wider community

Comments

@jbenet
Copy link
Member

jbenet commented Dec 12, 2015

We've discussed making mfs/files api mountable. we should scope out that interface.

I could see something like this:

# mount mfs/files into a specific dir. 
# the `new` param here means a new dir. but could be an existing hash
> ipfs files mount new ~/arch-mirror

# copy stuff over (or wget or whatever)
> cp stuff/* ~/arch-mirror/.

> ipfs files mount-root ~/arch-mirror
/ipfs/Qmdp278UWxHu1aMvSb9tgxaMGzxtAfX7VxZYv6dLSwpJkH

# maybe even this (controversial interface, of course)
> cat ~/arch-mirror/.ipfs-root
/ipfs/Qmdp278UWxHu1aMvSb9tgxaMGzxtAfX7VxZYv6dLSwpJkH

# maybe unmount yields the root, too
> ipfs files unmount ~/arch-mirror
/ipfs/Qmdp278UWxHu1aMvSb9tgxaMGzxtAfX7VxZYv6dLSwpJkH

# mount that root again
> ipfs files mount /ipfs/Qmdp278UWxHu1aMvSb9tgxaMGzxtAfX7VxZYv6dLSwpJkH ~/arch-mirror
@whyrusleeping
Copy link
Member

This ties in nicely to the pinning modifications that i'm planning. I want to have ipfs add make an entry somewhere in mfs in order to keep a name associated with the thing you added.

@jbenet
Copy link
Member Author

jbenet commented Dec 14, 2015

@whyrusleeping sgtm. how about some of these:

  • $repo/all/adds - all added roots, inc add time, unix user if exists (or http client ip for api!). i think you suggest adding this data to the root object of the add, and i really like the idea. we could call these objects add roots.
  • $repo/index/by-add-time - an index of all objects by add time
  • $repo/index/by-filename - an index of all objects by filename
  • $repo/index/by-size - an index of all objects by sizes

notes:

  • i see the mfs root at $root/files so the above would be separate from the normal mfs root. we could make all of the above rooted at $repo/files though if we want that.
  • indexes are graphs that make search + accesses fast through some properties. they're analogous to database indices in say, SQLite, or some kv-store, etc.
  • indexes can be computed over time, and may not need to happen on-add. (can journal an add and insert into indices later, or on a ipfs repo index build command)

@em-ly em-ly added the need/community-input Needs input from the wider community label Aug 25, 2016
@momack2 momack2 added this to Inbox in ipfs/go-ipfs May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/community-input Needs input from the wider community
Projects
No open projects
Development

No branches or pull requests

3 participants