Configuring IPFS part 2
Tags: ipfs, blockchain
Published: 2020-01-16 11:28:13

---
title: Configuring IPFS part 2
published: true
date: 2019-09-26 16:08:00 UTC
tags: ipfs, Blockchain
canonical_url: https://altechnep.blogspot.com/2019/09/configuring-ipfs-part-2.html
---

#### Now we need to install our required dependencies.

## GETTING IPFS :

To install IPFS, Go makes it relatively straightforward to install dependencies directly from its source.

In you console type:

```
$ go get -d github.com/ipfs/go-ipfs $ cd /go/src/github.com/ipfs/go-ipfs$ make install
```
We now need to install ipfs-update module.For that go to [here](https://dist.ipfs.io/#ipfs-update) and download the zip file then extract it to the go/src/github.com/ipfs/go-ipfs Then open the terminal, at that position inside ipfs-update and type:  

```
$ ./install.sh
```
Now, again type :  

```
$ ipfs-update

$ ipfs-update versions

$ ipfs-update install \<your selected version\>
```
The version you selected will update your go-ipfs.  
Now, you can use the command 'ipfs'.  
  

## Initializing

Before we can use IPFS, we must initialize a local repository. This repository contains the settings and internal data for your user account. It also generates a peer identity key to sign any content you create cryptographically.

```
$ ipfs init
```

The `init` command outputs your peer identity key. This key is similar to an account number. 

```
$ ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
```

You should see Hello and welcome to IPFS:

Your IPFS repository is located by default to location in a _.ipfs_ folder in your home folder, where all your content is stored.

## Basic Commands

Note: The quick start guide from the readme gives a list of all commands to assist with getting started.

### Creating & Adding a File to IPFS

Navigate to a directory where you would like to create a file and try the following:

```
$ mkdir ipfs_dir

$ cd ipfd_dir
```

Now let's create a file inside this folder.

```
$ echo "hello world" >hello.txt
```

The text file _hello.txt_ contains "hello world ". Next, add the file to IPFS.

```
$ ipfs add hello.txt
```

You see the following type of output(may not be exact but kind of):

```
$ added QmYBmnUzkvvLxPksYUBGHy2sqbvwskLQw5gK6whxHGcsa8 hello.txt
```

The combination of letters and numbers is the hash that's associated with this text file. The hash is created based on the contents of the file. If you change the contents of the file, the hash changes, save this hash to access the file later on.

### Reading content:

Without using IPFS, we can read the contents of the _hello.txt_ file with the following command:

```
$ cat mytextfiletxt
```

We can read it through IPFS as well. Using the hash generated earlier, enter the following to return the contents of the file:

```
ipfs cat QmYBmnUzkvvLxPksYUBGHy2sqbvwskLQw5gK6whxHGcsa8
```

Note:

If we change the text inside our _hello.txt_ file,we will receive a new hash. Using the `cat` command, we see that our _helloworld.txt_ file was updated with the new text.

### Connecting to the Web

So far we've worked with IPFS locally. Now we're ready to try things online. Open another terminal and run the daemon command.

```
$ ipfs daemon
```

  

The daemon allows us to interact with the IPFS network through localhost in our browser. Switch back to the other terminal to take a look at our peers.

```
$ ipfs swarm peers
```

This command results in a bunch of addresses flashing across the terminal. We opened the swarm component that allows us to listen and maintain connections with other peers on the network. The `peers` command allows us to see every peer that has an open connection.

We've successfully connected to the IPFS network and from here can get content from other nodes if we know the hash of the content.  
  

### Web Console

As we've successfully connected our node to the network we can use the IPFS Web Console.

_[http://localhost:5001/webui](http://localhost:5001/webui)_

In the console, we can:

- check the status of your node
- upload files to IPFS
- explore files
- see your peers
- adjust settings for your node

The web console is the best tool for managing IPFS node.

Check my first post [here](https://dev.to/azwyane/configuring-ipfs-in-linux-based-os-72g)

Happy configuring. \_x\_  
  
  
  
 ![](http://feeds.feedburner.com/~r/blogspot/sTChm/~4/UArlx6NO04E)