Endpoint testing

Before we get into testing, check whether you have all five of our network nodes running inside of your terminal. If not, then you will have to set them up.  Let's test the register-node endpoint by using Postman:

  1. To start with, we're going to type http://localhost:3001/register-node in the address bar, as shown in the following screenshot: 

When we hit this endpoint, we are expected to send in a newNodeUrl as data on our req.body. We'll have to set that up now. So, in the Body tab inside of the Postman, we want to have raw selected and JSON (application/json) selected as the text.

  1. Then, inside the textbox, make an object ...

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.