Ubuntu16.04 Build Hyperledger Fabric 1.0.5 development environment

Source: Internet
Author: User
Tags install go zookeeper install node git clone couchdb hyperledger fabric
First, Prerequisites 1. Installing Docker and Docker-compose

Reference blog: http://blog.csdn.net/diligent_lee/article/details/79098302 2. Install node

Only two commands are required:

CURL-SL https://deb.nodesource.com/setup_8.x | SUDO-E Bash-
sudo apt-get install-y nodejs

NPM is installed automatically while node is installed. After the installation is complete, verify the installation by following the command:

Node-v
Npm-v

Reference Blog: http://blog.csdn.net/w20101310/article/details/73135388
node. JS Official website: https://nodejs.org/en/ 3. Install go and its environment variable configuration (1). Download the latest version of the go binaries

wget https://dl.google.com/go/go1.9.2.linux-amd64.tar.gz
(2). Unzip the file
sudo tar-c/usr/local-xzf go1.9.2.linux-amd64.tar.gz
(3). Configure Environment Variables

Enter the command:

sudo vim/etc/profile

Add the following at the end of the configuration file:

Export Goroot=/usr/local/go export
goarch=amd64 export
goos=linux
export Gopath=/home/username/gopath
export gobin= $GOROOT/bin
export path= $GOPATH/bin: $GOROOT/bin: $PATH

Exit Edit and enter the following command to make the changes effective:

Source/etc/profile

Enter the following command to see if the installation was successful:

Go version

If it appears: Go version go1.9.2 LINUX/AMD64 indicates a successful configuration.

As for Gopath, this is the directory where the Go program runs, that is, all the go programs you write are placed in this directory. Based on the above configuration, we create a new Gopath folder in the ~ directory and then create a new three folder Src,pkg,bin. where SRC storage source, pkg store compiled generated files, bin storage generated executable files. Second, download the fabric 1. Create a working directory

Mkdir-p ~/gopath/src/github.com/hyperledger/
2. Download the fabric
CD ~/gopath/src/github.com/hyperledger
git clone https://github.com/hyperledger/fabric.git

After the download is complete, we can see that there is a fabric folder in the current working directory, this is the file we downloaded, which has the example we need. At this point, our development environment has been basically built, the following will be a specific example to download fabric1.0.5 image and experience the effect of running. third, run the fabric instance

Enter the following command to switch the work path:

cd./fabric/scripts/
ls

You can see that there are a lot of shell script files under the current path, in the fabric version I'm using, There are 1.0.0 to 1.0.4 Bootstrap scripts, where the default bootstrap.sh is 1.0.5 version, we run this script and download the Fabric1.0.5 image we need. The command is as follows:

./bootstrap.sh

Because you need to download more images, it may take some time. The script will display these images after the download is complete.

===> List out Hyperledger Docker images hyperledger/fabric-tools latest 6A8993B718C8 6 weeks ago 1.33GB hyperledger/fabric-tools x86_64-1.0.5 6a8993b718c8 6 weeks ago 1.33GB Hyper     LEDGER/FABRIC-COUCHDB latest 9a58db2d2723 6 weeks ago 1.5GB hyperledger/fabric-couchdb x86_64-1.0.5 9a58db2d2723 6 weeks ago 1.5GB Hyperledger/fabric-kafka Latest B8C5 172bb83c 6 weeks ago 1.29GB Hyperledger/fabric-kafka x86_64-1.0.5 b8c5172bb83c 6 weeks Ago 1.29GB Hyperledger/fabric-zookeeper Latest 68945F4613FC 6 weeks ago 1.32GB Hyper     Ledger/fabric-zookeeper x86_64-1.0.5 68945F4613FC 6 weeks ago 1.32GB Hyperledger/fabric-orderer Latest 368c78b6f03b 6 weeks ago 151MB hyperledger/fabric-orderer x86_64-1.0.5 368 c78b6f03b 6 weeks Ago 151MB Hyperledger/fabric-peer Latest c2ab022f0bdb 6 weeks ago 154MB Hyperl     Edger/fabric-peer x86_64-1.0.5 c2ab022f0bdb 6 weeks ago 154MB hyperledger/fabric-javaenv Latest 50890CC3F0CD 6 weeks ago 1.41GB hyperledger/fabric-javaenv x86_64-1.0.5 5089 0CC3F0CD 6 weeks ago 1.41GB hyperledger/fabric-ccenv latest 33FEADB8F7A6 6 weeks ago 1.28GB hyperledger/fabric-ccenv x86_64-1.0.5 33feadb8f7a6 6 weeks ago 1.28GB Hyper          LEDGER/FABRIC-CA latest 002c9089e464 6 weeks ago 238MB Hyperledger/fabric-ca x86_64-1.0.5 002c9089e464 6 weeks ago 238MB

And after this script is finished, we will find that there is a bin folder in the current directory, and the executable file contained in this folder is what we need to run the example. Now we need to copy this folder to the upper directory of the example we need to run, and enter the command:

CP-RF bin/./... /examples/

Then we can run the official example: E2E_CLI

CD./.. /examples/e2e_cli/
./network_setup.sh up

Correct running Result:

===================== all good, end-2-end execution completed ===================== 


 ___   _   _   ____            _____   ____    _____ 
| ____| | \ | | |  _ \          | ____| |___ \  | ____|
|  _|   |  \| | | | | |  _____  |  _|     __) | |  _|  
| |___  | |\  | | |_| | |_____| | |___   / __/  | |___ 
|_____| |_| \_| |____/          |_____| |_____| |____ _|

To close an instance:

CTRL + C
./network_setup.sh down
Iv. Reference Articles:

1.http://blog.csdn.net/sinat_36742186/article/details/78510191
2.http:// HYPERLEDGER-FABRIC.READTHEDOCS.IO/EN/V1.0.5/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.