Interplanetary Album Box
A box has all you need to get started with IPFS and ONT ID(Interplanetary Album) tutorial.
There are a few technical requirements before we start. Please install the following:
Install Punica CLI.
$ pip3 install punica
$ punica unbox interplanetary-album
Create virtual environments (optional).
$ virtualenv --no-site-packages venv
Install the necessary dependencies.
$ pip3 install -r requirements.txt
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:
$ ipfs init
initializing IPFS node at .ipfs
generating 2048-bit RSA keypair...done
peer identity: QmbhtBLaPLLUXgon7Quue1JkLjRmoQmm97cqto9JdJ4KuR
to get started, enter:
ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme
The hash after
peer identityis 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
$ ipfs bootstrap
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.
$ ipfs bootstrap rm --all
To be extra cautious, You can also set the
LIBP2P_FORCE_PNETenvironment variable to 1 to force the usage of private networks. If no private network is configured, the daemon will fail to start.
$ export LIBP2P_FORCE_PNET=1
$ echo $LIBP2P_FORCE_PNET
To create a private network, we also need to create a
swarm.keyfile to enable private network feature of IPFS. We will start by adding a key called the
swarm.keythat tells the IPFS nodes that they will be a part of a private network which all will share this
$ go get -u github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen
After install this utility successful, you can run it in one of your node like this:
$ ipfs-swarm-key-gen > ~/.ipfs/swarm.key
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.
$ipfs bootstrap add /ip4/192.168.181.141/tcp/4001/ipfs/QmYzdL2Pe3JvoqMZ1qvcVMnAWo4fVqyvw2S8XDnxHLK8MV
Before we run our dApp, we need to run our IPFS node as a daemon.
$ ipfs daemon
Swarm is limited to private network of peers with the swarm key
Swarm key fingerprint: e06fa4c6c256f4524bc3abb4a1515556
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/169.254.120.205/tcp/4001
Swarm listening on /ip4/169.254.28.251/tcp/4001
Swarm listening on /ip4/169.254.77.95/tcp/4001
Swarm listening on /ip4/192.168.182.1/tcp/4001
Swarm listening on /ip4/192.168.50.211/tcp/4001
Swarm listening on /ip4/192.168.56.1/tcp/4001
Swarm listening on /ip4/192.168.99.1/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit/ipfs/QmauvPUxzGN32aBtHXGRGCbNPxkpCA5ZFc637ABFjGe2mF
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/169.254.120.205/tcp/4001
Swarm announcing /ip4/169.254.28.251/tcp/4001
Swarm announcing /ip4/169.254.77.95/tcp/4001
Swarm announcing /ip4/192.168.182.1/tcp/4001
Swarm announcing /ip4/192.168.3.90/tcp/49660
Swarm announcing /ip4/192.168.50.211/tcp/4001
Swarm announcing /ip4/192.168.56.1/tcp/4001
Swarm announcing /ip4/192.168.99.1/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready
At this point, you can run the dApp in your browser:
If you want to quit it, you can press CTRL+C or close the terminal.