Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Brief introduction of tendermint and Construction of Development Environment

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article focuses on "introduction to tendermint and the construction of the development environment". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn "introduction to tendermint and the construction of the development environment"!

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 the built-in key-value pair state machine 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, I believe you have a deeper understanding of the "introduction to tendermint and the construction of the development environment". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report