II. Technical Fundamentals

GETTING STARTED

As with anything truly revolutionary, IPFS takes some getting used to. In this module we’ll cover how to set up your own node and push / pull files from the network.

1. INSTALL IPFS
Since IPFS is a new protocol, you’ll need to install their bundle so that your device will be able to communicate with other IPFS nodes.

After downloading, untar the archive, and move the ipfs binary somewhere in your executables $PATHusing the install.sh script:

$ tar xvfz go-ipfs.tar.gz
$ cd go-ipfs
$ ./install.sh

Test it out:

$ ipfs help
USAGE:

    ipfs - Global p2p merkle-dag filesystem.
...

Congratulations! You now have a working IPFS installation on your computer.

After downloading, unzip the archive, and move ipfs.exe somewhere in your %PATH%.

Test it out:

$ ipfs help
USAGE:

    ipfs - Global p2p merkle-dag filesystem.
...

Congratulations! You now have a working IPFS installation on your computer.

This will cover your needs for this tutorial, but for more info on setting up IPFS you can also visit their portal here.

2. Initialize Your Node

Now that you have installed the IPFS software, you’ll need to configure your local node. For the sake of this example, you can use the defaults. For more information on configuring nodes for different environments click here.

> ipfs init
initializing ipfs node at /Users/jbenet/.go-ipfs
generating 2048-bit RSA keypair...done
peer identity: Qmcpo2iLBikrdf1d6QU6vXuNb6P7hwrbNPW9kLAH8eG67z

Congratulations – you’re now the proud owner of your very own IPFS node!
Your node’s address is shown in the last line as ‘peer identity’.

You can test that your node is working by contacting the IPFS core node to download the readme or quick-start guide:

ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/quick-start

3. GOING ONLINE

Now that you have IPFS installed and your node has an address, you can take the node online and join the network. You may want to use a separate shell window for this.

> ipfs daemon 

Initializing daemon... 

API server listening on /ip4/127.0.0.1/tcp/5001 

Gateway server listening on /ip4/127.0.0.1/tcp/8080 

You can also see other peers on the network:

> ipfs swarm peers 
/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ 
/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx 
/ip4/134.121.64.93/tcp/1035/ipfs/QmWHyrPWQnsz1wxHR219ooJDYTvxJPyZuDUPSDpdsAovN5 
/ip4/178.62.8.190/tcp/4002/ipfs/QmdXzZ25cyzSF99csCQmmPZ1NTbWTe8qtKFaZKpZQPdTFB

4. Retrieving Files

We’re now online, so we can try downloading a file from the network.

ipfs cat /ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ/cat.jpg > cat.jpg
open cat.jpg

If everything is working properly you should now see a cat! This image file is now on your computer, but you didn’t get it over HTTP, and it may have been downloaded from any of hundreds of IPFS nodes around the world. 

> ipfs init
initializing ipfs node at /Users/jbenet/.go-ipfs
generating 2048-bit RSA keypair...done
peer identity: Qmcpo2iLBikrdf1d6QU6vXuNb6P7hwrbNPW9kLAH8eG67z

5. STORING Files

You can also push files to the network:

> hash=`echo "I <3 The Blockchain Institute -$(whoami)" | ipfs add -q`

This will generate a hash of your string message and store it at a new ipfs hash url. 

> curl "https://ipfs.io/ipfs/$hash"

This should now return:

I <3 The Blockchain Institute -<your username>

6. Dashboard View

Now that you’re up and running, you may want to also check out the localhosted network that shows connected peers and files stored.

You can view the dashboard whenever the daemon is running at http://localhost:5001/webui

The webUI View has lots of additional features for non-command line users!

I. Introduction

A Bit of Background…

As with any technology, IPFS is a combination of solutions to problems that had existed in the past. Storage technology is at the core of everything we think of as computers. Player Pianos, dating back to the early 18th century, were the first real form of digital storage. The notches on a steel cylinder pulled tensioned lines, effectively playing a song when the springs were pulled by an attendant. Our modern hard drives are not much more complex than this, using electrical charge rather than the mechanical potential of a spring, but otherwise very similar.

In the early days of computing, storage devices were coupled with processing units in single purpose systems; however with the introduction of the internet and high speed broadband these two components are now commonly separated, often by hundreds of miles. As cloud services have grown, the notion of storage has shifted from individual hard drives and physical devices to a network of high-availability devices which a client device can access for a fee.

The goal of IPFS is to provide a common protocol for networks of computers to use to share their storage.

Current Standards

The primary system employed by storage providers in 2018 is to use HTTP and HTTPS GET and POST requests to pull and place records in servers. While this system has functioned relatively well until now, it has a number of dangerous vulnerabilities derived from its centralized structure.
 
HTTP vs. IPFS (Borrowed: https://cdn-images-1.medium.com/max/1600/1*OJZdD_LoDxUIGfTBI_YkoQ.png)

In particular, when HTTP calls are routed, they use the central domain service to request files by their relation to a particular url. As a result, all files on the network must belong to a particular domain and must be hosted on a particular connected device.

What makes IPFS different?

In contrast, IPFS uses purely peer to peer transfer of data. Each file is hosted across a network of connected nodes who each participate independently of each other. In a similar fashion to the torrents used to share pirated music or movies, these decentralized files cannot be deleted nor their access controlled without access to every participating node in the network.

Next: Technical Fundamentals

IPFS

Introducing IPFS

 The Interplanetary FileSystem (IPFS for short) is a protocol developed to allow the decentralized storage of data across a wide range of nodes. This technology was conceived as an extension of the same concept behind torrents. Individual nodes store encrypted files, and offer them up when any node in the network asks to download them. The files are stored using a hash-addressing system and are encrypted, which allows this network to act as a decentralized filesystem without compromising privacy.
Module 1: Introduction

This technology didn’t just pop up overnight! In this section we’ll cover the background of decentralized storage from torrents until now, and go through some basics terminology to get you up to speed.

Module 2: Technical Fundamentals

In this module, we cover how to set up your own IPFS node, and how to push and pull files from the network. We’ll also go over the addressing structure and get you caught up on the background of this technology.

Module 3: Applications

The real trick with any decentralized network is developing a proper incentive module. In this section we’ll cover the current projects in the space including FileCoin, Swarm, Storj, and Sia, and help you get started with payments for your storage use. We’ll also cover how to set up your node to start earning cryptocurrencies with your unused storage space.

Module 4: Applications

The real trick with any decentralized network is developing a proper incentive model. In this section we’ll cover the current projects in the space including FileCoin, Swarm, Storj, and Sia, and help you get started with payments for your storage use. We’ll also cover how to set up your node to start earning cryptocurrencies with your unused storage space.