官术网_书友最值得收藏!

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! 

主站蜘蛛池模板: 宜川县| 五原县| 新郑市| 门头沟区| 安西县| 若尔盖县| 犍为县| 龙口市| 永吉县| 崇信县| 浠水县| 雅江县| 蒙山县| 唐山市| 兴安县| 台北县| 綦江县| 鄂尔多斯市| 宁阳县| 湟源县| 任丘市| 齐河县| 富蕴县| 辽源市| 额尔古纳市| 永顺县| 延吉市| 夹江县| 安阳县| 麻江县| 马公市| 黄大仙区| 左权县| 怀仁县| 石泉县| 金塔县| 大渡口区| 海丰县| 习水县| 象州县| 临武县|