Explore the Files API on ProtoSchool
by Teri Chadbourne on 2019-11-06
Today we’re excited to announce the launch of a brand new ProtoSchool tutorial exploring the Regular Files API, built by the awesome Gil Domingues. 🎉
This new tutorial explores the methods at the top-level of js-ipfs (
cat, etc.) that are custom-built for working with files. We refer to these methods as the Regular Files API to distinguish them from the Mutable File System (MFS). MFS mimics a more traditional file system interface with methods like
files.mkdir, but it hides the complexity of immutable content addressing in IPFS. Check out the first lesson of the new tutorial for more on the differences between these two approaches, as well as some important distinctions between the Files API and the DAG API.
If you’re new to IPFS and finding CIDs to be challenging as a naming convention, keep an eye out in this tutorial for an explanation of how you can use the
wrapWithDirectory option in the Regular Files API to create more human-readable paths and filenames.
More to explore on ProtoSchool
Explore other IPFS APIs through coding challenges
- The Mutable File System (MFS) (part of the Files API)
- The DAG API: P2P Data Links with Content Addressing
- The DAG API: Blogging on the Decentralized Web
Our Decentralized Data Structures tutorial offers a code-free look at important concepts like content addressing and hashing.
Prefer to learn in a group setting?
Find a ProtoSchool chapter near you and attend a live workshop.
Help us improve our curriculum
Other resources on using IPFS with files
If you’d like to dig a little deeper, we recommend checking out the Understanding How IPFS Deals with Files course offered at IPFS Camp 2019. (No coding required.) It offers a deep dive on key concepts like immutability, content addressing, hashing, the anatomy of CIDs, what the heck a Merkle DAG is, and how chunk size affects file imports. It also covers the joys and pitfalls of the Mutable File System (MFS), the layer of abstraction in IPFS that lets you work with immutable files and directories as if you were using a traditional name-based file system. As with all great talks, this one is enhanced by images of adorable poodles. 🐩 (12 / 10, would recommend.)
Watch the recording below or check out the slides!
This course also introduces new visualization tools that you can use to see how IPFS addresses and manipulates files:
- Paste a Content Identifier (CID) into the CID Inspector to break down its anatomy
- Drag a file into the DAG Builder and adjust chunk size, DAG layouts, etc. to see how it affects the Merkle DAG