All Fission users have a webnative file system. Apps store user data in public and private namespaces in this filesystem.
Files stored in the public namespace are available on the web through a couple of types of links:
- Public links always link to the latest version of a file
- Archival links permanently link to one version of the file
Webnative can help you generate public and archival links when your app creates or modifies a file. You can also generate links to older versions of a file.
Try the Sharing Public Files demo to experiment with public links and the code for the demo to see how it works.
Public Links
Public links are easy to share and remember, and they always link to the latest version of a file.
All Fission users have a custom domain name. Public links use this custom domain name and /p/
to link to a user’s public files:
https://${username}.files.fission.name/p/${path_to_file}
For example, if the user fission
wanted to link to a shared.txt
in their public folder, the link would be:
https://fission.files.fission.name/p/shared.txt
Even if they edit that file multiple times, this link will always work. This is an easy way to share all sorts of things – including public TiddlyWiki sites, HTML pages, or a link to a PDF.
Archival Links
Archival links permanently link to one version of a file. These links are great when you need a permanent record of a file.
Each time webnative creates or modifies a file, a content identifier representing the current state of the user’s filesystem is created. You can think of this as an identifier for a snapshot of the filesystem. This identifier is called a root CID.
CID is short for content identifier. To learn more about content identifiers, check out the Proto School tutorial or come by and ask us more on Discord.
Archival links use the root CID, /p/
for “pretty path”, and the path to the file:
https://ipfs.runfission.com/ipfs/${rootCid}/p/${path_to_file}
If we were linking to shared.txt
then each time you edited it, the root CID would change. Using an Archival Link you can be sure that you are sharing the exact file contents at the time you are sending it.
Versioned Links
Webnative keeps a history of each version of a file. You can use Versions to access older versions and create links to them.
Versioned links use a CID for the version of the file.
https://ipfs.runfission.com/ipfs/${version.cid}/userland
Note there is no “p” here. This is linking directly into the WNFS file system, skipping the metadata layer, and as such this is intended for developer use, and isn’t really user friendly. This is linking directly to a file version (which could also be an encrypted, private file), unlike Archival Links which capture the entire file path of the public tree, including metadata.
A Note About Permalinks
Permalink can mean a link to content that might change or a permanent link to content. Webnative gives you the option to use public links or archival links, depending on your needs.
Public links are great for linking to dynamic content. Archival links are useful when you need to guarantee that the content has not and will not change.