Install the required software environment
Specific See: https://hyperledger-fabric.readthedocs.io/en/release/prereqs.html
Note Version Install Docker CE
sudo yum install-y yum-utils
sudo yum-config-manager--add-repo Https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
Installthe latest version of Docker CE on RHEL:
sudo yum-y install Docker-ce
Install Docker compose
curl-lhttps://github.com/docker/compose/releases/download/1.8.1/docker-compose-' uname-s '-' uname-m ' >/usr/ Local/bin/docker-compose
Reference documentation
https://docs.docker.com/compose/install/#install-compose
Go Download Installation
wget https://www.golangtc.com/static/go/1.9.2/go1.9.2.linux-amd64.tar.gz
Extract to:/usr/local/go, and set: Exportpath= $PATH:/usr/local/go/bin
Install Nodejs
Https://nodejs.org/dist/v8.9.3/node-v8.9.3-linux-x64.tar.xz
Extract to:/usr/local/nodejs, and set: Export path= $PATH:/usr/local/nodejs/bin
Execution: npminstallnpm@3. -G
Specific See: https://hyperledger-fabric.readthedocs.io/en/release/prereqs.html
Start Docker
sudo systemctl restart Docker
If you report the following error:
Got Permission denied while trying Toconnect to the Docker daemon sockets at Unix:///var/run/docker.sock:posthttp://%2fvar %2frun%2fdocker.sock/v1.32/images/hyperledger/fabric-ca:x86_64-1.0.4/tag?repo=hyperledger%2ffabric-ca&tag= Latest:dial unix/var/run/docker.sock:connect:permissiondenied
Solve:
Su–root, chmod 777/var/run/docker.sock
Get SAMPLE:GITCLONEHTTPS://GitHub. COM/hyperledger/Fabric-samples. Git
/home/oracle/fabric/fabric-samples/first-network
download sample and run
Specific See: https://hyperledger-fabric.readthedocs.io/en/release/samples.html
Executive: Gitclonehttps://GitHub. COM/hyperledger/Fabric-samples. Git
-Sslhttps://goo. GL/| -s1.0. 5
If you cannot access it, you can access:
Goo. GL/byy2qj corresponds to:
https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap-1.0.3.sh
You can wget https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap-1.0.3.sh the file, and then perform it locally:
SH bootstrap-1.0.3.sh 1.0. 5
When the download is complete, refer to https://hyperledger-fabric.readthedocs.io/en/release/write_first_app.html to run the sample.
Note: Registeruser.js need to:
Returnfabric_ca_client.register ({enrollmentid: ' user1 ', affiliation: ' Org1.department1 '}, Admin_user);
Modified to:
Returnfabric_ca_client.register ({enrollmentid: ' user1 ', affiliation: ' Org1.department1 ', role: ' Client '}, Admin_user );
To run and develop Chaincode .
Stop the front sample.
Reference: https://hyperledger-fabric.readthedocs.io/en/release/chaincode4ade.html
Problems and Solutions
Feel like to run the sample first, and then execute
Docker--fdocker-Compose-simple. Yamlup and other orders, otherwise reported:
Orderer | 2017-12-23 13:15:24.155 UTC [COMMON/CONFIGTX] addtomap-> debu 19a adding to config map: [Values]/channel/consortium
Orderer | 2017-12-23 13:15:24.155 UTC [orderer/common/broadcast] Handle-> WARN 19b rejecting config_update because:error author izing update:error validating readset:readset expected key [Groups]/channel/application at version 0, but got version 1
Orderer | 2017-12-23 13:15:24.155 UTC [Orderer/main] func1-> debu 19c Closing Broadcast stream
Orderer | 2017-12-23 13:15:24.167 UTC [orderer/common/deliver] Handle-> WARN 19d Error reading from stream:rpc Error:code = Ca nceled desc = Context Canceled
Orderer | 2017-12-23 13:15:24.168 UTC [Orderer/main] func1-> debu 19e Closing Deliver Stream
clean up the environment
Docker rm-f$ (Docker Ps-aq)
Dockernetworkprune
Dockerrmidev-peer0. Org1. Example. COM-fabcar-1.0-5c906e402ed29f20260ae42283216aa75549c571e2e380f3615826365d8269ba
Failed to Register:error:fabric-carequest register Failed with errors[[{' code ': 0, ' message ': ' No identity type provided. Please provide identity type "}]]
Https://stackoverflow.com/questions/47175691/unable-to-registeruser-for-hyperledger-fabric-fabcar-sample-project
Step into development environment
Execute under Fabric-samples/fabcar: startfabric.sh
Then execute the following command to stop and clean the environment:
Docker rm-f$ (Docker Ps-aq)
Dockernetworkprune
Dockerrmidev-peer0. Org1. Example. COM-fabcar-1.0-5c906e402ed29f20260ae42283216aa75549c571e2e380f3615826365d8269ba
Execute under/home/oracle/fabric-samples/chaincode-docker-devmode:
Docker-Compose-fdocker-Compose-simple. Yamlup
Make sure that the startup process does not complain. Then you can follow the steps in https://hyperledger-fabric.readthedocs.io/en/release/chaincode4ade.html to develop, compile, deploy, and test.
More wonderful content, welcome attention to my public number: Scholar Lao Xu