Lesson: Use an HTTP browser to retrieve files from local IPFS gateway
This lesson shows some of the different ways to access content through an IPFS node that you have installed locally on your computer. Some of the underlying topics are covered in greater depth in the tutorials about Files on IPFS and Going Online - Joining the Distributed Web.
To do the steps in this lesson you must:
After doing this Lesson you will be able to
- Access any content through your local IPFS node's HTTP gateway
Start the IPFS daemon by running
$ ipfs daemon
If the daemon is not running, your IPFS node won't be able to retrieve content from other nodes on the network. It also won't start the HTTP gateway that you're going to use in Step 2.
You must tell the gateway whether you're requesting content with an IPFS hash or an IPNS hash. If you're using the hash of a specific snapshot of content -- for example a file that someone added to IPFS, use a path that starts with
/ipfs/. If you're using an IPNS hash to get the latest version of some content that gets updated over time, for example a website that gets fresh content every day, use a path that starts with
To view the wikipedia page we're using as an example in all of the lessons in the Tutorial on The Myriad Ways to Access and Distribute IPFS Content, use these links:
- latest (IPNS): http://localhost:8080/ipns/QmQP99yW82xNKPxXLroxj1rMYMGF6Grwjj2o4svsdmGh7S/wiki/Anasayfa.html [correct example though this link may be stale]
You can use a local IPFS node to read content from the worldwide IPFS network. The two ways of interacting with your local node are 1) through the command line and 2) through the HTTP gateway. You can use either of those interfaces to pass IPFS the content-addressed (hash) identifiers of the content you want. The IPFS node will use those identifiers to find that content on the network and retrieve it for you.
If you want to learn about the many other ways you can use IPFS to access the same content using the same content-addressed link, go to the Tutorial on The Myriad Ways to Access and Distribute IPFS Content.
Otherwise proceed to the next lesson to learn how to Get content through the public ipfs.io gateway