Interplanetary Album Box

A box has all you need to get started with IPFS and ONT ID(Interplanetary Album) tutorial.

Architecture

Getting Started

Setting up the development environment

There are a few technical requirements before we start. Please install the following:

Unboxing the dApp

Install Punica CLI.

Download the interplanetary-album-box.

Create virtual environments (optional).

Install the necessary dependencies.

Initialize IPFS Repository

The IPFS stores all its settings and internal data in a directory called the repository. Before using IPFS for the first time, you’ll need to initialize the repository with the ipfs init command:

The hash after peer identity is your node’s ID and will be different from the one shown in the above output. Other nodes on the network use it to find and connect to you. You can run ipfs id at any time to get it again if you need it.

Create Private IPFS Network (optional)

The IPFS bootstrap list is a list of peers with which the IPFS daemon learns about other peers on the network. You can get you IPFS bootstrap list by bootstrap command.

IPFS comes with a default list of trusted peers, but you are free to modify the list to suit your needs. Therefore, If you want to create your own IPFS network, you need to remove the default list of trusted peers, and add the peers that you trusted.

To be extra cautious, You can also set the LIBP2P_FORCE_PNET environment variable to 1 to force the usage of private networks. If no private network is configured, the daemon will fail to start.

To create a private network, we also need to create a swarm.key file to enable private network feature of IPFS. We will start by adding a key called the swarm.key that tells the IPFS nodes that they will be a part of a private network which all will share this swarm.key file.

After install this utility successful, you can run it in one of your node like this:

After that, you need to copy the file generated to the IPFS directory of each node.

Now, you can add your new bootstrap node to build your private network.

Run IPFS Node

Before we run our dApp, we need to run our IPFS node as a daemon.

Run your dApp

At this point, you can run the dApp in your browser:

If everything goes smoothly, your dApp will run on http://127.0.0.1:5000/, and your IPFS node will run on http://127.0.0.1:5001/.

If you want to quit it, you can press CTRL+C or close the terminal.

Last updated

Was this helpful?