Testing the / blockchain endpoint

To test and ensure that we did create this new block, we can head back over to our /blockchain endpoint and refresh the page:

It worked. We now have two blocks in our chain: one is the genesis block and the other is the one we just created. The second block also has the transaction in it, which has the reward.

Let's mine another block to test that again. Head over to our /mine endpoint and refresh it:

We just mined another block, which is our third block. We can see that we get the timestamp, and another ...

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.