Testing the /register-nodes-bulk endpoint

In this section, we're going to test our register-nodes-bulk endpoint to make sure that it works properly. This will allow us to gain a clear understanding of how it works: 

  1. To test the endpoint, we are going to head over to Postman. Here, we'll hit the localhost:3001/register-nodes-bulk endpoint.  When we test this endpoint, we expect to receive some data, which is the allNetworkNodes array.
  2. Consequently, in the body tab inside Postman, with the raw option and JSON (application/json) format selected for the text, add the following lines of code to the body:
{    "allNetworkNodes": []}
  1. Inside of this array, there are going to be the URLs of all of the nodes that are already present in our blockchain ...

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.