In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "how to use Bigchaindb in the process of Bytom development". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Step1: build Bytom nodes
Related information: https://github.com/Bytom-Community/Bytom_Docs
There are many ways to build a bytom node, and then turn on the RPC invocation mode. It is recommended to use docker to build the original node: docker to build the original node, and enable the RPC access mode (i.e. terminal interaction mode).
I operate locally here, so the corresponding port is: 9888. After startup, we request a test in postman, as shown below:
It means that we have built the original node and can make remote calls. Let's use the program to call the original node:
Step2: set up bigchaindb node cluster
BigchainDB is a scalable blockchain database with features such as block chain disintermediation and high throughput of distributed database. The code is hosted on github: https://github.com/bigchaindb/bigchaindb
BigchainDB official website is: https://www.bigchaindb.com official website has a lot of information, is the best place to learn BigchinDB!
For an in-depth study of BigchianDB, you can read the BigchainDB white paper "BigchainDB:A Scalable Blockchain Database" and can be downloaded at https://www.bigchaindb.com/whitepaper/. All right, start building a separate BigchianDB node!
Set up a BigchainDB node
For more information on building nodes, please see https://blog.csdn.net/q563730343/article/details/78654314?utm_source=blogxgwz8.
For convenience, here we directly use bigchaindb's test network. If you develop it yourself, you are recommended to build multiple nodes yourself. Test network address: https://test.bigchaindb.com,. Let's test it with postman request, as shown below:
The picture above shows that we asked bigchaindb to test the network, and we can see that the test network has returned normally. Now we can find the corresponding development plug-in for development.
Step3: register assets and store them in bigchaindb
Above we have set up the nodes of Bihara and bigchaindb, let's do the actual development.
First of all, let's find the sdk that matches our development language, so that we can get started with development quickly. Bigchaindb has a lot of sdk: https://github.com/bigchaindb, please filter your own sdk. I use sdk: https://github.com/bigchaindb/go-bigchaindb-driver in go language here.
First download the plug-in package you need and put it under your environment variables (I'll take the golang plug-in as an example here), and then we connect to bigchaindb's test network. We can let our program call bigchaindb test network remotely and interact with it. For detailed code, we can refer to the files in the project, as shown below:
Once connected, we create an asset on Biyuan, and we call the create-asset interface: https://docs.bytom.io/mydoc_rpc_call.cn#create-asset. Then we created the asset BYTOM asset, and we have successfully created the asset in the figure below. Then we create and trade this asset on bigchaindb, as shown below:
Above we have created an asset on the original chain, and then we have created this asset on bigchaindb. In this way, the assets on the original chain can be mapped to bigchaindb for storage, along with a large amount of asset voucher information. The flow information for the entire asset is stored in bigchaindb. The following figure shows us using the program to create trading assets:
Once the asset is created, we store the asset in bigchaindb, and then we request bigchaindb to return the asset we created.
Then we can change and transfer our assets in a similar way. The hsah returned by each transfer change will be stored through the original transaction, and the detailed flow record of the asset will be stored in the bigchaindb, which can effectively reduce the data of the main chain. And improve efficiency.
This is the end of "how to use Bigchaindb in Bytom development". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.