Programming Complete Guide block chain: platform, language and conclusions

Chain-off, designed for developers and students, Insider!

This article from the chain off the block chain Q & A community , refused reproduced without permission.

Here Insert Picture Description

Block chain, represent the future direction of development. Yes, in the beginning of the article, we first give such a conclusion. Of course, finds that the future will focus on this emerging technology extension is by no means far-fetched. Block chain was originally an open technology and there is no access restrictions, but with the subsequent development of another new type gradually appear, and each block chain has its own specific set of use cases. Publication / no access characteristics include open chain block, and a slow speed to the center, while the private / access type chain block is taken partially or completely closed centralized management.

By today's article, we will discuss what knowledge needs to learn to block chain based technology to develop applications. When I myself (the original author) has just started learning block chain, like everyone else, I think his head was stuffed with vague and obscure questions. What are the different types of block chains are classified as? Which programming language should I use for efficient programming? What are optional block chain development platform? Do not worry, these problems will be 11 answered in today's article.

Now, let's start with the programming language, develop an understanding of how to develop the block chain technology can make full use of the advantages of the application of the results.

Programming block chain type

· Block chain architecture program

Before block chain release, developers first need to solve the important functions constitute its architecture and protocol, and the natural function of the code must be written. For example, in 2009 the official release, management rules and the terms of Bitcoin project is written in C ++. This aspect of coding typically used in languages ​​such as C and Java to complete, which is characterized by the expression closer to the process used to machine.

· Intelligent building contract, or to the center of the application (referred to DApp)

In a typical application of which the center of the rear end of the code runs on the central server; contrast, Dapp the back-end code to run on the center of the network and the like. As with other applications, DApp can use any language to write front-end and user interface code, and direct calls to the back-end functionality provided.

Common block chain programming platform

· Hyperledger

Hyperledger actually a total set of open source projects in the field of chain blocks, designed to promote the development of related technologies, and through its own guide publishing tools, training and activities to support the collaborative development of the global block chain distributed ledger. The project's objective is to provide a modular block chain technology, including all kinds of rich and easy to use application programming interface (referred to as API). Hyperledger can significantly reduce security risks, and to ensure that all parties involved in the transaction can only hope that the process be added to the transaction. All in all, Hyperledger can provide block chain architecture, data privacy protection, information sharing, and immutability, and all closely related to the block chain function.

· Ethernet Square

Ether Square block chain is an open source platform for developing block chain runs over to the center of application of art or DApp. Ethernet Square block chain platform provides a powerful scripting or script contract support capabilities, and run on each node of the network among themselves. Ethernet Square not only be able to track trading activities, also can be programmed. Currently Ethernet Square offers a variety of options for programming languages, including C ++, Go, Python and Java and so on. Smart Solidity contract is required to build, which is a high-level programming language for the contract.

Five commonly used programming language block chain

  1. C++

Let's list from among the oldest, and most respected language - programming language C ++ community of evergreen start. I believe we are well aware, C ++ language extensions belong to the C language program. In C ++, we can create data, function and object packages, and call them easily and reuse in other programs, which will greatly shorten the period of time coding.

However, given the current variety of optional high-level language, why should we use C ++?

Simply put, this is because C ++ has certain characteristics can not be replaced, and has received a strong appeal. Taking into account the development of the block chain challenges, we can be the ideal block chain developments as a bastion of safety, while required to provide efficient resource management capabilities. Block chain needs to interact with many nodes untrusted, while ensuring to provide fast service to all nodes. More importantly, fast service is often directly determine the fate of the encryption currency project. Therefore, developers must face the problem and resource requirements contention core function is set to the highest priority, which requires us to be completely control the use of CPU and memory resources - the focus here, C ++ can help users achieve a good this goal.

Another interesting thing about C ++, and that it has a move semantics. Move semantics is provided a method for content move between objects, rather than copy the contents. Move semantics advantage is that we can only when necessary to obtain a copy of some data, which will significantly reduce code redundancy and to improve performance levels. Therefore, memory management and strong performance C ++ represents just fit the needs of the practical application of the block chain technology.

In the block chain programming, another important challenge I can think of is how to parallelize tasks and integrate non-parallel tasks. Most languages ​​tend to only focus on one, but threading capabilities of C ++ so that it can cope with parallel and non-parallel tasks simultaneously. C ++ allows multiple threads facilities to achieve efficient inter-thread communication, while the single-threaded performance which made optimization.

C ++ strengths and shortcomings

A block chain C ++ Example

C ++ language is mainly used to encrypt the currency as well as other important block chain projects, including Bitcoin, Ripple, Bitcoin cash, Litecoin, Stellar and Monero.

  1. JavaScript

JavaScript is one of the most popular software development languages ​​currently in. And JavaScript libraries and frameworks, including jQuery, React, Angular and Node, etc., has become a modern Web development drive engine. To be used with HTML and CSS, its function will be further enhanced. JavaScript's main purpose is to create a page there are a lot of interaction effect.

In fact, JavaScript itself also has a very important characteristic for block chain operation, which is very concerning its handling asynchronous operation. As the number of users on the block chain platform surge in the amount of operation executed simultaneously will grow rapidly, and JavaScript can more easily handle all communications to and between the different blocks chain nodes. However, we must admit that, JavaScript C ++ is better efficiency in the full use of computer processing power.

JavaScript strengths and shortcomings

Example JavaScript block chain with

Block chain developers currently use JavaScript in web3.js and ethereum.js them, it can help us with the front-end Ethernet networks and intelligent Square contract applications connected. In the block chain field, another major JavaScript application direction Hyperledger Fabric SDK for node.js of. This is a widely used in the IT industry and business among large frame. So, if you like the encoding, then JavaScript might be a good choice.

  1. Python

As a relatively modern programming language, Python is usually by novice programmers alike. In essence, Python has a simple English-like syntax. You can take advantage of Python code on the server to create a Web-based application that can take advantage of its docking database systems, even large data and perform complex mathematical operations. In addition, Python most attractive place lies in its ability to use the new line to complete a command - In contrast, other programming languages ​​generally require the use of semicolons, or brackets, which undoubtedly will make the code structure looks complicated.

No matter what your actual direction, Python are bound to occupy a place in this recommended list. In fact, almost every block chain ecosystem which there are one or more of the use of the disclosed tool written in the Python. Python's popularity has also been improved rapidly.

Python's advantages and shortcomings

Example block chain with Python

In the block chain field, Python is used for the preparation of contracts for the smart Hyperledger platform. In addition, Python in numerous other projects such as Ethernet Square also has its own achievement of results (eg pyethereum). Python has also been used to create the NEO contract.

  1. Go

GoLang language, or we used to call GO, is a relatively modern general-purpose language, developed in 2007 by Google, Inc., and the official public release in 2012. Go is a statically typed language, its syntax is somewhat similar to the C language. And for a robust and versatile as the stated objectives of language, Go try to modern languages ​​(such as Python and JavaScript, etc.) syntax and user-friendliness, combined with the performance and security advantages of the C language. Go is a compiled language, provides a wealth of standard libraries. When we use the Go language in several components block chain project, this feature can provide us with the greatest degree of flexibility advantages.

In Go, we can use a plurality of Goroutines implemented method for a plurality of programs or program parts run parallel or asynchronous, and this ability to block chain just fit features highlighted item is emphasized. In general, Java and other programming languages ​​is required Threads to achieve this.

Go strengths and shortcomings

Go block chain used in Example

Block chain related projects Golang very much, here I only listed a few high popularity entry. First Go-Ehtereum, which is one of the most important items to use Golang language. Another main project prepared by the same Go is made Hyperledger Fabric, it has become one of the favorite types of enterprises giant block chain solutions. Again, Loom Network project specifically for online gaming to the center of this exciting results also included the use of writing Go chain code.

5.Solidity

Solidity is a development of Ethernet Square team (Gavin Wood, Christian Reitwiessner, etc.), similar to JavaScript, dedicated, high-level object-oriented language. Solidity by C ++, Python and profound impact on JavaScript used to create decentralized applications on Ethernet and Ethernet Square Square platform virtual machine (referred to as EVM). Incidentally, EVM involves running written contracts intelligent Ethernet Square on the platform environment. Solidity is a statically typed language that supports inheritance, libraries, and complex user-defined types. As of now, it is still a block chain Ethernet Square community and industry in which the applicability of the most decentralized application development language.

To sample code Solidity of experience, you can use Remix IDE. Remix is ​​a web browser-based IDE, which provides integrated compiler and run-time environment Solidity and does not require any server side components. Solidity Remix allows you to write code and a smart contract to deploy and run.

Solidity strengths and shortcomings

Solidity block chain used in Example

Solidity language mainly for the development of intelligent Ethernet Square contract. At present, I have not seen that is actually used in any other type of project. But the good news is that the etheric body mass Square development ecosystem itself has been very impressive, and has become an area of ​​block chain development is the most important part of the current. This alone, Solidity among smart enough to contract the development of one of the most popular language options.

to sum up

Block chain technology is expected to bring a huge impact on every industry and market level. We believe that in the next few months to a few years, global decentralized level will continue to increase, while the block chain technology will eventually become the new mainstream technology. The face of this infinite space for development, still hesitate? And quickly learn it!

Guess you like

Origin blog.csdn.net/weixin_44172023/article/details/91414418