Environment Construction:
Necessary environmental dependencies:
Environment construction
Quick Start: http://hyperledger-fabric.readthedocs.io/en/release-1.1/getting_started.html
Premise
Install Git
$ sudo apt update$ sudo apt install git
Installing Curl
$ sudo brew install curl
Install Vim
$ sudo apt install vim
Installing Docker
$ sudo apt update$ docker --version$ sudo apt install docker.io
View Docker version Information
Version 1.12+
$ docker --version
Output:Docker version 1.13.1, build 092cba3
Installing Docker Compose
$ docker-compose --version$ sudo apt install docker-compose
View Dockercompose Version Information
$ docker-compose --version
Output:docker-compose version 1.8.0, build unknown
Golang
Fabric1.1.0 Version Requirements go1.9+
Fabric1.0.0 Version Requirements go1.7+
Upload go1.10.1.linux-amd64.tar.gz
Unzip the file
$ tar -zxvf go1.10.1.linux-amd64.tar.gz -C /usr/local/
Edit environment variable File
$ sudo vim /etc/profile
Add the following content:
export GOPATH=$HOME/goexport GOROOT=/usr/local/goexport PATH=$GOROOT/bin:$PATH
$ source /etc/profile$ go version
Output:go version go1.10.1 linux/amd64
If you have an older version of Golang in your system, uninstall the old version of Golang using the following command, and then reinstall
$ su -# apt-get remove golang-go --purge && apt-get autoremove --purge && apt-get clean
Installing node and NPM
Install NVM
Install node
$ nvm install v8.11.1
Check node version
$ node -v
Output:v8.11.1
Check NPM version
$ npm -v
Output:5.6.0
Hyperledger Fabric Samples Download installation
Create an empty directory
$ mkdir hyfa
Enter this directory
$ cd hyfa
Download method One:
New File bootstrap.sh
$ vim bootstrap.sh
https://github.com/hyperledger/fabric/blob/master/scripts/bootstrap.sh
Save the content copy in the exit
Give bootstrap.sh executable permissions and run
$ chmod +x bootstrap.sh
Configuring the Docker Accelerator
The purpose of configuring the Docker accelerator is to speed up the download of the Docker image file
$ curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://5d9148f7.m.daocloud.io
Restarting the Docker service
$ sudo systemctl restart docker.service
Performbootstrap.sh
Determine the network stability, otherwise it will cause a variety of problems, such as downloading to half the network timeout, download failure and so on
$ ./bootstrap.sh 1.1.0
Once the download is complete, review the relevant output and execute the command again if you download a failed image $ sudo ./bootstrap.sh 1.1.0
Download Method Two:
* * Recommended use method one for download * *
Configure the Docker accelerator,
$ curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://8890cb8b.m.daocloud.io
Restarting the Docker service
$ sudo systemctl restart docker.service
$ curl https://github.com/hyperledger/fabric/blob/master/scripts/bootstrap.sh | bash -s 1.1.0
After the installation is complete, output:
HYPERLEDGER/FABRIC-CA latest 72617B4FA9B4 5 weeks ago 299 Mbhyperledger/fabric-ca x86_64-1 .1.0 72617b4fa9b4 5 weeks ago 299 Mbhyperledger/fabric-tools latest B7BFDDF508BC 5 weeks ago 1 . gbhyperledger/fabric-tools x86_64-1.1.0 B7BFDDF508BC 5 weeks ago 1.46 Gbhyperledger/fabric-orderer L atest ce0c810df36a 5 weeks ago Mbhyperledger/fabric-orderer x86_64-1.1.0 ce0c810df36a 5 weeks A Go mbhyperledger/fabric-peer latest b023f9be0771 5 weeks ago 187 Mbhyperledger/fabric-peer x86_64-1.1.0 b023f9be0771 5 weeks ago 187 Mbhyperledger/fabric-javaenv Latest 82098abb1a17 5 we Eks ago 1.52 gbhyperledger/fabric-javaenv x86_64-1.1.0 82098abb1a17 5 weeks ago 1.52 gbhyperledger/fabric-c CENV latest c8b4909d8d46 5 weeks ago 1.39 gbhyperledger/fabric-ccenv x86_64-1.1.0 C8b4909d8d4 6 5 weeks ago 1.39Gbhyperledger/fabric-zookeeper latest 92cbb952b6f8 2 months ago 1.39 gbhyperledger/fabric-zookeeper X86_6 4-0.4.6 92cbb952b6f8 2 months ago 1.39 Gbhyperledger/fabric-kafka latest 554c591b86a8 2 months ago 1.4 Gbhyperledger/fabric-kafka x86_64-0.4.6 554c591b86a8 2 months ago 1.4 Gbhyperledger/fabric-couchdb Latest 7e73c828fc5b 2 months ago 1.56 gbhyperledger/fabric-couchdb x86_64-0.4.6 7e73c828fc5b 2 mont HS ago 1.56 GB
Add an environment variable (optional)
The corresponding relative path can be used later
$ export PATH=<path to download location>/bin:$PATH
Note: <path to download location> indicates the fabric-samples
path where the downloaded file directory is located
例: $ export PATH=$HOME/hyfa/fabric-samples/bin:$PATH
HyperLedger Fabric
Environment Construction Completed
Later use to FABRIC-GO-SDK, environment variable configuration to have the corresponding changes, please refer to Https://www.jianshu.com/p/e2b86a05cce4 for configuration
Open terminal, create a new folder in the current user directory Hyfa, switch to Hyfa, creating bootstrap.sh file,
Copy https://github.com/hyperledger/fabric/blob/master/scripts/bootstrap.sh the contents of this file, save and execute bootstrap.sh file
mkdir hyfacd hyfavim bootstrap.sh./bootstrap.sh
This is followed by automated environment download work. Install Docker under Mac
Automation Script section:
Manual Test Script section: