updated ipfs.*
This commit is contained in:
parent
fe0d08d7a7
commit
8c0f1abb1e
83
html/ipfs.html
Normal file
83
html/ipfs.html
Normal file
@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>ipfs</title>
|
||||
<style>
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<nav id="TOC">
|
||||
<ul>
|
||||
<li><a href="#ipfs-the-interplanetary-file-system">IPFS: The Interplanetary File System</a><ul>
|
||||
<li><a href="#what-is-ipfs">What is IPFS</a></li>
|
||||
<li><a href="#what-can-i-do-with-it">What can I do with it?</a></li>
|
||||
<li><a href="#basics-of-ipfs">Basics of IPFS</a></li>
|
||||
<li><a href="#cool-stuff-to-do-after-set-up">Cool stuff to do after set up</a><ul>
|
||||
<li><a href="#adding-a-file-to-ipfs">Adding a file to ipfs</a></li>
|
||||
<li><a href="#making-an-indestructible-website">Making an Indestructible Website</a></li>
|
||||
</ul></li>
|
||||
<li><a href="#up-and-coming-projects-using-ipfs">Up and Coming projects using IPFS</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h1 id="ipfs-the-interplanetary-file-system">IPFS: The Interplanetary File System</h1>
|
||||
<h2 id="what-is-ipfs">What is IPFS</h2>
|
||||
<p>Ipfs is software that connects every computer thats a node in the system to the same, indestructable network of files. Its comparable to a bittorrent swarm and evokes the spirit of the original version of the web.</p>
|
||||
<h2 id="what-can-i-do-with-it">What can I do with it?</h2>
|
||||
<p>Ipfs is designed to make anything you post on it, near impossible to get rid of as as the network is up. This means you can make files that are impossible censor and cant 404 just because the server hosting it craps out. Its even possible to make an indestructible, completely decentralized static website!</p>
|
||||
<h2 id="basics-of-ipfs">Basics of IPFS</h2>
|
||||
<p>You can install it with your native package manager or snap if your distro supports it</p>
|
||||
<p><code>sudo apt install snapd</code> <code>snap install ipfs</code> <code>ln -s /snap/ipfs/current/bin/ipfs /usr/local/bin</code></p>
|
||||
<p>Setup is just as easy!</p>
|
||||
<p><code>ipfs init</code> <code>ipfs less /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme</code> <code>ipfs daemon</code> <code>ipfs swarm peers</code></p>
|
||||
<h2 id="cool-stuff-to-do-after-set-up">Cool stuff to do after set up</h2>
|
||||
<h3 id="adding-a-file-to-ipfs">Adding a file to ipfs</h3>
|
||||
<p>If having you're own immortal file sounds awesome, you'll be happy to know doing the same is easy!</p>
|
||||
<p>Simply type: <code>ipfs add the_meaning_of_life.txt</code></p>
|
||||
<p>and you're done!</p>
|
||||
<p>The command will return a hash that looks something like this: <code>QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy</code></p>
|
||||
<p>You'll need that has to get your file from ipfs, just like a website url gets you the site. The hash changes when the file changes, so as long as the file is the same the has will also be.</p>
|
||||
<p>More can be found <a href="https://flyingzumwalt.gitbooks.io/decentralized-web-primer/content/files-on-ipfs/lessons/add-and-retrieve-file-content.html">here</a></p>
|
||||
<h3 id="making-an-indestructible-website">Making an Indestructible Website</h3>
|
||||
<p>If you've every wanted a website but</p>
|
||||
<ol>
|
||||
<li>Couldn't afford hosting</li>
|
||||
<li>Needed to post things you're government wouldn't approve or</li>
|
||||
<li>thought it was too complicated</li>
|
||||
</ol>
|
||||
<p>Ipfs has you covered!</p>
|
||||
<p>Start by making a directory containing your html files, lets say <code>zerzangang</code> is your folder name. Make sure the daemon is running:</p>
|
||||
<p><code>ipfs daemon</code></p>
|
||||
<p>Then you can add the directory to ipfs</p>
|
||||
<p><code>ipfs add -r zerzangang</code></p>
|
||||
<p>You'll get something like this spat out at you</p>
|
||||
<p><code>added QmcMN2wqoun88SVF5own7D5LUpnHwDA6ALZnVdFXhnYhAs zerzangang/pics/zerzan_sexy.jpg added QmS8tC5NJqajBB5qFhcA1auav14iHMnoMZJWfmr4k3EY6w zerzangang/pics added QmYh6HbZhHABQXrkQZ4aRRSoSa6bb9vaKoHeumWex6HRsT zerzangang/index.html added QmYeAiiK1UfB8MGLRefok1N7vBTyX8hGPuMXZ4Xq1DPyt7 zerzangang/</code></p>
|
||||
<p>Something to note is how every file and subdirectory is given its own crypto hash. For now, all you need to know is that the last line is what functions as your "site url". And you're done! All you have to do is type <code>http://localhost:8080/ipfs/$SITE_CID</code> where <code>$SITE_CID</code> is your hash of your site's directory.</p>
|
||||
<p>And you're done!</p>
|
||||
<ol>
|
||||
<li><p>IPNS: The Problem Solver</p>
|
||||
<p>You might remember me saying that the entire hash changes when you change the file. So one downside is that if you edit your website and republish it on ipfs, your site's hash, which is part of its url, will change completely. This is obviously a pain in the ass. But dont worry IPNS has you covered! IPNS allows you to register one hash that stays the same despite the file changes. Lets set it up with your site now!</p>
|
||||
<p>Start by running:</p>
|
||||
<p><code>ipfs name publish $SITE_CID</code></p>
|
||||
<p>The command will return</p>
|
||||
<p><code>Published to $PEER_ID: /ipfs/$SITE_CID</code></p>
|
||||
<p><code>PEER_ID</code> will be the new site hash and you can verify everything went write by typing <code>ipfs name resolove PEER_ID</code>. You can now visit your site on <code>https://ipfs.io/ipns/PEER_ID</code>. The next time you you want to update the site, simply run:</p>
|
||||
<p><code>ipfs add -r zerzangang/</code> <code>ipfs name publish NEW_SITE_HASH</code></p>
|
||||
<p>Now when someone wants to visit your site the address stays the same!</p></li>
|
||||
</ol>
|
||||
<h2 id="up-and-coming-projects-using-ipfs">Up and Coming projects using IPFS</h2>
|
||||
<p><a href="https://neocities.org">Neocities</a>, the spirtual successor to geocities, uses ipfs to back up every change made on the sites it hosts. Making sure that a wealth of web culture won't go AWOL again.</p>
|
||||
<p><a href="http://radicle.xyz/">Radicle</a> is a really interesting project that uses ipfs to make a p2p way to collab on code.</p>
|
||||
</body>
|
||||
</html>
|
153
md/ipfs.md
153
md/ipfs.md
@ -1,64 +1,84 @@
|
||||
# IPFS: The Interplanetary File System
|
||||
- [IPFS: The Interplanetary File
|
||||
System](#ipfs-the-interplanetary-file-system)
|
||||
- [What is IPFS](#what-is-ipfs)
|
||||
- [What can I do with it?](#what-can-i-do-with-it)
|
||||
- [Basics of IPFS](#basics-of-ipfs)
|
||||
- [Cool stuff to do after set up](#cool-stuff-to-do-after-set-up)
|
||||
- [Adding a file to ipfs](#adding-a-file-to-ipfs)
|
||||
- [Making an Indestructible
|
||||
Website](#making-an-indestructible-website)
|
||||
- [Up and Coming projects using
|
||||
IPFS](#up-and-coming-projects-using-ipfs)
|
||||
|
||||
## What is IPFS
|
||||
IPFS: The Interplanetary File System
|
||||
====================================
|
||||
|
||||
Ipfs is software that connects every computer thats a node in the system to the same,
|
||||
indestructable network of files. Its comparable to a bittorrent swarm and evokes the
|
||||
spirit of the original version of the web.
|
||||
What is IPFS
|
||||
------------
|
||||
|
||||
## What can I do with it?
|
||||
Ipfs is software that connects every computer thats a node in the system
|
||||
to the same, indestructable network of files. Its comparable to a
|
||||
bittorrent swarm and evokes the spirit of the original version of the
|
||||
web.
|
||||
|
||||
Ipfs is designed to make anything you post on it, near impossible to get rid of as
|
||||
as the network is up. This means you can make files that are impossible censor and
|
||||
cant 404 just because the server hosting it craps out. Its even possible to make
|
||||
an indestructible, completely decentralized static website!
|
||||
What can I do with it?
|
||||
----------------------
|
||||
|
||||
## Basics of IPFS
|
||||
Ipfs is designed to make anything you post on it, near impossible to get
|
||||
rid of as as the network is up. This means you can make files that are
|
||||
impossible censor and cant 404 just because the server hosting it craps
|
||||
out. Its even possible to make an indestructible, completely
|
||||
decentralized static website!
|
||||
|
||||
You can install it with your native package manager or snap if your distro supports it
|
||||
Basics of IPFS
|
||||
--------------
|
||||
|
||||
`sudo apt install snapd`
|
||||
`snap install ipfs`
|
||||
You can install it with your native package manager or snap if your
|
||||
distro supports it
|
||||
|
||||
`sudo apt install snapd` `snap install ipfs`
|
||||
`ln -s /snap/ipfs/current/bin/ipfs /usr/local/bin`
|
||||
|
||||
Setup is just as easy!
|
||||
Setup is just as easy!
|
||||
|
||||
`ipfs init`
|
||||
`ipfs less /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme`
|
||||
`ipfs daemon`
|
||||
`ipfs swarm peers`
|
||||
`ipfs daemon` `ipfs swarm peers`
|
||||
|
||||
## Cool stuff to do after set up
|
||||
Cool stuff to do after set up
|
||||
-----------------------------
|
||||
|
||||
### Adding a file to ipfs
|
||||
### Adding a file to ipfs
|
||||
|
||||
If having you're own immortal file sounds awesome, you'll be happy to know doing the
|
||||
same is easy!
|
||||
If having you\'re own immortal file sounds awesome, you\'ll be happy to
|
||||
know doing the same is easy!
|
||||
|
||||
Simply type:
|
||||
`ipfs add the_meaning_of_life.txt`
|
||||
Simply type: `ipfs add the_meaning_of_life.txt`
|
||||
|
||||
and you're done!
|
||||
and you\'re done!
|
||||
|
||||
The command will return a hash that looks something like this: `QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy`
|
||||
The command will return a hash that looks something like this:
|
||||
`QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy`
|
||||
|
||||
You'll need that has to get your file from ipfs, just like a website url gets you the site. The hash changes when the file changes, so as long as the file is the same the has will also be.
|
||||
You\'ll need that has to get your file from ipfs, just like a website
|
||||
url gets you the site. The hash changes when the file changes, so as
|
||||
long as the file is the same the has will also be.
|
||||
|
||||
More can be found [here](https://flyingzumwalt.gitbooks.io/decentralized-web-primer/content/files-on-ipfs/lessons/add-and-retrieve-file-content.html)
|
||||
More can be found
|
||||
[here](https://flyingzumwalt.gitbooks.io/decentralized-web-primer/content/files-on-ipfs/lessons/add-and-retrieve-file-content.html)
|
||||
|
||||
### Making an Indestructible Website
|
||||
|
||||
If you've every wanted a website but
|
||||
If you\'ve every wanted a website but
|
||||
|
||||
a) Couldn't afford hosting
|
||||
b) Needed to post things you're government wouldn't approve
|
||||
or
|
||||
c) thought it was too complicated
|
||||
1. Couldn\'t afford hosting
|
||||
2. Needed to post things you\'re government wouldn\'t approve or
|
||||
3. thought it was too complicated
|
||||
|
||||
Ipfs has you covered!
|
||||
|
||||
Start by making a directory containing your html files, lets say `zerzangang` is your
|
||||
folder name. Make sure the daemon is running:
|
||||
Start by making a directory containing your html files, lets say
|
||||
`zerzangang` is your folder name. Make sure the daemon is running:
|
||||
|
||||
`ipfs daemon`
|
||||
|
||||
@ -66,49 +86,52 @@ Then you can add the directory to ipfs
|
||||
|
||||
`ipfs add -r zerzangang`
|
||||
|
||||
You'll get something like this spat out at you
|
||||
You\'ll get something like this spat out at you
|
||||
|
||||
`
|
||||
added QmcMN2wqoun88SVF5own7D5LUpnHwDA6ALZnVdFXhnYhAs zerzangang/pics/zerzan_sexy.jpg
|
||||
added QmS8tC5NJqajBB5qFhcA1auav14iHMnoMZJWfmr4k3EY6w zerzangang/pics
|
||||
added QmYh6HbZhHABQXrkQZ4aRRSoSa6bb9vaKoHeumWex6HRsT zerzangang/index.html
|
||||
added QmYeAiiK1UfB8MGLRefok1N7vBTyX8hGPuMXZ4Xq1DPyt7 zerzangang/`
|
||||
`added QmcMN2wqoun88SVF5own7D5LUpnHwDA6ALZnVdFXhnYhAs zerzangang/pics/zerzan_sexy.jpg added QmS8tC5NJqajBB5qFhcA1auav14iHMnoMZJWfmr4k3EY6w zerzangang/pics added QmYh6HbZhHABQXrkQZ4aRRSoSa6bb9vaKoHeumWex6HRsT zerzangang/index.html added QmYeAiiK1UfB8MGLRefok1N7vBTyX8hGPuMXZ4Xq1DPyt7 zerzangang/`
|
||||
|
||||
Something to note is how every file and subdirectory is given its own crypto hash.
|
||||
For now, all you need to know is that the last line is what functions as your
|
||||
"site url". And you're done! All you have to do is type `http://localhost:8080/ipfs/$SITE_CID` where `$SITE_CID` is your hash of your site's directory.
|
||||
Something to note is how every file and subdirectory is given its own
|
||||
crypto hash. For now, all you need to know is that the last line is what
|
||||
functions as your \"site url\". And you\'re done! All you have to do is
|
||||
type `http://localhost:8080/ipfs/$SITE_CID` where `$SITE_CID` is your
|
||||
hash of your site\'s directory.
|
||||
|
||||
And you're done!
|
||||
And you\'re done!
|
||||
|
||||
#### IPNS: The Problem Solver
|
||||
1. IPNS: The Problem Solver
|
||||
|
||||
You might remember me saying that the entire hash changes when you change the file.
|
||||
So one downside is that if you edit your website and republish it on ipfs, your site's
|
||||
hash, which is part of its url, will change completely. This is obviously a pain in
|
||||
the ass. But dont worry IPNS has you covered! IPNS allows you to register one hash
|
||||
that stays the same despite the file changes. Lets set it up with your site now!
|
||||
You might remember me saying that the entire hash changes when you
|
||||
change the file. So one downside is that if you edit your website
|
||||
and republish it on ipfs, your site\'s hash, which is part of its
|
||||
url, will change completely. This is obviously a pain in the ass.
|
||||
But dont worry IPNS has you covered! IPNS allows you to register one
|
||||
hash that stays the same despite the file changes. Lets set it up
|
||||
with your site now!
|
||||
|
||||
Start by running:
|
||||
Start by running:
|
||||
|
||||
`ipfs name publish $SITE_CID`
|
||||
`ipfs name publish $SITE_CID`
|
||||
|
||||
The command will return
|
||||
The command will return
|
||||
|
||||
`Published to $PEER_ID: /ipfs/$SITE_CID`
|
||||
`Published to $PEER_ID: /ipfs/$SITE_CID`
|
||||
|
||||
`PEER_ID` will be the new site hash and you can verify everything went write by typing
|
||||
`ipfs name resolove PEER_ID`. You can now visit your site on `https://ipfs.io/ipns/PEER_ID`. The next time you you want to update the site, simply run:
|
||||
`PEER_ID` will be the new site hash and you can verify everything
|
||||
went write by typing `ipfs name resolove PEER_ID`. You can now visit
|
||||
your site on `https://ipfs.io/ipns/PEER_ID`. The next time you you
|
||||
want to update the site, simply run:
|
||||
|
||||
`ipfs add -r zerzangang/`
|
||||
`ipfs name publish NEW_SITE_HASH`
|
||||
`ipfs add -r zerzangang/` `ipfs name publish NEW_SITE_HASH`
|
||||
|
||||
Now when someone wants to visit your site the address stays the same!
|
||||
Now when someone wants to visit your site the address stays the
|
||||
same!
|
||||
|
||||
## Up and Coming projects using IPFS
|
||||
Up and Coming projects using IPFS
|
||||
---------------------------------
|
||||
|
||||
[Neocities](https://neocities.org), the spirtual successor to geocities, uses ipfs to
|
||||
back up every change made on the sites it hosts. Making sure that a wealth of web
|
||||
culture won't go AWOL again.
|
||||
[Neocities](https://neocities.org), the spirtual successor to geocities,
|
||||
uses ipfs to back up every change made on the sites it hosts. Making
|
||||
sure that a wealth of web culture won\'t go AWOL again.
|
||||
|
||||
[Radicle](http://radicle.xyz/) is a really interesting project that uses ipfs to make
|
||||
a p2p way to collab on code.
|
||||
[Radicle](http://radicle.xyz/) is a really interesting project that uses
|
||||
ipfs to make a p2p way to collab on code.
|
||||
|
@ -1,114 +0,0 @@
|
||||
# IPFS: The Interplanetary File System
|
||||
|
||||
## What is IPFS
|
||||
|
||||
Ipfs is software that connects every computer thats a node in the system to the same,
|
||||
indestructable network of files. Its comparable to a bittorrent swarm and evokes the
|
||||
spirit of the original version of the web.
|
||||
|
||||
## What can I do with it?
|
||||
|
||||
Ipfs is designed to make anything you post on it, near impossible to get rid of as
|
||||
as the network is up. This means you can make files that are impossible censor and
|
||||
cant 404 just because the server hosting it craps out. Its even possible to make
|
||||
an indestructible, completely decentralized static website!
|
||||
|
||||
## Basics of IPFS
|
||||
|
||||
You can install it with your native package manager or snap if your distro supports it
|
||||
|
||||
`sudo apt install snapd`
|
||||
`snap install ipfs`
|
||||
`ln -s /snap/ipfs/current/bin/ipfs /usr/local/bin`
|
||||
|
||||
Setup is just as easy!
|
||||
|
||||
`ipfs init`
|
||||
`ipfs less /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme`
|
||||
`ipfs daemon`
|
||||
`ipfs swarm peers`
|
||||
|
||||
## Cool stuff to do after set up
|
||||
|
||||
### Adding a file to ipfs
|
||||
|
||||
If having you're own immortal file sounds awesome, you'll be happy to know doing the
|
||||
same is easy!
|
||||
|
||||
Simply type:
|
||||
`ipfs add the_meaning_of_life.txt`
|
||||
|
||||
and you're done!
|
||||
|
||||
The command will return a hash that looks something like this: `QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy`
|
||||
|
||||
You'll need that has to get your file from ipfs, just like a website url gets you the site. The hash changes when the file changes, so as long as the file is the same the has will also be.
|
||||
|
||||
More can be found [here](https://flyingzumwalt.gitbooks.io/decentralized-web-primer/content/files-on-ipfs/lessons/add-and-retrieve-file-content.html)
|
||||
|
||||
### Making an Indestructible Website
|
||||
|
||||
If you've every wanted a website but
|
||||
|
||||
a) Couldn't afford hosting
|
||||
b) Needed to post things you're government wouldn't approve
|
||||
or
|
||||
c) thought it was too complicated
|
||||
|
||||
Ipfs has you covered!
|
||||
|
||||
Start by making a directory containing your html files, lets say `zerzangang` is your
|
||||
folder name. Make sure the daemon is running:
|
||||
|
||||
`ipfs daemon`
|
||||
|
||||
Then you can add the directory to ipfs
|
||||
|
||||
`ipfs add -r zerzangang`
|
||||
|
||||
You'll get something like this spat out at you
|
||||
|
||||
`
|
||||
added QmcMN2wqoun88SVF5own7D5LUpnHwDA6ALZnVdFXhnYhAs zerzangang/pics/zerzan_sexy.jpg
|
||||
added QmS8tC5NJqajBB5qFhcA1auav14iHMnoMZJWfmr4k3EY6w zerzangang/pics
|
||||
added QmYh6HbZhHABQXrkQZ4aRRSoSa6bb9vaKoHeumWex6HRsT zerzangang/index.html
|
||||
added QmYeAiiK1UfB8MGLRefok1N7vBTyX8hGPuMXZ4Xq1DPyt7 zerzangang/`
|
||||
|
||||
Something to note is how every file and subdirectory is given its own crypto hash.
|
||||
For now, all you need to know is that the last line is what functions as your
|
||||
"site url". And you're done! All you have to do is type `http://localhost:8080/ipfs/$SITE_CID` where `$SITE_CID` is your hash of your site's directory.
|
||||
|
||||
And you're done!
|
||||
|
||||
#### IPNS: The Problem Solver
|
||||
|
||||
You might remember me saying that the entire hash changes when you change the file.
|
||||
So one downside is that if you edit your website and republish it on ipfs, your site's
|
||||
hash, which is part of its url, will change completely. This is obviously a pain in
|
||||
the ass. But dont worry IPNS has you covered! IPNS allows you to register one hash
|
||||
that stays the same despite the file changes. Lets set it up with your site now!
|
||||
|
||||
Start by running:
|
||||
|
||||
`ipfs name publish $SITE_CID`
|
||||
|
||||
The command will return
|
||||
|
||||
`Published to $PEER_ID: /ipfs/$SITE_CID`
|
||||
|
||||
`PEER_ID` will be the new site hash and you can verify everything went write by typing
|
||||
`ipfs name resolove PEER_ID`. You can now visit your site on `https://ipfs.io/ipns/PEER_ID`. The next time you you want to update the site, simply run:
|
||||
|
||||
`ipfs add -r zerzangang/`
|
||||
`ipfs name publish NEW_SITE_HASH`
|
||||
|
||||
Now when someone wants to visit your site the address stays the same!
|
||||
|
||||
## Up and Coming projects using IPFS
|
||||
|
||||
[Neocities](https://neocities.org), the spirtual successor to geocities, uses ipfs to
|
||||
back up every change made on the sites it hosts. Making sure that a wealth of web
|
||||
culture won't go AWOL again.
|
||||
|
||||
[Radicle](http://radicle.xyz/) is a really interesting project that uses ipfs to make
|
||||
a p2p way to collab on code.
|
134
txt/ipfs.txt
Normal file
134
txt/ipfs.txt
Normal file
@ -0,0 +1,134 @@
|
||||
- IPFS: The Interplanetary File System
|
||||
- What is IPFS
|
||||
- What can I do with it?
|
||||
- Basics of IPFS
|
||||
- Cool stuff to do after set up
|
||||
- Adding a file to ipfs
|
||||
- Making an Indestructible Website
|
||||
- Up and Coming projects using IPFS
|
||||
|
||||
|
||||
|
||||
IPFS: THE INTERPLANETARY FILE SYSTEM
|
||||
|
||||
|
||||
What is IPFS
|
||||
|
||||
Ipfs is software that connects every computer thats a node in the system
|
||||
to the same, indestructable network of files. Its comparable to a
|
||||
bittorrent swarm and evokes the spirit of the original version of the
|
||||
web.
|
||||
|
||||
|
||||
What can I do with it?
|
||||
|
||||
Ipfs is designed to make anything you post on it, near impossible to get
|
||||
rid of as as the network is up. This means you can make files that are
|
||||
impossible censor and cant 404 just because the server hosting it craps
|
||||
out. Its even possible to make an indestructible, completely
|
||||
decentralized static website!
|
||||
|
||||
|
||||
Basics of IPFS
|
||||
|
||||
You can install it with your native package manager or snap if your
|
||||
distro supports it
|
||||
|
||||
sudo apt install snapd snap install ipfs
|
||||
ln -s /snap/ipfs/current/bin/ipfs /usr/local/bin
|
||||
|
||||
Setup is just as easy!
|
||||
|
||||
ipfs init
|
||||
ipfs less /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme
|
||||
ipfs daemon ipfs swarm peers
|
||||
|
||||
|
||||
Cool stuff to do after set up
|
||||
|
||||
Adding a file to ipfs
|
||||
|
||||
If having you're own immortal file sounds awesome, you'll be happy to
|
||||
know doing the same is easy!
|
||||
|
||||
Simply type: ipfs add the_meaning_of_life.txt
|
||||
|
||||
and you're done!
|
||||
|
||||
The command will return a hash that looks something like this:
|
||||
QmZtmD2qt6fJot32nabSP3CUjicnypEBz7bHVDhPQt9aAy
|
||||
|
||||
You'll need that has to get your file from ipfs, just like a website url
|
||||
gets you the site. The hash changes when the file changes, so as long as
|
||||
the file is the same the has will also be.
|
||||
|
||||
More can be found here
|
||||
|
||||
Making an Indestructible Website
|
||||
|
||||
If you've every wanted a website but
|
||||
|
||||
1. Couldn't afford hosting
|
||||
2. Needed to post things you're government wouldn't approve or
|
||||
3. thought it was too complicated
|
||||
|
||||
Ipfs has you covered!
|
||||
|
||||
Start by making a directory containing your html files, lets say
|
||||
zerzangang is your folder name. Make sure the daemon is running:
|
||||
|
||||
ipfs daemon
|
||||
|
||||
Then you can add the directory to ipfs
|
||||
|
||||
ipfs add -r zerzangang
|
||||
|
||||
You'll get something like this spat out at you
|
||||
|
||||
added QmcMN2wqoun88SVF5own7D5LUpnHwDA6ALZnVdFXhnYhAs zerzangang/pics/zerzan_sexy.jpg added QmS8tC5NJqajBB5qFhcA1auav14iHMnoMZJWfmr4k3EY6w zerzangang/pics added QmYh6HbZhHABQXrkQZ4aRRSoSa6bb9vaKoHeumWex6HRsT zerzangang/index.html added QmYeAiiK1UfB8MGLRefok1N7vBTyX8hGPuMXZ4Xq1DPyt7 zerzangang/
|
||||
|
||||
Something to note is how every file and subdirectory is given its own
|
||||
crypto hash. For now, all you need to know is that the last line is what
|
||||
functions as your "site url". And you're done! All you have to do is
|
||||
type http://localhost:8080/ipfs/$SITE_CID where $SITE_CID is your hash
|
||||
of your site's directory.
|
||||
|
||||
And you're done!
|
||||
|
||||
1. IPNS: The Problem Solver
|
||||
|
||||
You might remember me saying that the entire hash changes when you
|
||||
change the file. So one downside is that if you edit your website
|
||||
and republish it on ipfs, your site's hash, which is part of its
|
||||
url, will change completely. This is obviously a pain in the ass.
|
||||
But dont worry IPNS has you covered! IPNS allows you to register one
|
||||
hash that stays the same despite the file changes. Lets set it up
|
||||
with your site now!
|
||||
|
||||
Start by running:
|
||||
|
||||
ipfs name publish $SITE_CID
|
||||
|
||||
The command will return
|
||||
|
||||
Published to $PEER_ID: /ipfs/$SITE_CID
|
||||
|
||||
PEER_ID will be the new site hash and you can verify everything went
|
||||
write by typing ipfs name resolove PEER_ID. You can now visit your
|
||||
site on https://ipfs.io/ipns/PEER_ID. The next time you you want to
|
||||
update the site, simply run:
|
||||
|
||||
ipfs add -r zerzangang/ ipfs name publish NEW_SITE_HASH
|
||||
|
||||
Now when someone wants to visit your site the address stays the
|
||||
same!
|
||||
|
||||
|
||||
Up and Coming projects using IPFS
|
||||
|
||||
Neocities, the spirtual successor to geocities, uses ipfs to back up
|
||||
every change made on the sites it hosts. Making sure that a wealth of
|
||||
web culture won't go AWOL again.
|
||||
|
||||
Radicle is a really interesting project that uses ipfs to make a p2p way
|
||||
to collab on code.
|
Loading…
Reference in New Issue
Block a user