Chapter 2 Fabric and deployment environment
2.1 Fabric Source Gets
In the go environment variables create a folder, switch to that folder:
cd /home/zyp/development/go/src/github.com/hyperledger
Download the complete source code with git commands
git clone https://github.com/hyperledger/fabric.git
Since we just build environment. You do not need the latest code, it is only necessary to switch to the big version v1.0.0 on the line.
cd /home/zyp/development/go/src/github.com/hyperledger/fabric //进入fabric目录git checkout v1.0.0
git checkout v1.0.0
Now I switched to a newer version v1.0
Fabric-source download is complete! !
2.2 Fabric Docker image download
Into the fabric of examples under file:
cd /home/zyp/development/go/src/github.com/hyperledger/fabric/examples/e2e_cli/
Download image
source download-dockerimages.sh -c x86_64-1.0.0 -f x86_64-1.0.0
Check the list of the downloaded image:
docker images
Fabric network start and finish ChainCode test, switch to the examples / e2e_cli file
./network_setup.sh up
Startup and Shutdown:
启动:./network_setup.sh up 关闭:./network_setup.sh down
The successful launch interface is as follows:
2.3 start the process of exception handling
1.script.sh script lacks authority
in /home/zyp/development/go/src/github.com/hyperledger/fabric/ under
sudo chomd +X scripts/script.sh
2. missing files (... / fabric / release / linux-amd64 / bin / absence of the corresponding file)
Abnormal described as follows:
error:
ERRO 001 : Cannot run peer because cannot init crypto,missing /opt/gopath/src/github/hyperledger/fabric/peer/ctypto/org1.example.com/msp folder
notes: Some solutions proposed to re-acquire source operating, in fact, does not need! In fact you do not need!
Obtain the missing documents in two ways:
- Option One: the official reference solutions address
http://hyperledger-fabric.readthedocs.io/en/latest/samples.html#download-platform-specific-binaries
The address is normally inaccessible to nature.
- Option Two: lovely hard-working people who provide the address to
https://download.csdn.net/download/qq_35001005/12032914
Obtained following documents, placed in ... / fabric / release / linux- amd64 / bin / under
3. authorization documents, problems as described below
cd ... / ... / release / linux -admin authorization ie two files / bin / path can
sudo chmod +X crytogen
sudo chmod +X configtxgen
4.API error (404) : network e2ecli_default not found
The following error message:
The ... / fabric / examples / e2e_cli / base / peer-base.yaml file with the following modifications:
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2ecli_default
change into:
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2e_cli_default
Explanation:
Because the default network name created for: $ (directory name) _default, and our example this project directory name e2e_cli. So the network name e2e_cli_deault.
You can view Verification:
docker network ls
Thus it needs to be done as modified.
So far, the case e2e_cli should be able to start successfully (I am so), if there is no suggestion persistent efforts to refuel.