ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.17k stars 3.01k forks source link

mounting files api #2060

Open jbenet opened 8 years ago

jbenet commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

@whyrusleeping sgtm. how about some of these:

notes: