Accessing the Blockchain through an API

Building a BlockchainIn the previous chapter, we built the beginnings of our blockchain data structure. In this chapter, we're going to be building an API that will allow us to interact with our blockchain. To build the API, we will be creating a server using the Express.js library, and then we will be building three different endpoints that will allow us to interact with our blockchain. 

Let's get started and build our API from scratch. In this chapter, we are going to cover the following topics:

  • Setting up Express.js
  • Building the API foundation
  • Installing Postman and body-parser
  • Building the /blockchain endpoint
  • Building the /transaction endpoint
  • Building the /mine endpoint
  • Testing the endpoints ...

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.