Prerequisite conditions
CentOS 7.4 64-bit
Install Docker and configure the Aliyun accelerator
Install Docker Compose
Install Golang
Because of the forbidden relationship, there is no way to direct access to the golang.org site, but the domestic download site a lot of their own Baidu can be.
My installation path is/usr/local/src/go
Edit/etc/profile file Add related environment variables as follows
Install Git
Yum Install git
Download Fabric Source Code
Mkdir-p ~/go/src/github.com/hyperledger
cd ~/go/src/github.com/hyperledger
git clone https://github.com/ Hyperledger/fabric.git
git checkout v1.0.0
Download Fabric Mirrors
CD fabric/examples/e2e_cli/
chmod +x download-dockerimages.sh
./download-dockerimages-c x86_64-1.0.0-f x86_ 64-1.0.0
Docker Images
Run Fabric Network
./network_setup.sh Up
Run the example and test the network
Docker exec-it CLI Bash
Check account balances
Peer Chaincode query-c mychannel-n mycc-c ' {' Args ': [' query ', ' A ']} '
Transfer 20 to B account from account a
Peer Chaincode invoke-o orderer.example.com:7050 --tls true--cafile/opt/gopath/src/github.com/hyperledger/ fabric/peer/crypto/ordererorganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/ TLSCA.EXAMPLE.COM-CERT.PEM- C mychannel-n mycc-c ' {"Args": ["Invoke", "a", "B", "20"]} '
Check account balances
Peer Chaincode query-c mychannel-n mycc-c ' {' Args ': [' query ', ' A ']} '
Turn off the network
./network_setup.sh Down