Table of contents
1. Start the Fabric network
Reference blog post Fabric installation and deployment (fabric 2.0 version)_m0_47233175's blog-CSDN blog
2. Enter the cli client
docker exec -it cli bash
3. Channel management
Use the peer channel command to perform channel operations (you can enter the peer channel --help command to view the use of specific commands)
for example: list all application channels that the peer has joined
peer channel list
for example: Obtain the basic information of the channel (height, current hash, hash of the leading block)
peer channel getinfo -c mychannel
4. Management node
Use the peer node command to perform channel operations, and you can use peer node --help to view specific instructions
Note: The operation on the node needs to be performed when the Peer service is stopped
5. Management chain code
Chaincode is divided into system chaincode and user chaincode; usually chaincode refers to user chaincode.
Use the peer lifecycle chaincode command to operate, you can use peer lifecycle chaincode --help to view the specific instructions
for example: view the chaincode installed on the node
peer lifecycle chaincode queryinstalled
for example: Call the chain code to query the assets of user A
peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}'
-C, the channel name where the chain code is located
-n, chaincode name
-c, parameters transmitted to the chaincode Invoke method