In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to run Fabric in IBM Cloud. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Packaged Smart contract
We will use the IBM Blockchain Platform extension on VS Code to package smart contracts.
Open the smart contract panel in VS Code, select the smart contract you want to export, right-click, select "Export Package", find a location on your computer and save the .cds file. Later, we will use this package smart contract to deploy on the IBM Blockchain Platform 2.0 service.
Now we will begin to set up and configure the Hyperledger Fabric network on IBM Cloud.
Create IBM Cloud services
Log in to IBM Cloud and create an IBM Cloud Kubernetes service. You can find the service in the directory. IBM Cloud provides a free cluster instance that expires after 30 days. Note: Kubernetes service setup may take 20 minutes to complete.
Create a fabric network
After you have created the blockchain platform, you can begin to configure the fabric network.
We need to create an organization with a single peer, and its MSP and CA (certification authority) and an order organization, and its MSP and CA. We will create the appropriate identities to deploy the peer node and manipulate the node.
Create org and corresponding nodes
Create peer org CA
Click add Certificate Authority.
Under create Certificate Authority, click IBM Cloud, and then click next.
Name it Org1CA.
Specify admin as Admin ID and adminpw as Admin Secret.
Use this CA to register identities
Select the org1 CA certification authority we created.
First, we will register an administrator for the organization "org1". Click the register user button. Enter org1admin as the registration ID and org1adminpw as the registration password. Click next, set the type of this identity to client, and then select all associated organizations from the drop-down list. We leave the maximum number of registrants and add attributes fields blank.
We will repeat this process to create authentication for peer. Click the register user button. Use peer1 as the registration ID and peer1pw as the registration password. Click next, set the type of this identity to peer, and then select all associated organizations from the drop-down list. We leave the maximum number of registrants and add attributes fields blank.
Create a MSP for the peer organization
Select Organizations and click Create MSP definition
Use Org1 MSP as "MSP Display name" and org1msp as MSP ID.
Select Org1 CA as the root CA for the organization.
The Enroll ID and Enroll secret of organization admin are org1admin and org1adminpw, respectively. Identity name Select Org1 Admin.
Click Generate and Export to generate the organization's admin identity and export it to the local file system. Finally, click Create MSP definition to complete the creation of the MSP.
Create a peer node
On the Nodes page, click the Add peer button and use Peer Org1 as the Display name.
Select Org1 CA as the Certificate Authority.
Peer1 and peer1pw are used as Enroll ID and Enroll secret. Org1 MSP as Administrator Certificate.
Admin and adminpw are used as TLS Enroll ID and TLS Enroll secret.
Org1 Admin as Associate an identity.
Create order org and corresponding nodes
The steps for creating order org and peer org are highly similar.
Create order org CA
Click Add Certificate Authority and set Orderer CA to Display name.
Admin and adminpw are Admin ID and Admin Secret.
Use this CA to register for order admin and order authentication
Select Orderer CA and click Register User.
Ordereradmin and ordereradminpw are used as Enroll ID and Enroll Secret. Type select client.
Click Register User and enter orderer1 and orderer1pw as Enroll ID and Enroll Secret. Type select peer.
Create a MSP for order org
Click Create MSP definition,Orderer MSP as MSP Display name and orderermsp as MSP ID.
Orderer CA as Root Certificate Authority.
Ordereradmin and ordereradminpw are used as Enroll ID and Enroll secret. Orderer Admin as Identity name.
Click Create MSP definition to complete the creation.
Create an order node
Click Add orderer,Orderer as Display name and Orderer CA as Certificate Authority.
Orderer1,orderer1pw is used as Enroll ID and Enroll secret.
Orderer MSP as Administrator Certificate.
Admin and adminpw as TLS Enroll ID,TLS Enroll secret
Orderer Admin as Associate an identity.
Associate order and peer
Click on the Orderer we just created.
Click Add organization under Consortium Members.
Select Org1 MSP and click submit.
Create and join channel
Create channel
Click Create channel to name channel: mychannel
Select the order you just created and select Org1 MSP (org1msp) as the MSP.
Org1 Admin acts as the associated authentication.
Click add and select Operator.
Click to create
Add peer to channel
Click Join channel, select Orderer, select mychannel, and select peer: Peer Org1 to join. Submit.
It's complicated, but congratulations, you've created the fabric network.
Import Smart contract
Install Smart contract
Click Smart contracts, click Install smart contract, and select the smart contract we exported earlier.
Click add File, click install.
Instantiate intelligent contract
At smart contracts tab, find the smart contract you just installed.
Click Instantiate, select mychannel, select org1msp.
Click Instantiate.
This is the end of the article on "how to run Fabric in IBM Cloud". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.