In our blockchain, we would now like to create a network and have a way to register all of the different nodes that we have with it. Therefore, let's make a couple more endpoints that will make it possible to register nodes with our network.
New endpoints outline
Defining the /register-and-broadcast-node endpoint
The first endpoint that we create will be /register-and-broadcast-node, and this is defined as follows:
app.post('/register-and-broadcast-node', function (req, res) {
});
The preceding endpoint will register a node and broadcast that node to the whole network. It will do this by passing the URL of the node we want to register on the req body. Therefore, type the following inside the preceding endpoint...