区块链peer节点,pt区块链
区块链peer节点:区块链peer节点是区块链技术的重要组成部分,它们是一种分布式网络,由节点组成。每个节点都拥有一份完整的区块链副本,并且可以与其他节点进行交互。peer节点是区块链网络中最重要的一部分,它们负责维护网络的安全性,确保网络中的交易正确无误。此外,peer节点还可以提供智能合约的执行环境,参与网络的共识机制,以及参与区块链网络的激励机制。
PT区块链拓展:PT区块链拓展是一种新型的区块链技术,它基于普通区块链技术,可以实现更高效的数据存储和传输。它的核心思想是将数据存储在一系列可拓展的节点中,从而提高网络的可用性和可扩展性。PT区块链拓展可以让网络更加安全可靠,同时也可以提高网络的处理能力,提高数据的传输速度和存储空间。此外,它还可以提供更多的安全性,确保网络中的交易安全无误。
分布式账本:分布式账本是区块链技术的一个重要组成部分,它是一种分布式数据库,用于记录交易信息。它的核心思想是将交易信息存储在一系列可拓展的节点中,从而提高网络的安全性和可用性。分布式账本可以让网络更加安全可靠,同时也可以提高网络的处理能力,提高数据的传输速度和存储空间。此外,它还可以提供更多的安全性,确保网络中的交易安全无误。
请查看相关英文文档
㈠ What is the development trend of blockchain?
Since blockchain is going to become a future development trend, blockchain technology definitely has its own advantages over traditional technology.
1. Decentralization.
The core advantage of blockchain technology is that it does not require a traditional centralized institution. In a distributed system, it does not rely on point-to-point transactions, coordination and collaboration of a certain credit center, thus avoiding the ubiquitous data problems of centralized institutions. Issues such as safety, collaborative efficiency and risk control.
2. High safety.
In blockchain technology, data is difficult to tamper with. The database recording transactions can be accessed by anyone. In this transparent and open model, everyone can act as a supervisor. Everyone can see any changes in the data at a glance, which is more secure than traditional technology.
3. More reliable.
Blockchain technology connects multiple nodes in different places. The nodes in the blockchain interact through point-to-point communication protocols. Different nodes can be used by different developers using different programming languages while ensuring consistent communication protocols. , different versions of full nodes to process transactions.
Simply put, when a node encounters network problems, hardware failures, software errors, or is controlled by hackers, it will not affect the operation of other participating nodes and the system.
So compared to traditional technology, blockchain is more reliable.
So I firmly believe that the application of blockchain must be the future development trend.
㈡ What is the development trend of blockchain, and what about Heshu chain technology?
The development trends of blockchain are:
01. The long-term direction of the blockchain industry Well, the core value is generally recognized;
02. Technology development is more pragmatic, with engineering and ecological construction becoming the focus;
03. Blockchain and privacy computing develop collaboratively;
04. Blockchain Chain interconnection has become the focus, and the future of value interconnection is promising;
05. The call for blockchain infrastructure is gradually rising, and the construction model still needs to be explored in depth;
06. Blockchain cannot conquer the world, and needs to cooperate with many Technology cooperation completes digital transformation;
07. The application of certificate storage takes the lead, gradually moving towards multi-party collaboration and value transfer;
08. The importance of the blockchain alliance business model is further highlighted;
09. Government Support will still be an important driving force for industrial development in the future;
10. As the scale of blockchain practitioners increases, the relative shortage of talents will continue to exist.
(2) Extended reading of traditional pe blockchain:
Blockchain is a chain composed of blocks one after another. Each block stores a certain amount of information, and they are connected into a chain in the order in which they were generated. This chain is saved in all servers. As long as one server in the entire system can work, the entire blockchain is safe. These servers are in the blockchain systemThey are called nodes, and they provide storage space and computing power support for the entire blockchain system. If you want to modify the information in the blockchain, you must obtain the consent of more than half of the nodes and modify the information in all nodes. These nodes are usually in the hands of different subjects, so it is extremely difficult to tamper with the information in the blockchain. thing. Compared with traditional networks, blockchain has two core characteristics: first, data is difficult to tamper with, and second, it is decentralized. Based on these two characteristics, the information recorded in the blockchain is more authentic and reliable, and can help solve the problem of people's mutual distrust.
Blockchain is still mainly used for certificate storage. For example, the application of blockchain in supply chain finance, product traceability, trade finance and other fields has achieved certain results, but its application model is still based on documents, contracts, The main thing is the deposit certificate of the bill. As the industry application of blockchain continues to deepen, in order to further promote the role of blockchain in promoting the development of the real economy, in the future, we will focus on the development of multi-party collaboration and value transfer applications.
Blockchain is not just a technology, but also a concept and a cooperation model. Blockchain will connect upstream and downstream parties in the industry, and it is necessary to rely on the common interests of the alliance to bring together all participants. At present, there are two main organizational models of blockchain alliances, namely, core organization leadership and participating organizations co-governance. Both blockchain alliance business models also have their own pros and cons. For the long-term and stable development of the alliance, how to build and which kind to build The model also requires continued in-depth exploration by the industry.
㈢ What is blockchain
Blockchain is a database with a data "hash verification" function. Blocks are data blocks. Data blocks are combined into a chain structure in chronological order, and cryptographic algorithms are used to collectively maintain the reliability of the database in a distributed accounting manner. All data blocks are connected in chronological order, forming a blockchain.
The blockchain system consists of data layer, network layer, consensus layer, incentive layer, contract layer and application layer. Among them, the data layer encapsulates the underlying data blocks and related basic data and algorithms such as data encryption and timestamps; the network layer includes distributed networking mechanisms, data dissemination mechanisms and data verification mechanisms; the consensus layer mainly encapsulates network nodes Various consensus algorithms; the incentive layer integrates economic factors into the blockchain technology system, mainly including the issuance mechanism and distribution mechanism of economic incentives; the contract layer mainly encapsulates various scripts, algorithms and smart contracts, and is the core of the blockchain The basis of programmable features; the application layer encapsulates various application scenarios and cases of the blockchain. In this model, the chain block structure based on timestamps, the consensus mechanism of distributed nodes, economic incentives based on consensus computing power, and flexible programmable smart contracts are the most representative innovations of blockchain technology.
Blockchain mainly solves the trust and security issues of transactions, so it proposes four technological innovations for this problem:
(1) Distributed ledger, which means that transaction accounting is performed by multiple accounts distributed in different places. The nodes work together, and each node records a complete account, so they can all participate in supervising the legality of the transaction, and at the same timecan jointly testify for it.
Different from traditional distributed storage, the uniqueness of blockchain distributed storage is mainly reflected in two aspects: First, each node of the blockchain stores complete data according to the block chain structure. Distributed storage generally divides data into multiple parts for storage according to certain rules. Second, the storage of each node in the blockchain is independent and has equal status, relying on the consensus mechanism to ensure storage consistency, while traditional distributed storage generally synchronizes data to other backup nodes through the central node. [8]
No node can record ledger data independently, thus avoiding the possibility of a single bookkeeper being controlled or bribed to record false accounts. Also because there are enough accounting nodes, theoretically speaking, the accounts will not be lost unless all nodes are destroyed, thereby ensuring the security of the accounting data.
(2) Asymmetric encryption and authorization technology. The transaction information stored on the blockchain is public, but the account identity information is highly encrypted and can only be accessed with authorization from the data owner, thus ensuring data security and personal privacy.
(3) Consensus mechanism is how all accounting nodes reach a consensus to determine the validity of a record. This is both a means of identification and a means of preventing tampering. Blockchain proposes four different consensus mechanisms, which are suitable for different application scenarios and strike a balance between efficiency and security.
The consensus mechanism of the blockchain has the characteristics of "the minority obeys the majority" and "everyone is equal". "The minority obeys the majority" does not entirely refer to the number of nodes, but can also be computing power, the number of shares, or other computers. Feature quantities that can be compared. "Everyone is equal" means that when a node meets the conditions, all nodes have the right to give priority to the consensus result, which will be directly recognized by other nodes and may eventually become the final consensus result. Taking Bitcoin as an example, it uses proof of work. Only when more than 51% of the accounting nodes in the entire network are controlled, it is possible to forge a non-existent record. When there are enough nodes joining the blockchain, this is basically impossible, thus eliminating the possibility of fraud.
(4) Smart contracts, smart contracts are based on these trustworthy and non-tamperable data and can be automated Enforce some predefined rules and terms. Take insurance as an example. If everyone's information (including medical information and risk occurrence information) is true and trustworthy, it will be easy to carry out automated claims settlement in some standardized insurance products
In fact Individuals can simply understand that it is actually a financial database.
What are the characteristics of blockchain technology?
The four major characteristics of blockchain technology include: decentralization; trustlessness; scalability; anonymity. Decentralization: Due to the use of distributed computing and storage, there is no centralized hardware or management organization in the blockchain system. Therefore, the rights and obligations of any node are equal, and the data blocks in the system are maintained by the entire system. nodes to jointly maintain. Openness: The system is open, except for transactionsIn addition to the encryption of the private information of all parties, the blockchain data is open to everyone. Anyone can query the blockchain data and develop related applications through the public interface, so the entire system information is highly transparent. Autonomy: The blockchain adopts consensus-based specifications and protocols (such as a set of open and transparent algorithms) to enable all nodes in the entire system to exchange data freely and securely in a trustless environment, so that trust in "people" is exchanged. It has become a trust in the machine, and no human intervention will work. Information cannot be tampered with: Once the information is verified and added to the blockchain, it will be stored permanently. Unless more than 51% of the nodes in the system can be controlled at the same time, modifications to the database on a single node will be invalid, so the area The data stability and reliability of blockchain are extremely high. Anonymity: Since the exchanges between nodes follow a fixed algorithm, the data interaction does not require trust (the program rules in the blockchain will judge whether the activity is valid by itself), so the counterparty does not need to reveal its identity to the other party. Generating trust is very helpful for the accumulation of credit. Reliability: The data on the blockchain saves multiple copies, and the failure of any node will not affect the reliability of the data. The consensus mechanism makes modifying large numbers of blocks extremely costly and almost impossible. Destroying data is not in the self-interest of important participants. This practical design enhances the reliability of data on the blockchain and global circulation: blockchain assets are first based on the Internet. As long as there is the Internet, blockchain assets can be circulated. The Internet here can be the World Wide Web or various local area networks, so blockchain assets are circulated globally. As long as there is the Internet, blockchain assets can be transferred. Compared with centralized methods, the transfer fees for global circulation of blockchain assets are very low. For example, the early transfer fee for Bitcoin was 0.0001 BTC. Compared with traditional transfers, Generally speaking, blockchain assets arrive very quickly. It usually takes a few minutes to an hour to arrive.
㈤ Blockchain Encyclopedia: The Past and Present of Blockchain - 3.0 Era
The representative of the blockchain 1.0 era is Bitcoin, the representative of the 2.0 era is Ethereum, and The chaotic era of various copycats and air coins. Blockchain 3.0 is the era of consumer-level blockchain that has truly entered commercial and physical applications after the troubled times. The typical symbol is the emergence of tokens. The pass has brought about changes in traditional business models and production relations. The pass has moved from the digital world to the real economy and has begun to seek practical applications in various industries.
The pass has three elements, one of which is indispensable.
Pass: The pass can be circulated on a large scale in a network and can be verified anytime and anywhere; Certificate: As a proof of digital rights and interests, the pass must be a certificate of rights and interests that exists in digital form, and it must represent It is a right, an inherent and intrinsic value; value: the token must have economic value.
In this way, the meaning of "token economy" alsoIt is not difficult to understand. The token economy is a large-scale group collaboration based on tokens. It maximizes the role of tokens, allows every role that creates value to share value fairly, fully mobilizes participation motivation, and forms a self-organizing form.
Major changes in the blockchain 3.0 era
The token economy has laid the theoretical basis and technical support for the large-scale application of blockchain, and the future world will also be transformed by it. Large-scale changes include:
1. Fragmented investment, fragmented income, subverting the traditional way of doing business on the Internet. In the traditional Internet era, it was impossible for ordinary people to participate in the investment of a company, but the emergence of blockchain allows ordinary people to make fragmented investments in a large asset. Assuming that Alibaba originally adopted blockchain for fragmented investment, then all fragmented shareholders who invested in Alibaba would be able to reap a return on investment that has increased thousands of times today!
2. Break the money-burning model of the Internet and make everyone a winner. The free model of the traditional Internet is essentially to obtain a large number of users through free products to form monopolies and barriers, and then make profits through advertising and value-added services on this basis. In the blockchain 3.0 era, project income is redistributed by issuing tokens to attract more early investors and community users. As the number of users holding tokens increases, the value of the tokens will become higher and higher, and community users, investors, and projects can all benefit from it. In this way, the money-burning model of providing free services in the early days of the traditional Internet can also be improved, and everyone will become a winner.
3. Breaking down the traditional corporate organizational hierarchy, self-organization may become a future trend. In the blockchain 3.0 era, through the establishment of distribution and collaboration mechanisms through smart contracts, it can be more efficient and accurate than enterprises. All token owners will naturally form a community. Everyone has the same goal - "to promote the development of the project and make it a success". They are all members of the community, contribute to the community, promote the value-added of the token, and thereby gain benefits together. profit. From a philosophical perspective, this new self-organizing community of freedom, independence, and equality must be the future trend. Gojoy blockchain e-commerce is a self-organized community of blockchain. Every consumer is a token owner and a fragmented investor, so he is very happy to co-create and build Gojoy value.
Therefore, we can look forward to the era of great development of the blockchain 3.0 token economy, and the existing ones may be subverted. What we need to be prepared for is to work hard to embrace the blockchain. If you want to seize the trend of blockchain and understand how to transform into blockchain, please leave a message to communicate and we will take you to learn the blockchain professional certification course.
㈥ Blockchain technology concept
Blockchain technology concept
Blockchain technology concept, nowadays,Blockchain has become an area of concern for most people, and many companies have already studied the technology in depth. However, there are still people who do not know much about it. Below I will share an article about the concept of blockchain technology.
Blockchain technology concept 1Basic concepts and working principles of blockchain
1. Basic concepts
Blockchain is a distributed data storage, point-to-point New application models of computer technologies such as transmission, consensus mechanisms, and encryption algorithms. The so-called consensus mechanism is a mathematical algorithm that establishes trust and obtains rights and interests between different nodes in the blockchain system.
Blockchain is an important concept of Bitcoin. It is essentially a decentralized database and serves as the underlying technology of Bitcoin. The blockchain is a series of data blocks generated using cryptographic methods. Each data block contains information about a Bitcoin network transaction, which is used to verify the validity of the information, prevent counterfeiting, and generate the next block.
In a narrow sense, blockchain is a chained data structure that combines data blocks in a sequential manner in chronological order, and is cryptographically guaranteed to be non-tamperable and non-tamperable. Fake distributed ledger.
Broadly speaking, blockchain technology uses block chain data structures to verify and store data, uses distributed node consensus algorithms to generate and update data, and uses cryptography to ensure data transmission and access. It is a new distributed infrastructure and computing method that uses smart contracts composed of automated script codes to program and operate data securely.
2. Working principle
The blockchain system consists of data layer, network layer, consensus layer, incentive layer, contract layer and application layer. Among them, the data layer encapsulates the underlying data blocks and related basic data and algorithms such as data encryption and timestamps; the network layer includes distributed networking mechanisms, data dissemination mechanisms and data verification mechanisms; the consensus layer mainly encapsulates network nodes Various consensus algorithms; the incentive layer integrates economic factors into the blockchain technology system, mainly including the issuance mechanism and distribution mechanism of economic incentives; the contract layer mainly encapsulates various scripts, algorithms and smart contracts, and is the core of the blockchain The basis of programmable features; the application layer encapsulates various application scenarios and cases of the blockchain. In this model, the chain block structure based on timestamps, the consensus mechanism of distributed nodes, economic incentives based on consensus computing power, and flexible programmable smart contracts are the most representative innovations of blockchain technology.
Blockchain mainly solves the trust and security issues of transactions, so it proposes four technological innovations to address this issue:
1. Distributed The ledger means that transaction accounting is completed by multiple nodes distributed in different places, and each node records a complete account, so they can all participate in supervising the legality of the transaction and can also jointly testify for it.
Different from traditional distributed storage, the uniqueness of blockchain distributed storage is mainly reflected in two aspects: First, each node of the blockchain stores complete data according to the block chain structure. For data, traditional distributed storage generally divides the data into multiple parts for storage according to certain rules. Second, the storage of each node in the blockchain is independent and has equal status, relying on the consensus mechanism to ensure storage consistency, while traditional distributed storage generally synchronizes data to other backup nodes through the central node. [8]
No node can record ledger data independently, thus avoiding the possibility of a single bookkeeper being controlled or bribed to record false accounts. Also because there are enough accounting nodes, theoretically speaking, the accounts will not be lost unless all nodes are destroyed, thereby ensuring the security of the accounting data.
2. Asymmetric encryption and authorization technology. Transaction information stored on the blockchain is public, but account identity information is highly encrypted and can only be accessed with authorization from the data owner. , thus ensuring data security and personal privacy.
3. The consensus mechanism is how all accounting nodes reach a consensus to determine the validity of a record. This is both a means of identification and a means of preventing tampering. Blockchain proposes four different consensus mechanisms, which are suitable for different application scenarios and strike a balance between efficiency and security.
The consensus mechanism of the blockchain has the characteristics of "the minority obeys the majority" and "everyone is equal". Among them, "the minority obeys the majority" does not entirely refer to the number of nodes, but can also be the computing power and the number of shares. Or other characteristic quantities that the computer can compare. "Everyone is equal" means that when a node meets the conditions, all nodes have the right to give priority to the consensus result, which will be directly recognized by other nodes and may eventually become the final consensus result. Taking Bitcoin as an example, it uses proof of work. Only when more than 51% of the accounting nodes in the entire network are controlled, it is possible to forge a non-existent record. When there are enough nodes joining the blockchain, this is basically impossible, thus eliminating the possibility of fraud.
4. Smart contracts. Smart contracts are based on these trustworthy and non-tamperable data. Some predefined rules and terms can be automatically executed. Take insurance as an example. If everyone's information, including medical information and risk occurrence information, is true and trustworthy, it will be easy to implement automated claims settlement in some standardized insurance products.
3. Others
The Internet exchanges information, and the blockchain exchanges value. Human history and the history of the Internet can be understood in eight words: if they are divided for a long time, they must be combined. For a long time, they must be combined. In the era of long-term separation, all network information is scattered on the Internet. It is very difficult for everyone to mine information. At this time, platforms such as Google and Facebook will appear. , the only thing it does is recombine all our information. Internet timeWhat the monopoly giants reorganize is information, rather than generating their own information. The information generated is entirely our own. Once the information is reorganized, a new monopoly giant will emerge, so it will be an era of long-lasting separation. Now, due to the emergence of blockchain technology, it has entered an era of long-term integration and inevitable division. It is a new multi-centralization. After the new multi-centralization, new value will be generated. These data will be in our own hands, and personal data will generate value. It belongs to oneself. This is the most exciting era of this era.
What is the value of blockchain? A low-cost mechanism to establish trust, establish data rights, and resolve data property rights.
At present, blockchain technology continues to develop, including the current development of single chains to multi-chains, and the technology can be further expanded. I think there may still be disruptions in the future, especially in transactions and other aspects. , especially many disruptive scenarios for existing industries.
The essence of blockchain is to establish trusted information exchange on untrustworthy networks.
One Belt, One Road + One Chain. The bigger thing about blockchain is not to create trust, but to allow trust to be transmitted losslessly, reducing the friction cost of society as a whole, thereby improving the overall efficiency.
Now the blockchain itself is still in its initial stage, so it includes the information transmission and encryption of the blockchain. Quantum encryption and other encryption appear in this process, which actually attacks the encryption algorithm used by the blockchain itself. This phenomenon also occurs from time to time. Including blockchain is also a recognition of assets, a recognition of digital assets, but now many of us use cryptographic algorithms, or as the key for us to decrypt, but if you forget the password, it is very likely that your current assets will be lost. If you lose them, you won't be able to get back your original assets. Therefore, there are still some hidden dangers in asset management, including information transmission and some security aspects. Of course, from a technical perspective, the processing speed of our blockchain itself, or its scalability, is because from the perspective of the working mechanism, the entire ledger must be copied to all participants, so in the blockchain Its operational efficiency and scalability are still relatively limited. We feel that these still need further development in terms of technology.
The underlying technologies of the blockchain platform also form blockchain wallets, blockchain browsers, node elections, mining machines, mining pools, development components, development modules, technical communities and project communities. and a series of ecosystems. The perfection of these ecosystems directly determines the efficiency and effectiveness of the underlying platform of the blockchain.
4. Mundell’s Impossible Triangle
It is impossible to achieve the ultimate in decentralization, efficiency, and security at the same time.
Blockchain technology concept 2The essence of blockchain is a distributed accounting technology, as opposed to centralized accounting technology, which is widely used in our current lives. exist. Blockchain is a distributed data storage, point-to-point transmission, consensus mechanism, andNew application models of computer technology such as encryption algorithms.
Blockchain is an important concept of Bitcoin. It is essentially a decentralized database. At the same time, as the underlying technology of Bitcoin, it is a series of related cryptographic methods. Each data block contains a batch of Bitcoin network transaction information, which is used to verify the validity and anti-counterfeiting of the information and generate the next block.
In a narrow sense, blockchain is a chained data structure that combines data blocks in a sequential manner in chronological order, and is cryptographically guaranteed to be non-tamperable and non-tamperable. Fake distributed ledger.
Broadly speaking, blockchain technology uses block chain data structures to verify and store data, uses distributed node consensus algorithms to generate and update data, and uses cryptography to ensure data transmission and access. It is a new distributed infrastructure and computing method that uses smart contracts composed of automated script codes to program and operate data securely.
The popular understanding of blockchain technology is: connecting the front, back, left, and right blocks of "things" into a chain using one technology, but each block The original data of the block cannot be tampered with. It is a "linked module" technology in the field of Internet of Things that allows participants to trust. The application of blockchain technology is inseparable from the Internet and the Internet of Things. It is based on the integration and interaction of the two, but allows participants to remain independent, decentralized, and work together. With this set of value chain co-construction and sharing, technology.
Characteristics of blockchain: decentralization, openness, autonomy, information cannot be tampered with, and anonymity.
Blockchain is a network that can deliver value. The demand for a network that can deliver value is an important reason for the emergence of blockchain technology. Blockchain emerged driven by the need to protect information with ownership or other value. Through public and private key cryptography, distributed storage and other technical means, blockchain ensures on the one hand the efficient transmission of valuable information, and on the other hand ensures that this information will not be easily copied and tampered with during the transmission process.
Understand the connotation of blockchain from the inevitability of its birth. Blockchain is a distributed accounting technology that solves the shortcomings of centralized accounting and solves the problem of distributed consistency. It is also a The connected Internet is upgraded to a value network that ensures the safe and efficient transmission of valuable information.
Blockchain Technology Concept 3Blockchain: Blockchain is like a globally unique account book, or database, which records the history of all transactions in the network.
Ethereum Virtual Machine (EVM): It allows you to write more powerful programs on Ethereum and script programs on Bitcoin. It is also sometimes used to refer to the Ethereum blockchain, which is responsible for executing smart contracts and everything.
Node: You can run a node and read and write Ethereum through itBlockchain, that is, using the Ethereum Virtual Machine. Full nodes require downloading the entire blockchain. Light nodes are still under development.
Miner: Mining, that is, the node that processes blocks on the blockchain. You can see some of the currently active Ethereum miners on this page: stats.ethdev.com.
Proof of Work: Miners are always competing to solve some mathematical problem. The first one to solve the problem (calculate the next block) will be rewarded with Ether coins. All nodes then update their own blockchain. All miners who want to figure out the next block have an incentive to stay in sync with other nodes and maintain the same blockchain, so the entire network can always reach consensus. (Note: Ethereum is planning to move to a proof-of-stake system (POS) without miners, but that is outside the scope of this article.)
Ethereum: Abbreviation ETH. A true digital currency that you can buy and use. Here is a chart from one of the exchanges where Ethereum can be traded. At the time of writing, 1 Ether is worth 65 cents.
Gas: Executing programs and saving data on Ethereum consumes a certain amount of Ethereum. Gas is converted from Ethereum. This mechanism is used to ensure efficiency.
DApp: The Ethereum community calls applications based on smart contracts decentralized applications (Decentralized App). The goal of DApp is (or should be) to have a friendly interface for your smart contracts, plus some extras, such as IPFS, a decentralized network that can store and read data, not from the Ethereum team but in a similar spirit ). DApp can run on a centralized server that can interact with Ethereum nodes, or it can run on any Ethereum equal node. (Take a minute to think about this: Unlike ordinary websites, DApps cannot run on ordinary servers. They need to submit transactions to the blockchain and read important data from the blockchain rather than a centralized database. Compared to typical users When logging into the system, the user may be represented as a wallet address and other user data is stored locally. Many things will be structured differently from current web applications.)
Ethereum client, smart contract language
p>Writing and deploying smart contracts does not require you to run an Ethereum node. Browser-based IDEs and APIs are listed below. But if you are just learning, you should still run an Ethereum node to understand the basic components, and running a node is not difficult.
Clients available for running Ethereum nodes
Ethereum has many client implementations in different languages, that is, multiple methods of interacting with the Ethereum network, , including C++, Go, Python, Java, Haskell, etc. Why do we need so many implementations? different implementationsTo meet different needs, for example, the goal achieved by Haskell is to be mathematically verifiable, to make Ethereum more secure, and to enrich the entire ecosystem.
At the time of writing this article, I am using the client geth (go-ethereum) implemented in the Go language. At other times, I also use a tool called testrpc, which uses the Python client pyethereum. Later examples will use these tools.
About mining: Mining is fun, a bit like caring for your houseplant, but also a way to learn about the entire system. Although the current price of Ethereum may not even cover the electricity bill, who knows in the future. People are creating many cool DApps that may make Ethereum more and more popular.
Interactive console: Once the client is running, you can synchronize the blockchain, create a wallet, and send and receive Ethereum. One way to use geth is through the Javascript console. In addition, you can use cURL-like commands to interact with the client through JSON RPC. The goal of this article is to take you through the process of DApp development, so I won’t go into details about this. But we should remember that these command line tools are useful for debugging, configuring nodes, and using wallets.
Running the node on the test network: If you run the geth client on the official network, it will take quite a while to download the entire blockchain and synchronize with the network. You can determine if synchronization has occurred by comparing the last block number printed in the node logs with the latest block listed on stats.ethdev.com. ) Another problem is that running smart contracts on the official network requires real Ethereum. Running the node on the test network does not have this problem. At this time, there is no need to synchronize the entire blockchain. Just create your own private chain, which saves time for development.
Testrpc: Use geth to create a test network. Another faster way to create a test network is to use testrpc. Testrpc can help you create a bunch of test accounts with funds at startup. It also runs faster and is therefore better suited for development and testing. You can start with testrpc, and then as the contract slowly takes shape, move to the test network created by geth - the startup method is very simple, you only need to specify a networkid: geth --networkid "12345". Here is the code repository for testrpc, we will talk about it again below.
Next, let’s talk about the available programming languages, and then we can start the real programming. Solidity is the programming language used to write smart contracts.
There are several languages to choose from to write smart contracts: Solidity, which is somewhat similar to Javascript, and the file extension is .sol. and PPython is close to Serpent, and the file name ends with .se. There is also a Lisp-like LLL. Serpent has been popular for a while, but now the most popular and stable one is Solidity, so just use Solidity. I heard you like Python? Use Solidity.
solc compiler: After writing the smart contract with Solidity, you need to use solc to compile it. It is a component from a C++ client implementation. Again, different implementations complement each other. Here is how to install it. If you don't want to install solc, you can also use a browser-based compiler, such as Solidity real-time compiler or Cosmo. The programming sections below will assume you have solc installed.
web3.js API. After the Solidity contract is compiled and sent to the network, you can use Ethereum's web3.js JavaScript API to call it and build web applications that can interact with it.
- 上一篇: 2021世界区块链大会门票,2020世界区块链大会
- 下一篇: 关于区块链的书籍推荐,关于区块链的好书