Initializing the IPFS nodes

Next, we need to initialize the IPFS nodes for our system. Since we are setting up two nodes, we'll repeat the necessary steps twice, once for Node 1 and once for Node 2. Node 1 will be owned by Bank A, and Node 2 by Bank B.

  1. First, initialize Node 1, using the following command on the Terminal. Make sure you are in the IPFS executable path, which in my case is /usr/local/bin/ipfs.

The IPFS_PATH parameter points to the location of the local node folder for the IPFS Node 1. By default, it is available at /home/<user name>/.ipfs. 

  1. Update this location to the IPFS_PATH parameter, by running the following command:
IPFS_PATH=~/.ipfs ./ipfs init
  • A new peer ID will be generated. It will look something like this: QmQVvZEmvjhYgsyEC7NvMn8EWf131EcgTXFFJQYGSz4Y83
  • Keep it safe. We'll need it later for bootstrapping the nodes.
  1. Next, repeat the same for Node 2 by executing the next few commands on the Terminal window.

We first need to point the IPFS_PATH parameter to the location of the local node folder for the IPFS Node 2. I've set it to /home/<user name>/.ipfs2 for Node 2.

  1. Run the following command on the terminal to initialize IPFS Node 2:
IPFS_PATH=~/.ipfs2 ./ipfs init

A new peer ID will be generated similar to before. Make sure you copy and store the peer ID for this node as well.

This will create two nodes and two-node configuration paths for IPFS in the same local machine.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.84.155