In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This practice is based on Huawei Cloud blockchain service and takes the marble asset transfer Marbles Demo deployment based on blockchain as an example to help you understand the basic knowledge of chain code and how to use Fabric network to develop applications to help you get started quickly.
About Demo
This is a simple demonstration of asset transfer, where multiple users can create and transfer marble assets to each other, and you can also see detailed transaction information and blockchain information. The interface is as follows:
× × ×
If you need to view the source code of Demo application, please click download source code to download and view. I hope it will be helpful to your application development. Preparatory work
Huawei cloud blockchain service is deployed based on the cluster built by the container. At the same time, in order to ensure normal access to the public network and ensure that data is not lost, the corresponding environment preparation work needs to be completed before deploying the blockchain service, which in turn are: creating cluster, binding elastic IP, and creating file storage.
Create a cluster: here you need to create a cluster called marbles-test, please use CCE 1.9 or above. It is recommended that you purchase a virtual machine when creating a cluster: one, 4U8G.
Bind elastic IP: apply for an elastic IP and bind it to the elastic CVM to achieve the purpose that the elastic CVM can be accessed by the public network.
Create file storage: after the container cluster is created successfully, create a file store to store data. You can use the default specification when creating a file storage. Order blockchain service
Log in to the blockchain service management console. Purchase deployment service with the following parameters:
Install instantiated chain code
Download the link code marbles.zip.
Click chain Code & Block Management in the action column of the service list. As follows
Click the installation chain code and fill in the parameters:
After the chain code is installed, in the actions column of the chain code list, click instantiate. Fill in the parameters:
Configure application
Prepare a server with at least 2 gigabytes of available memory for deploying Demo applications.
Certificate download:
Log in to the prepared server and create a demo directory locally.
Download the certificate for the corresponding service in the service management interface of the blockchain service.
Currently, two types of certificates are supported: administrator certificate and user certificate. In this example, you need to download a consensus organization administrator certificate and a node administrator certificate.
Upload and save the downloaded certificate file to the demo directory you just created.
Download SDK configuration:
In the Service Management interface, click more > download SDK configuration. Fill in the parameters
The downloaded file is marbles-sdk-config.zip. Save it to the demo directory you created.
Start script download
Startserver.sh
Save it to the demo directory that you created.
The structure of the final demo directory can be found in the following figure:
Deploy the application
Go to the demo directory and execute the command to start the service.
Bash startserver.sh swr.cn-north-1.myhuaweicloud.com/graham/marbles:1.0Demo experience
Access the application (please use a Chrome browser to access it).
After the Demo application runs successfully, access the portal of the Marbles Demo application through "http://EIP: Port", where EIP is the IP of the server where the Demo is deployed or the floating IP of the elastic cloud server.
Create marbles
Click "+", fill in the configuration item, click "create" to create marbles, and a few seconds later new marbles appear. If no new marbles appear, use the F5 key to refresh the page.
Trading marbles
Drag the marble to another user to simulate the transaction, and during the transaction, the marble will disappear temporarily and then be redrawn in the new owner.
Wait, wait, wait. Try it yourself. At the same time of the transaction, you can view the current block height and block content and other details in the interface.
Only a general introduction is given in this document. Click here for detailed documentation.
Original: https://blog.csdn.net/weixin_43682574/article/details/84444405
Copyright notice: this article is the original article of the blogger, please attach a link to the blog article to reprint it!
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.