In this folder and on ProtoSchool, you can find a variety of examples to help you get started with js-ipfs, in Node.js and in the Browser. Every example has a specific purpose and some of them incorporate a full tutorial that you can follow through, helping you expand your knowledge about IPFS and the Distributed Web in general.
Let us know if you find any issue or if you want to contribute and add a new tutorial, feel welcome to submit a PR, thank you!
ProtoSchool offers tutorials on decentralized web protocols, through both interactive tutorials and local chapter events. These IPFS tutorials use js-ipfs in the browser:
- Mutable File System (MFS) - Explores the Files API, which lets you work with files and directories as if you were using a traditional name-based file system.
- P2P Data links with content addressing - An introductory look at the DAG API.
- Blogging on the Decentralized Web - An intermediate DAG API challenge using CIDs to link complex data structures.
Clone this repo to explore these tutorials on your local machine:
- Tutorial: IPFS 101, spawn a node and add a file to IPFS
- Tutorial: Build a tiny browser app to exchange files between nodes
- Tutorial: Resolve through IPLD graphs with the dag API
- Tutorial: Use IPFS to explore the Ethereum BlockChain
- Tutorial (Video): How to build an application with IPFS PubSub Room
- Tutorial (Video): How to build an Collaborative Editing Application with IPFS using CRDT
- Tutorial - Understanding Circuit Relay
- js-ipfs in the browser with Browserify
- js-ipfs in the browser with Parcel.js
- js-ipfs in the browser with Vue
- js-ipfs in the browser with WebPack
- js-ipfs in the browser with a
<script>
tag - js-ipfs in electron
- Using streams to add a directory of files to ipfs
- Customizing the ipfs repository
- Customizing your libp2p bundle
- Streaming video from ipfs to the browser using
ReadableStream
s - The Mutable File System in the browser
In this section, you will find explanations to different pieces of IPFS Architecture and how js-ipfs
implements them.
These explanations are still a work in progress
- Storing and Retrieving blocks (soon™)
- IPLD (InterPlanetary Linked-Data) (soon™)
- IPFS Networking - Managing your swarm, libp2p and more (soon™)
All examples should include a test.js
file. The implementation will differ depending on if your example is intended to run under node or the browser.
All browser examples should either be a whole webapp or a simple demo (e.g. just index.html
and index.js
files).
Webapps must have a package.json
that contains either a build
or a bundle
script. This script should place all assets in a folder named dist
, build
or public
including an index.html
file. During testing this will have a web server run over it using http-server
.
Simple demos must have an index.html
file in the root of the demo folder. This file will be loaded in a browser and tested via a file://
URL.
Your test.js
file should contain a Nightwatch scenario that will be executed. The URL to example will be present in the IPFS_EXAMPLE_TEST_URL
environmental variable when the test is run.
Your test.js
file should export an async function that sets up your test, runs any assertions, tears down anything set up and throws an error if the test fails.