Interplanetary Album Box
A box has all you need to get started with IPFS and ONT ID(Interplanetary Album) tutorial.
Last updated
A box has all you need to get started with IPFS and ONT ID(Interplanetary Album) tutorial.
Last updated
There are a few technical requirements before we start. Please install the following:
Install Punica CLI.
Download the interplanetary-album-box
.
Create virtual environments (optional).
If you choose to create a virtual environment, you may need to activate your project's virtual environment. firstly
Install the necessary dependencies.
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.
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.
You must understand the risks of adding or removing nodes form IPFS node's bootstrap list, before you do it.
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.
With an empty list, we can restore the default bootstrap list by --default
option.
$ ipfs bootstrap add --default
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.
Before we run our dApp, we need to run our IPFS node as a daemon.
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.