Let's begin by building the decentralized network:
- The first thing that we'll have to do to create our decentralized blockchain network is make some modifications to our api.js file.
- In our decentralized network, we're going to have multiple instances of our API, and each one of them will act as a network node. Since we'll be dealing with multiple network nodes, it will be better to rename our api.js file to networkNode.js for easy reference.
- To set up the decentralized network, we'll have to run the networkNode.js file multiple times. Each time we run the file, we want it to act as a different network node. Let's do this by running the file on different ports every time we run it. To have a different ports value every time, we'll have to make port a variable. To do this, add the following line at the start of the code...