How to Install and Start Ethereum IPFS Storage

Note

For a comprehensive coverage of blockchain development in Ethereum or mastering Solidity programming, taking our below self paced courses is highly recommended:

 

Recap

In our previous article (How Ethereum IPFS Storage Works), we discussed Ethereum IPFS distributed storage.

In this article, we learn how to install and start Ethereum IPFS storage.

 

Installing IPFS

To start using IPFS, we need to install it. We will use a Unix environment for our IPFS example. The tools will allow us to upload and view the content on the IPFS network:

1. First, we will install go. Afterward, we get the latest security updates. Then, we will extract the files after downloading them. Finally, we will move the package to the /usr/local directory:

apt-get update
  apt-get install  build-essential
  wget  https://dl.google.com/go/go1.12.6.linux-amd64.tar.gz sudo tar -xvf go1.12.6.linux-amd64.tar.gz
  sudo  mv go /usr/local

2. For IPFS to work properly, we need to set up the Go software environment variables. Create a file called /etc/profile.d/go.sh. Add the following Go software environment variables to the file:

#/bin/bash
  export GOROOT=/usr/local/go export  GOPATH=$GOROOT/work
  export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

 

3. Reboot Ubuntu using the following command and verify whether go has installed successfully:

reboot
go version

You should see the go version output in the console.

4. To install ipfs, you may need to log in as an admin user by running sudo -i. Then, run the following command to install IPFS:

go get -u -d github.com/ipfs/go-ipfs cd $GOPATH/src/github.com/ipfs/go-ipfs make  install

Here is a screenshot that shows the output of the preceding command:

 Ethereum blockchain development in Infura

 

Once IPFS has been successfully installed, the output will show the version of go-ipfs- blockstore. In our installation, this is v0.0.1.

 

One-to-One Live Blockchain Classes

Coding Bootcamps school offers One-to-One Live Blockchain Classes for Beginners.

 

Starting an IPFS node

Once installed successfully, enter the ipfs init command to start your IPFS node. You will see your IPFS node ID:

 Ethereum blockchain development in Infura

 

Run the following command and the welcome page will be displayed:

  ipfs cat /ipfs/<nodeID>, the IPFS

This is what the welcome page will look like:

 Ethereum blockchain development in Infura

 

We now have the initial IPFS node. To start the IPFS service, run the following command:

  ipfs daemon

Here is the result of the preceding command:

 Ethereum blockchain development in Infura

Run the following command in a new Terminal to view the nodes in the network that we’re directly connected to:

 

ipfs swarm peers

Here is the resulting screen:

 Ethereum blockchain development in Infura

 

We have installed IPFS in our machine. Next, we will run a simple example so that you can see how we can use IPFS.

 

Next Article
In our next article (How to Run Ethereum IPFS Storage), we discuss how to run Ethereum IPFS storage.

This article is written in collaboration with Brian Wu who is a leading author of “Learn Ethereum: Build your own decentralized applications with Ethereum and smart contracts” book. He has written 7 books on blockchain development.

 

Resources

coming soon