In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
The main content of this article is to explain "what is the Tendermint block chain". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what the Tendermint blockchain is.
IOV Weave SDK is a blockchain development framework based on the Tendermint consensus engine. Weave provides many common functional preset modules for your own blockchain, as well as custom extensions.
Some of the highlights of Weave include data storage based on Merkle trees, highly flexible extension support systems, and customization of core logic (such as fee mechanism and signature verification mechanism). Weave also supports the ability to customize using Genesis documents. In addition, on top of the key-value library, Weave provides a simple object-relational mapping layer (ORM) that supports secondary indexes. Weave also includes a dynamic migration function that allows you to switch some logical modules on or off using transactions on the chain.
1. Preset module
To quickly grasp the development of Tendermint block chain, we recommend the detailed explanation of Tendermint block chain development of Huizhi net.
The Weave development framework includes common functional modules needed to develop an application block chain:
Cash: wallet module, supporting tokens and service charge deduction
Sigs: signature module for verifying ed25519 signatures
Multisig: multi-signature module, which is used to support multi-signature contracts and allows members to modify their membership.
AtomicSwap: atomic exchange module that supports cross-chain atomic exchange
Escrow: escrow module where the arbitrator can safely hold tokens or release escrow funds based on timeout rules
Governance: governance module, managing the election of proposed governance rules on the chain, or directly modifying application parameters
PaymentChannels: one-way payment channel module to achieve micro-payment and chain settlement
Distribution: allocation module, which uses configuration information to distribute income among multiple participants, which can be used to distribute fee income
Batch: batch processing module for integrating multiple transactions into a single atomic operation. An application scenario is switching on a single chain.
Validators: verifier module for updating the set of verifiers in the context of PoA consensus, using multi-signature or chain election module
Username: user name module, which maps the user name to the address on the chain and supports reverse query
MessageFee: message handling module, used to combat spam
Utils: a tool module with a set of commonly used accessibility functions
2. Overview of Weave development framework
To use the Weave development framework, you need two components:
Customized ABCI blog application provided by blog:weave
Tendermint: blockchain consensus engine
If you have not been exposed to Tendermint, it is recommended to refer to Huizhi.com 's Tendermint development tutorial.
The application communication framework of Weave is as follows:
+-+ | blog | | Tendermint | | client | +-+
Blog and tendermint run on the same computer and communicate through the binary TCP/IP protocol or UNIX sockets, which combine to form a blockchain. In a real production environment, you may have multiple computers running this back end, replicating the state through self-tuning P2P gossip protocol communication. For application development, one node is enough, but a single node has no fault tolerance.
You can use any websocket client to connect to tendermint's rpc, but we recommend using IOV core, which is the same product as Weave and has better support for the Weave development framework.
Before installing the above two components, you need to install the following components on your computer:
Golang 1.11.4 +
Tendermint 0.31.5
Weave
Docker
Then clone the blog code base and check out the compatible version according to the compatibility table. For example:
# cd into to your workspace that is not in your $GOPATHgit clone https://github.com/iov-one/blog-tutorialcd blog-tutorialmake install# test it built properlytendermint version# 0.3X.X-YYYYYYYYblog version# v0.1X.X-YYYYYYYY3, initialize the application block chain
Before starting the blockchain, we need to use the Genesis block to set the initial state. Both tendermint and blog have a directory to hold configuration information and internal database status. The default directories are: ~ / .tendermint and ~ / .blog. However, to simplify the consideration, we put all the configuration information in the same directory.
First, create a default creation file, the private key used to sign the block, and the default configuration file:
# make sure you really don't care what was in this directory and...rm-rf ~ / .blog # initialize state on default folder ~ / .blogmake inittm
You can browse through this directory, the most important of which is ~ / .blog / config/genesis.json, which also contains a lot of options in the configuration file ~ / .blog / config/config.toml.
Before starting the blockchain, we need to add a batch of tokens to the account we just created, and also enable the indexer so that we can search for transactions by id. However, instead of modifying the configuration file directly, we use the following command:
Blog init CASH bech42:tiov1qrw95py2x7fzjw25euuqlj6dq6t0jahe7rh8wp
Make sure the address you enter is the same as above. This account now has tokens. After running the above command, you can also take a look at ~ / .blog / config/genesis.json. The more important modification is "app_state".
You might ask where this address came from. This is a demo account generated using the following test mnemonic words:
Dad kiss slogan offer outer bomb usual dream awkward jeans enlist mansion
The derivation path of the account is: m _ 0'
4. Start the application block chain
Now that we have the private key and configured, we are ready to launch our blog application block chain:
# start the tendermint with default configmake runtmblog start
The above command connects to tcp://localhost:26658. If you want to use unix sockets, you can use the following command:
Tendermint node-- home ~ / .blog-- proxy_app=unix://$HOME/abci.socket > ~ / .blog/tendermint.log & blog start-bind=unix://$HOME/abci.socket
Open a new terminal window and use the command tail-f ~ / .blog / tendermint.log to see the output of our blog block chain node:
At this point, I believe you have a deeper understanding of "what the Tendermint blockchain is". 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.
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.