You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 1, 2024. It is now read-only.
This package was built to enable collaborative file storage similar to popular consumer faced cloud storage. It uses a custom orbit-db store named orbit-db-fsstore to map file paths to IPFS content ids and calculates directory paths from contained file content ids.
Things to Note:
This is alpha software, the API is likely to change.
This is not yet a hardened protocol. Malicious entries added to the underlying orbitdb store could crash the program.
The orbitdb instance handed to SailplaneNode must use js-ipfs version 0.41+ (requires the async iterator api)
[options]: {Object} options to be used by the sharedfs instance
[options.onStop]: {Function} called and awaited before the sharedfs instance is stopped with sharedfs.stop. Used by sailplane.mount. Default is empty function
[options.autoStart]: {Boolean} whether to await sharedfs.start before returning sharedfs instance. Default: true
[options.loadDb]: {Boolean} whether calling sharedfs.start should load the fsstore history. Default: true
constsharedfs=awaitSharedFS.create(orbitdb,{})
returns a Promise that resolves to an instance of SharedFS
.start()
async
Starts the sharedfs instance. Depending on sharedfs.options start may be called automatically and load fsstore history.
awaitsharedfs.start()
returns a Promise that resolves to undefined
.stop([options])
async
[options]: {Object} options to be used
[options.drop]: {Boolean} whether to call .drop on the fsstore
Stops the sharedfs instance. Using the sharedfs instance after calling .stop could result in an error.
awaitsharedfs.stop()
returns a Promise that resolves to undefined
.upload(path, source)
async
path: {String} a string usable as an fsstore path. Every path must be a child of '/r'.
source: {data source} this is handed directly to ipfs.add
Upload folders and files to ipfs and add references to them in the fsstore.
awaitsharedfs.upload('/r',source)
returns a Promise that resolves to undefined
.read(path)
async
path: {String} path of filesystem to read
constcid=awaitsharedfs.read('/r')
returns a Promise that resolves to an instance of CID, more info about IPFS content ids