Chapter 9. Developing a browser-based blockchain node

This chapter covers

  • Creating a web client for a blockchain
  • Creating a small library for hash generation
  • Running the blockchain web app and debugging TypeScript in the browser

In chapter 8, we developed an app that would create a blockchain, and we provided a script for adding blocks to it. We launched that app from the command line, and it ran under the Node.js runtime.

In this chapter, we’ll modify the blockchain app so that it runs in the browser. We won’t use a web framework here, so it will have a pretty basic UI. We’ll use standard browser API methods, like document.getElementById() and addEventListener().

In this app, each block will store data about several transactions. They ...

Get TypeScript Quickly 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.