- 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!
- PHP動態網站程序設計
- PaaS程序設計
- Vue.js快速入門與深入實戰
- 三維圖形化C++趣味編程
- 新手學Visual C# 2008程序設計
- oreilly精品圖書:軟件開發者路線圖叢書(共8冊)
- 新編Premiere Pro CC從入門到精通
- 編寫高質量代碼:改善C程序代碼的125個建議
- Hands-On Reinforcement Learning with Python
- RabbitMQ Cookbook
- Serverless computing in Azure with .NET
- Go語言精進之路:從新手到高手的編程思想、方法和技巧(2)
- HTML5+CSS3+JavaScript 從入門到項目實踐(超值版)
- Mastering Android Studio 3
- 高效使用Greenplum:入門、進階與數據中臺