LAI YUET CHUN
Founder and CEO of Confucius One Academy
Li Yuechun: Founder and CEO of Kong One Academy, domestic blockchain evangelism pioneer, senior teaching expert of communication and information technology training engineering blockchain. If you have any questions about blockchain, you can join the blockchain technology exchange QQ group 729666975 (no need to add verification information to enter the group, just click the next step and wait for the administrator to pass), we will answer them for you one by one.
Learning Hyperledger Fabric from Zero to One is a series of 15 lectures, including setting up a Hyperledger Fabric environment, installing Hyperledger Fabric Samples, setting up your first network, manually configuring your network implementation and testing Chaincode, writing your first application, and more. Today we'll be covering Learning Hyperledger Fabric from Zero to One Session 4: Manually Configuring the Network Implementation and Testing Chaincode. Without further ado, let's get started on our Hyperledger Fabric learning journey.
For course study, add Lilly WeChat (kongyixueyuan).
Confucius One Academy
Generate initial blocks:
$ sudo ../bin/cryptogen generate --config=./crypto-config.yaml
The following output will be generated:
The certificate and key (i.e. MSP material) will be exported to the root of the directory crypto-config - - first-network
Configure environment variables
Tell the configtxgen tool where to look for the files needed for configtx.yaml)
$ export FABRIC_CFG_PATH=$PWD
Create order generation block
Call this configtxgen tool
The output after the command is executed is as follows:
Create a channel configuration transaction
Be sure to replace $CHANNEL_NAME or set CHANNEL_NAME to an environment variable that can be used throughout the description
If the error of no CA certificate or no corresponding directory is reported, check the format of the command (whether it is caused by spaces, please refer to the official website)
The output is as follows
Generate anchor node configuration update file
Define anchor points for Org1 on the channel being built. Again, make sure to replace $CHANNEL_NAME or set the environment variable for the following command. Terminal output will mimic the output of channel transaction artifacts
$ sudo docker-compose -f docker-compose-cli.yaml up -d
The -d parameter is not required if you want to view the live logs of the network
The CLI container will be idle for 1000 seconds. If it disappears when needed, it can be restarted with a simple command.
Accessing the Docker container
Execute the following command to get into the cli container (subsequent operations are executed in the container)
If successful, the command prompt will look like this:
Setting environment variables
This command returns a starting block - , which will be used to join the channel, if there is no prototype mychannel.block for the default channel "proto"
Join the channel
Update anchor point
Install and instantiate Chaincode
Output result:Query Result: 100
Checking the amount in account a
Output result: Query Result: 90
>>1、Learning C with Kids 9 Default Parameters for Constructors2、Ringing the bell three years after the IPO Poundland should not be questioned3、Custom Controls Explained VI Paint Brush MaskFilter4、R0R16 register role5、Summit Chronicle ABB VP How can flexible automation help transform and upgrade manufacturing