2018-08-08

Source: Internet
Author: User

Hyperledger Fabric's environment on Ubuntu


First install Ubuntu on the VMware Workstation virtual machine, configure the environment, adjust the Chinese language, the resolution, open the terminal.

PS: After installing Ubuntu system if you find that files with Windows system can not replicate with each other, the web looked up a lot of tutorials, found that are not available, the method can be implemented as follows:

Open Terminal, enter:

1:sudo Apt-get Autoremove Open-vm-tools

2:sudo Apt-get Install Open-vm-tools-desktop

And then restart

Next, the deployment of the fabric is formally started:

First step: Configure the basic Ubuntu environment

Install Vim:

sudo apt-get install vim

To install Curl:

1:sudoapt-get Update

2:SUDOAPT Install Curl

To install Git:

sudo apt-get install git


Step Two: Install the Go language and match environment variables

Install the Go language:

sudo apt-getinstall Golang

To view the version of the Go language:

Go version

To see the installation path and environment variables for go:

Go env

After you install the Go language, you also need to configure Go environment variables for the language:

Vi ~/.profile//Edit the current user's environment variables

At the end of profile, add the following:

Export path= $PATH:/usr/local/go/bin (depending on your situation)//set as your own go install directory

Export Goroot=/usr/local/go

Exportgopath= $HOME/go

Exportpath= $PATH: $HOME/go/bin

Step three: Install Docker.

Ubuntu comes with its own Docker:

sudo apt-get update

sudo apt-get install-y Docker.io

sudo ln-sf/usr/bin/docker.io/usr/local/bin/docker


Test: sudo docker info

If you encounter problems, you can deactivate and start Docker.

Deactivation: sudo service docker stop

Enable: sudo service docker start


Then modify the permissions of the current user:

sudo usermod-ag Docker $USER


Add Mirroring Acceleration:

Create a Docker file

sudo mkdir-p/etc/docker

sudo gedit/etc/docker/daemon.json

Add the following information to the Daemon.json file:

{"Registry-mirrors": ["https://registry.docker-cn.com"]}

Docker-compose the installation

Run the following command to download the latest version of Docker-compose:

sudo curl-lhttps://github.com/docker/compose/releases/download/1.18.0/docker-compose-' uname-s '-' uname-m '-o/usr/ Local/bin/docker-compose

Change the permissions of the binaries so that they can run:

sudo chmod +x/usr/local/bin/docker-compose

Test installation:

Docker-compose–version


Fourth Step, Fabric Source Download

To create a folder under GO environment variable, switch to this folder:

CD ~/go/src/github.com/hyperledger

Download full source with git command

git clone https://github.com/hyperledger/fabric.git

Because we are just building the environment. No need for the latest code, so just switch to the v1.0.0 large version.

CD ~/go/src/github.com/hyperledger/fabric//Enter the fabric directory git checkout v1.0.0

Fabric Source Download Complete!!

Fifth step, the download of the Fabric docker image

Switch to the examples file for fabric:

CD ~/go/src/github.com/hyperledger/fabric/examples/e2e_cli/

To run the command download Image:

SOURCE Download-dockerimages.sh-c x86_64-1.0.0-f x86_64-1.0.0

Once the download is complete, we run the following command to check the downloaded image list:

Docker images

Sixth step, start the fabric network and complete the Chaincode test

To switch to the Examples/e2e_cli file, start the test example:

CD ~/GO/SRC/GITHUB.COM/HYPERLEDGER/FABRIC/EXAMPLES/E2E_CLI

Start:./network_setup.sh up

Close:./network_setup.shdown



When executing the./byfn.sh-m up, the error message is as follows,

Error:for Orderer.example.comCannot Create container for service orderer.example.com:Conflict. Thecontainer name "/orderer.example.com" is already on use by container "d6621116cf0d1ab108277893178ba29acreating Peer0.org1.example.com ... error

Workaround: This is caused by a naming conflict when the exception was aborted and now runs again. Knowing the problem, it's not that hard to solve. First enter Docker ps-a check is not really a naming conflict, if yes, Docker Ps-qa | Xargs Docker RM removes the naming conflict. Enter again./byfn.sh-m up, wait a minute, just like the official web.

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.