ubuntu16.04 under Hyperledger to build fabric environment simple operation (five-step start e2e_cli)

Source: Internet
Author: User
Tags curl gpg openssl openssl version git clone

If you have installed tools such as Go, git and checkout related and download related images, you can only get up to 5 steps below. e2e_cli
~/go/src/github.com/hyperledger/fabric$sudo chmod 777 release
~/go/src/github.com/hyperledger/fabric$sudo chmod 777examples/e2e_cli
~/go/src/github.com/hyperledger/fabric$sudo chmod 777examples/e2e_cli/Docker-compose-e2e.yaml
~/go/src/github.com/hyperledger/fabric$sudo chmod-r 777examples/e2e_cli/channel-artifacts
~/go/src/github.com/hyperledger/fabric$sudo vi examples/e2e_cli/base/peer-base.yaml
Change to-core_vm_docker_hostconfig_networkmode=e2e_cli_default,wq disk to exit

~/go/src/github.com/hyperledger/fabric/examples/e2e_cli$./network_setup.sh Down

~/go/src/github.com/hyperledger/fabric/examples/e2e_cli$./network_setup.sh up

If you are starting from a new beginning, follow the steps below to

Download ubuntu16.04 (must be this version, do not download the latest version) of the ISO file, if you run ubunto16.04 under Windows with a virtual machine, you also need to download VMware or VirtualBox, where the installation is relatively simple, if you need help to find additional information.
The following can be done after the user logs on to the default directory
Change domestic resource address and update installation source on Ubuntu
If it is a virtual machine operation, click on the Linux interface, press SHIFT+T to open the terminal, in the terminal input, copy, do not copy the previous Linux cursor prompt: $
$ sudo vi/etc/apt/sources.list
Replace the CN on the VI interface
:%s/us./cn./g
Update source
$ sudo apt-get update
Then install SSH so that you can connect remotely with clients such as putty or SECURECRT Linuxubuntu
$ sudo apt-get install SSH
Open SSH Remote access configuration
$ sudo vi/etc/ssh/sshd_config, enter the vi edit interface and press/permitrootlogin
Find the Permitrootlogin, press ESC, have the arrow keys to move the cursor to Permitrootlogin after you click a, enter Yes #
As follows:
Permitrootlogin Yes #PermitRootLogin
After saving exits

Again ifconfig, write down the Linux network card IP, in the putty and so on input connection host, enter this IP and user name password, you can telnet to Linux, if you do not log on, restart SSH

Install the Go environment, download and install the compressed package

$ wget https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz
Unzip
$ sudo tar-c/usr/local-xzf go1.9.linux-amd64.tar.gz
Configuring System Variables and properties
$ VI ~/.profile
Add a variable, you can use mine directly
Export path= $PATH:/usr/local/go/bin
Export Goroot=/usr/local/go
Export Gopath= $HOME/go

Save configuration file
$ source ~/.profile

Create a Go folder
$ cd ~
$ mkdir Go

Installing Docker
If the OS is the first to install Docker, you can first uninstall the old version that may exist $ sudo apt-get remove docker docker-engine docker-ce Docker.io

Installing Curl
$ sudo apt Install curl
Install the CA certificate before you can use the repository via HTTPS (repository)
$ sudo apt-get install-y apt-transport-https ca-certificates Curl Software-properties-common
Add Docker's official GPG key
$ Curl-fssl HTTPS://DOWNLOAD.DOCKER.COM/LINUX/UBUNTU/GPG | sudo apt-key add-
Use the following command to set up the stable repository
$ sudo add-apt-repository "Deb [ARCH=AMD64] Https://download.docker.com/linux/ubuntu $ (lsb_release-cs) stable"
Update the APT package index again
$ sudo apt-get update
Install the latest version of the Docker CE
$ sudo apt-get install-y docker-ce


Check the Docker version
$ docker--version

Docker version 18.03.1-ce, build 9ee9f40
The above output proves that Docker has been installed successfully!

Install docker-composeapt-get Update, if there is an older version, first delete the $ sudo pip uninstall Docker-compose
$ sudo apt-get install Python-pip
$ sudo pip install Docker-compose
$ docker-compose--version
Docker-compose version 1.21.2, build a133471
Docker-py version:3.3.0
CPython version:2.7.12
OpenSSL Version:openssl 1.0.2g 1 Mar 2016
Install Git
$ sudo add-apt-repository Ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git

Create a catalog of GO projects
$ sudo mkdir-p ~/go/src/github.com/hyperledger
Here we start to change the catalogue and go to the engineering catalogue
$ CD ~/go/src/github.com/hyperledger


If you downloaded fabric before checking, delete
~/go/src/github.com/hyperledger$ RM-RF Fabric
Re-download Cheout
~/go/src/github.com/hyperledger$ sudo git clone https://github.com/hyperledger/fabric.git
~/go/src/github.com/hyperledger$ CD ~/go/src/github.com/hyperledger/fabric
~/go/src/github.com/hyperledger/fabric$ sudo git checkout v1.0.0
~/go/src/github.com/hyperledger/fabric$sudo chmod 777 release
~/go/src/github.com/hyperledger/fabric$sudo chmod 777examples/e2e_cli
~/go/src/github.com/hyperledger/fabric$sudo chmod 777examples/e2e_cli/Docker-compose-e2e.yaml
~/go/src/github.com/hyperledger/fabric$sudo chmod-r 777examples/e2e_cli/channel-artifacts
~/go/src/github.com/hyperledger/fabric$sudo vi examples/e2e_cli/base/peer-base.yaml
Change to-core_vm_docker_hostconfig_networkmode=e2e_cli_default,wq disk to exit

Download of the Fabric docker image
Go to EXAMPLES/E2E_CLI under the Fabric folder and we'll test e2e_cli this demo
~/go/src/github.com/hyperledger/fabric$ CD ~/go/src/github.com/hyperledger/fabric/examples/e2e_cli/
The program will pull the desired image of the project through Docker, specifying the version number of the pull image for the unified version
~/go/src/github.com/hyperledger/fabric/examples/e2e_cli$ Source Download-dockerimages.sh-c x86_64-1.0.0-f x86_ 64-1.0.0
Or, two commands have one right.
~/go/src/github.com/hyperledger/fabric/examples/e2e_cli$./download-dockerimages.sh-c x86_64-1.0.0-f x86_64-1.0.0

The drop-down time is a bit long, wait for the next run to start, if before do similar start, first./network_setup.sh Down
~/go/src/github.com/hyperledger/fabric/examples/e2e_cli$./network_setup.sh up

The first run is long, patience and so on error
Good luck, waiting for a long time to appear


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


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

ubuntu16.04 under Hyperledger to build fabric environment simple operation (five-step start e2e_cli)

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.