In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to cut into the blockchain decentralized application development, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
Some time ago, an etheric square game application: Fomo3D was so popular that it attracted tens of thousands of ethernet coins into the game in just a few days. In the first round of the game, a "hacker" used a very clever use of ethernet square rules to become the final winner, taking away more than 10,000 etheric currency bonuses.
The value of blockchain applications is reflected incisively and vividly by this game, and the core success of Fomo3D games depends on a credible, untampered platform provided by ethernet. When the rules of the game are determined, everything runs according to the rules and no one can interfere. Today, let's introduce how programmers cut into decentralized application development.
Centralized application
For comparison, let's take a look at the centralized application, which is actually the existing Internet application.
Usually we come into contact with the front end of the application (or client), and the front end can be HTML5's web page, Mini Program, or APP. The content displayed in the front end usually sends a request to the server, and the server returns the corresponding content to the front end. The action at the front end will also transform the request to the server, and the server will process it and return the data to the front end. In other words, all the content or operations we see are centralized server control, so it is said to be a centralized application.
Decentralized application DAPP
What's the difference between decentralized applications? The performance of the front end is the same, or the key point of the H5 page, Mini Program, APP,DAPP and traditional App is that the back end is different. The back end is no longer a centralized server, but any node on the distributed network. Note that it can be any node. The request sent to the node in the application is usually called transaction. There are several big differences between the transaction and the centralized request: the data of the transaction is signed by the user and sent to the node. After the node receives the request for the transaction, it broadcasts the request to the entire network. After the transaction has reached a consensus in the network, it can be regarded as the real execution (the real execution of its function is not the connected back-end node, although the back-end will also execute it). And most of the requests under centralization are synchronous (get the results in time), while most of the transactions are asynchronous, which is what we should pay attention to when developing decentralized applications.
The data status (such as the result of the transaction) is obtained from the node, usually through event callback.
How to develop
In the development center application the most important two parts are the client UI performance and the back-end service program, the UI performance through the HTTP request to connect to the back-end service program, the back-end service program runs on the server, such as Nginx Apached and so on.
Developing a decentralized application is the most important and two parts: client-side UI performance and smart contract, the function of smart contract is like the back-end service program, the smart contract is run on the node's EVM, and the client invokes the smart contract by initiating a RPC request to the node.
Here is a comparison:
Client UI client UI HTTP RPC back-end server intelligent contract Nginx/Apache node
So for decentralized applications, programmers can start from two aspects:
One is the client development of decentralized applications. Students who are familiar with the development of client software (such as Web\ APP, etc.) only need to know the API interface of communication between the client and block chain nodes. If the decentralized application is developed on the most widely used block chain platform Ethernet Square, then you need to understand the library Web3. Web3 encapsulates the JSON-RPC interface exposed by the node. For example, the functions provided by Web3 are: obtaining node status, obtaining account information, calling contracts, listening to contract events, and so on.
At present, all the mainstream languages have the implementation of Web3. List some implementations for your reference:
JavaScript Web3.js
Python Web3.py
Haskell hs-web3
Java web3j
Scala web3j-scala
Purescript purescript-web3
PHP web3.php
PHP ethereum-php
Another entry point is the development of intelligent contracts. Solidity is now the recommended language in etherland. Some students are afraid of learning a new language. The grammar of Solidity is actually very concise. Students who have had one or two basic languages (development experience) can learn it in three or five days. I also recorded a video course: in-depth understanding of ethernet intelligent contract language Solidity.
Let's use a Hello contract to understand the syntax of Solidity:
Contract Hello {function hello () public returns (string) {return "Hello World";}}
If you change the contract keyword above to class, it will be the same as a class defined by other languages.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.