- Learn Blockchain Programming with JavaScript
- Eric Traub
- 254字
- 2021-06-10 18:40:34
Building a Blockchain
In the previous chapter, we learned about what a blockchain is and how it functions. In addition, we learned how to set up a project to build our blockchain. In this chapter, you will begin building the blockchain and all of its functionalities. First, let's create the blockchain data structure using a constructor function, and then we'll add a lot of different types of functionalities to our blockchain by adding different methods to its prototype.
We're then going to give the blockchain certain functionalities, such as creating new blocks and transactions, as well as the ability to hash data and blocks. We'll also give it the ability to do a proof of work and many other functionalities that a blockchain should be able to do. We'll then make sure that the blockchain is fully functional by testing the added functionalities as we progress.
By building each piece of the blockchain step by step, you will gain a better understanding of how blockchain actually works under the hood. You may also realize that once you dive into it, creating a blockchain is not as complicated as it sounds.
In this chapter, we'll cover the following topics:
- Learning how to create a Blockchain constructor function
- Building and testing various methods such as createNewBlock, createNewTransaction, and hashBlock to add functionalities to the blockchain
- Understanding what proof of work is and learning how to implement it for our blockchain
- Creating and testing a genesis block
So, let's get started!
- Magento 2 Theme Design(Second Edition)
- Quarkus實踐指南:構(gòu)建新一代的Kubernetes原生Java微服務
- Apex Design Patterns
- Hands-On Swift 5 Microservices Development
- Yocto for Raspberry Pi
- PySide 6/PyQt 6快速開發(fā)與實戰(zhàn)
- Mastering Xamarin.Forms(Second Edition)
- Python項目實戰(zhàn)從入門到精通
- Java程序設計案例教程
- JavaScript程序設計:基礎·PHP·XML
- 大數(shù)據(jù)時代的企業(yè)升級之道(全3冊)
- 現(xiàn)代CPU性能分析與優(yōu)化
- Get Your Hands Dirty on Clean Architecture
- Python Social Media Analytics
- 虛擬現(xiàn)實:引領未來的人機交互革命