A Preliminary Study on the Development and Learning of Blockchain Distributed Application DAPP

I am currently doing some blockchain research at the Shanghai Blockchain Engineering Technology Research Center. My research interests include blockchain data privacy protection, smart contract security vulnerability detection, etc. I welcome peer experts from csdn to give me advice, exchange discussions, and share research experience and results.

 First of all, let me make a simple explanation: I haven’t updated the column for several months. Today, I saw "The Third Learning Summary of Blockchain Technology--Summary of Blockchain Consensus Mechanism" with more than a thousand readings. There is indeed a small Feeling lucky. Here I briefly talk about why I haven't posted a new blog post for such a long time.

1. The review mechanism of csdn must be a combination of artificial intelligence and artificial intelligence. When discussing the emerging cutting-edge technology of blockchain, many terms and terms have become "sensitive words", which will be blocked and cause the review to fail, but the system also It does not report specifically which words are sensitive words, so blog posts always fail to pass the review, which makes me feel particularly troublesome, so the enthusiasm for writing articles is discounted.

2. Now writing technical blog posts is of course completely free for public welfare. Writing articles to share research and learning experience is not for any reward. Of course, it would be a better result if the blog posts could be organized into a book. In fact, the benefits of writing books are not big now, so sometimes, writing technical blogs and writing books is a kind of feeling, a kind of sorting and summarizing one's own research materials, hoping to gain readers' approval.

3. Now is the era of short videos. Some technical bloggers will also choose to publish their own short videos on Bilibili, tiktok and other apps to increase fans and traffic. The reading of text, especially the reading of large paragraphs of text, is correspondingly reduced , so now there are fewer people who have the patience to write blog posts and read blog posts patiently, which is also one of the reasons for the low frequency of article updates. Just like the decline of paper media, online blogs are also impacted by new media such as short videos. I hope that all teachers and friends of csdn can support me and encourage me to write blog posts and books; csdn encourages originality, originality is not easy, please experts and friends The technical masters gave me corrections.

 

Regarding the development of the blockchain, I personally think that a large number of jobs will appear in the field of dapp development. Let me briefly talk about the Ethereum dapp development I am studying recently.

DApp is the abbreviation of Decentralized Application , that is, decentralized application, also known as distributed application . It is considered to have ushered in the blockchain 3.0 era. DApp is a variety of distributed applications derived from the underlying blockchain platform, and is a form of service provision in the blockchain world. DApp is case-insensitive. You may see DAPP or dapp in other literature, but they are all the same and there is no difference.

  Before learning DApp development, you must have blockchain, smart contracts and programming languages ​​as the basis. To put it simply, dapp=smart contract+UI, that is, human-computer interaction, the foreground is the UI, and the background is the smart contract. Different blockchain platforms can use different languages ​​to write smart contracts, and the front-end UI can use the technical route of HTML5+CSS3+JS, that is, some web development technologies. If you are not a full-stack engineer, you cannot develop a dapp independently.

Smart contracts are a significant difference between blockchain 2.0 and blockchain 1.0.

For the basic concept of smart contracts, please go to Baidu or Zhihu.

Smart contract - Wikipedia

What is a smart contract? - Know almost

    To learn dapp development, it is recommended to start learning from Ethereum ( Home | ethereum.org ), the preferred smart contract language on Ethereum is Solidity.

For Chinese reference materials on Solidity, I recommend this website

Solidity latest (0.8.0) Chinese documentation — Solidity Chinese documentation — Denglian Community

Solidity development environment, recommended remix, can be used without installation

Remix - Ethereum IDE

If you have any questions about how to use Remix, you can contact me. Although I am not proficient, I think I have the ability to introduce you to Remix Solidity. A senior software engineer can easily handle Remix in one day.

With the foundation of Solidity, you can start to learn the smart contract development framework. Here we recommend two frameworks, Truffle and Hardhat. I'm currently using Truffle.

Truffle's main website is Sweet Tools for Smart Contracts | Truffle Suite

Truffle Chinese Reference Truffle Translation Description and Overview | Truffle Chinese Documentation - DApp Development Framework |

My current study is mainly based on this Chinese document. Some dapp development books on the Internet are not the latest ones and are not recommended to buy. I recently searched Dangdang.com and found that many books on EOS dapp development have been published, claiming to be blockchain 3.0 DApp programming. My personal point of view is that after learning Ethereum smart contracts and dapp development, you can learn dapp development on other blockchain platforms. Experience is definitely useful. You can also directly learn EOS DApp development. There are potential technical risks here. We will not discuss which one is more profitable, Fang dapp or EOS dapp.

DApp development can be done on both Windows and Linux platforms.

The platform I use is Windows10+VMWare Workstation 15 Player virtual machine, and Ubuntu64-bit operating system is installed in the virtual machine.

In the Windows environment, Ganache needs to be installed.

In the Linux environment, there should be no installation, and the downloaded file is an executable file, as shown in the figure below.

    Notice:

   1. Unable to execute using truffle unbox. The possible error is that you cannot connect to foreign servers, such as the github server. At this time, you must first ensure that your machine can connect to the foreign server that provides the file.

   2. If the unbox is successful, the downloaded files may not be able to execute. For example, if your index.html refers to the jquery.min.js file on the Google server, if your computer cannot connect to the Google server, then this The Web UI page also cannot be opened.

  I tried to run the Pet Store dapp Truffle & Web3.js Tutorial: Teach You to Develop and Deploy Your First Decentralized Application (Dapp) - Pet Store | Denglian Community | Some screenshots of the interface after explaining blockchain technology in simple terms

My http port here is not 3001, but 3000. It is 3000 in the tutorial.

The third account among the ten accounts created by the system has also been imported into the MetaMask wallet, and pets can be adopted.

 After clicking the Adopt button of the 4th puppy in the first row, it is confirmed that the adoption is successful

Teachers and friends who are learning Ethereum DApp development may wish to use the pet store as their first dapp learning example.

A journey of a thousand miles begins with a single step, and the road of technological exploration is endless. New technologies deserve everyone's attention and research, and we are willing to encourage you all. 

Guess you like

Origin blog.csdn.net/zsheep/article/details/121156968