From 6d5c25a89b2c9cc2e0599762c0d5f28c76ec96d7 Mon Sep 17 00:00:00 2001 From: plast Date: Mon, 25 Nov 2019 09:27:41 -0500 Subject: [PATCH] fixed the code formatting in ipfs.md --- md/ipfs.md | 18 +++---- org/markdown/ipfs.md | 114 ------------------------------------------- 2 files changed, 9 insertions(+), 123 deletions(-) delete mode 100644 org/markdown/ipfs.md diff --git a/md/ipfs.md b/md/ipfs.md index 84d239c..e86fadd 100644 --- a/md/ipfs.md +++ b/md/ipfs.md @@ -17,16 +17,16 @@ an indestructible, completely decentralized static website! 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` +`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` +`ipfs init +ipfs less /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme +ipfs daemon +ipfs swarm peers` ## Cool stuff to do after you set up @@ -99,8 +99,8 @@ The command will return `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! diff --git a/org/markdown/ipfs.md b/org/markdown/ipfs.md deleted file mode 100644 index b32946a..0000000 --- a/org/markdown/ipfs.md +++ /dev/null @@ -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.