In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what is the method of building and testing the Tendermint development environment". In the daily operation, I believe that many people have doubts about the building and testing methods of the Tendermint development environment. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "what are the building and testing methods of the Tendermint development environment?" Next, please follow the editor to study!
The application of blockchain has developed from simple electronic cash to decentralized voting and other fields, but there are still some difficult problems in the development of distributed systems such as blockchain: security, reliability, agility, consistency guarantee and so on. The purpose of Tendermint is to solve the technical difficulties such as announcement algorithm in the development of distributed systems, and to enable Tendermint block chain application developers to focus on business logic.
Introduction to Tendermint
Tendermint, which originated in cryptocurrencies such as Bitcoin and Ethernet Fong, aims to provide a consensus algorithm that is more efficient and secure than Bitcoin's workload proof (PoW). To put it simply, Tendermint is a software package for secondary development, which can copy the application state safely and consistently on multiple machines.
Tendermint can still work when no more than 1 stroke 3 machine fails, regardless of the cause of the failure. Tendermint implements Byzantine fault tolerance.
Any working machine will receive the same transaction log and deduce the same state respectively.
The features of Tendermint are shown in the following figure:
Tendermint consists of two main components:
Blockchain consensus engine, namely: Tendermint kernel.
Application and block link interface, namely: Application BlockChain Interface.
The Tendermint kernel can host any application state, so block chain software can be developed in any language: Haskell, GoLang, or Rust can be used to develop ABCI applications.
One of the problems with other blockchains is that they are software with single design thinking. Bitcoin, for example, is designed to be monolithic, and its blockchain technology stack is contained in a single program that deals with everything from P2P links to transaction broadcasts, reaching consensus and even checking account balances.
Single applications are usually not easy to expand, upgrade or reuse, while Tendermint strives to decouple the two core components of the blockchain technology stack from other parts: consensus engine and P2P connectivity-- in fact, these are the two most difficult technical aspects of the development zone chain-- so that any development language can be used to develop ABCI applications.
Enough nonsense, let's roll up our sleeves and go to work!
Tendermint development environment building and testing STEP 1: download the Tendermint kernel
The tendermint kernel is developed by Go and has an official precompiled program. Download address: Tendermint Core.
After downloading, extract it directly and add the tendermint program directory to the setting of the environment variable PATH.
STEP 2: initialize Tendermint
Initialize Tendermint by executing the following command:
~ $tendermint init
You should be able to see the output of tendermint on the terminal:
I [10-18 | 20 Generated genesis file module=main path=/Users/niharikasingh/.tendermint/config/genesis.jsonSTEP 14 Generated genesis file module=main path=/Users/niharikasingh/.tendermint/config/genesis.jsonSTEP 08.996] Generated private validator module=main path=/Users/niharikasingh/.tendermint/config/priv_validator.jsonI [10-18 | 20 Generated genesis file module=main path=/Users/niharikasingh/.tendermint/config/genesis.jsonSTEP 14 Swiss 08.996] Generated genesis file module=main path=/Users/niharikasingh/.tendermint/config/genesis.jsonSTEP 3: start the Tendermint node
Start the Tendermint node using the node subcommand:
~ $tendermint node-proxy_app=kvstore
The-proxy_app run flag is used to specify a built-in ABCI application, for example, kvstore is a built-in key-value pair application of the tendermint program. You should see the following tendermint program output:
I [10-18 | 20 Our turn to propose module=consensus height=2 round=0 proposer=601302EBD1F8B4BCE9F99B219965F2796AB6BB10 privValidator= 16 PrivValidator 42.051] enterPropose: Our turn to propose module=consensus height=2 round=0 proposer=601302EBD1F8B4BCE9F99B219965F2796AB6BB10 privValidator= "PrivValidator {601302EBD1F8B4BCE9F99B219965F2796AB6BB10 LH:1, LR:0, LS:3}" I [10-18 | 20 PrivValidator 16 PrivValidator 42.055] Signed proposal module=consensus height=2 round=0 proposal= "Proposal {2max 0 1:48B45F4423A5 (- 1) : 0Proposal 000000000000) F52DF1F111D8 @ 2018-10-18T14:46:42.051967933Z} "I [10-18 | 20VOV 16purl 42.056] Received proposal module=consensus proposal=" Proposal {2gamble 0 1:48B45F4423A5 (- 1 minute step 4: submit the transaction
To submit a deal, you can use curl to make a request to the RPC service of the Tendermint node, for example:
~ $curl http://localhost:26657/broadcast_tx_commit?tx=\"niharika\"
The response results are as follows:
{"jsonrpc": "2.0"," id ":"," result ": {" check_tx ": {" gasWanted ":" 1 "}," deliver_tx ": {" tags ": [{" key ":" YXBwLmNyZWF0b3I= "," value ":" amFl "}, {" key ":" YXBwLmtleQ== " "value": "bmloYXJpa2E="}]}, "hash": "EAAD936D3EDCCCF5DD214E02BB4065E5511CA5AC", "height": "3533"}}
Notice the value field in the result, such as bmloYXJpa2E, which is actually the base64 encoding of the string niharika.
Now let's check it out:
~ $curl-s' localhost:26657/abci_query?data= "niharika"'
The response results are as follows:
{"jsonrpc": "2.0"," id ":"," result ": {" response ": {" log ":" exists "," index ":"-1 "," key ":" bmloYXJpa2E= "," value ":" bmloYXJpa2E= "}
Well, it looks like our Tendermint kernel and ABCI interface are working fine!
At this point, the study on "what is the method of building and testing the Tendermint development environment" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.