Testing the new and updated /mine endpoints

Let's test the updated /mine endpoint and the /receive-new-block endpoint that we just created. Basically, the /mine endpoint will mine the new block for us. It will also take that block and broadcast it across the entire blockchain network so that every node is synchronized and all the nodes have the same blocks and the same data. This is the result we expect to observe when we test the /mine endpoint:

  1. To get started, you should have all five of the nodes running. You should also have connected them together to create a blockchain network. 
  2. Next, go to the browser. The first thing to do here is to choose a node to mine the new block. We have got five nodes to choose from but in our case, we will ...

Get Learn Blockchain Programming with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.