Skip to content

Instantly share code, notes, and snippets.

@whyrusleeping
Last active August 29, 2015 14:25
Show Gist options
  • Save whyrusleeping/296323e370a1af67ecc3 to your computer and use it in GitHub Desktop.
Save whyrusleeping/296323e370a1af67ecc3 to your computer and use it in GitHub Desktop.
ipnsfs api mockup
ipfs mfs
Manipulate a filesystem rooted on an ipfs object
root options:
--session=name The name of the session to operate on
ipfs mfs # show mounted filesystems
ipfs mfs create name [... args] # create a new filesystem
ipfs mfs close name # close and clean up a filesystem
ipfs mfs put /path/to/point <hash> # this is basically the 'save' command from earlier
ipfs mfs rm /path/to/object/to/remove
ipfs mfs mv /path/to/src /path/to/dst
ipfs mfs ls /path/to/list [-l]
ipfs mfs write [offset] /path/to/file data #can either write data from a file, or pipe to stdin
ipfs mfs read [offset] /path/to/file
ipfs mfs mkdir /path/to/dir/to/make
ipfs mfs stat /path/to/file
WIP:
ipfs nsfs [lock/unlock] /path/to/lockee
@whyrusleeping
Copy link
Author

could also call rename put to import

@whyrusleeping
Copy link
Author

maybe mfs for mutable filesystem instead of nsfs if i'm making it more generic than ipns

@jbenet
Copy link

jbenet commented Jul 31, 2015

i like mfs. or kfs (key-fs, as it's based on PKI).

@whyrusleeping
Copy link
Author

well, its not necessarily based on pki anymore. all this interface really does it manage a filesystem based under an object and propogate updates via a generic 'publish' call. That publish could be just writing the hash to a file on disk, or it could be publishing to an ipns entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment