Additional information
Become a Webnative jedi ð§
Debugging
Version
Check the Webnative version.
Debug Logs
Debug logging can be enabled through the configuration object.
When Webnative makes a change to the user's filesystem, it logs:
Next, Webnative links the change to make it available across the web.
When linking completes, the change is published and available to other browsers.
Shorthands
A Webnative program provides shorthand utility functions for easy access:
The shorthands include:
loadFileSystem. Loads the user's file system. Useful when you want to delay loading the filesystem until some time after initialization.
agentDID. Retrieves the agent DID for the current device.
sharingDID. Retrieves the sharing DID for the current device.
WNFS File System Roots
WNFS comes with three separate top-level file systems "roots": public, pretty, and private.
Public
Not encrypted. Full metadata support. Starts with /public
.
Pretty
Not encrypted. No metadata. Represented simply as /p
to be nice and short when creating public URLs like /p/path/to/file.img
. It does not support versioning, use the Public or Private trees for that.
Private
Encrypted. Structured so that file metadata as well as contents are obscured. Starts with /private
.
More about roots. Learn more about roots in the Fission whitepaper.
Web Worker
Can I use my file system in a web worker? Yes, but depending on which type of session you want you may need to adjust your setup. To be more specific, when working without capabilities you can just create a program in your web worker. But when working with capabilities, it'll depend on how your chosen capabilities flow works. In the case of the current Fission auth lobby, access to the window object is needed when requesting capabilties, so that'll need to happen on the UI/main thread.
Feel free to reach out on our Discord if you need help.
Versions
Since the file system may evolve over time, a "version" is associated with each node in the file system (tracked with semver).
Last updated