Fabric 1.0 Blockchain Multi-machine cluster framework construction combat record (i)

Source: Internet
Author: User

Since my boss suddenly gave me an IBM Blockchain course website, I taught myself to finish two lessons from the blockchain provided by IBM and complete the compose-playground of this blockchain component in the fabric framework. This stand-alone construction is relatively simple, IBM's course has after-school this component related exercises and the document, therefore spent 2 days or so completed. Then the boss let me build a multi-machine cluster fabric, and then toss about half a month to finish.

This paper mainly records the specific process, problems and details of building multi-machine. The main reference blog has http://www.cnblogs.com/studyzy/p/7237287.html;https://www.ibm.com/developerworks/cn/cloud/library/ Cl-lo-hyperledger-fabric-study-notes1/index.html, etc.;

System version: Ubuntu16.04

Prerequisite Preparation: First to test whether the system ping www.baidu.com to test whether the network is normal, but also to test the installation of Git, curl and other prerequisite software. and clean up the system existing Docker and so on.

First, download and install the Go language

1. Download Address: wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz

Unzip to the specified path under Tar-c/usr/local-xzf go1.8.3.linux-amd64.tar.gz

2. Add GO environment variable

VI ~/.profile (if the root account in the/etc/profile add GO environment variable will not find files such as errors, the error will be listed later.) So the section is set up correctly. )

Add the following content:

Export path= $PATH:/usr/local/go/bin

Export Goroot=/usr/local/go

Export Gopath=/opt/gopath

Export path= $PATH:/opt/gopath/bin

3. After editing save and exit VI, make these environment variables take effect

SOURCE ~/.profile

4, set the Go directory Gopath to/opt/gopath, so remember to create Gopath folder

Mkdir-p/opt/gopath

5. Verify that Go is installed successfully

Go version

Second, Docker installation

1, first uninstall clean existing old version of Docker

Apt-get Remove Docker docker-engine docker-ce Docker.io

2. Installing Docker

Apt-get Update && sudo apt-get install Docker.io

3. Start Docker Service

Service Docker start

4. Check if Docker is installed successfully

Dokcer version

Third, Docker-compose installation

Method One: Install Docker-compose with PIP

1, Apt-get install Python-pip (or PYTHON3-PIP)

2, PIP/PIP3 install Docker-compose

3. Giving permission

chmod +x/usr/bin/docker-compose (some here are sudo chmod +x/usr/local/bin/docker-compose, this main look docker-compose file 's location)

4, check whether the installation is successful

Docker-compose version

Method Two: can also be downloaded from the domestic daoclound, in order to speed up the next installation from the Daoclound Docker-compose, run the script:

1, curl-l https://get.daocloud.io/docker/compose/releases/download/1.21.2/docker-compose-' uname-s '-' uname-m ' > /usr/bin/docker-compose

2, chmod +x/usr/bin/docker-compose

3. Docker-compose version

Download FABRICB source code and stand-alone test E2E Network Example

1. Download the fabric source code

Mkdir-p/opt/gopath/src/github.com/hyperledger

Cd/opt/gopath/src/github.com/hyperledger

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

2, Cd/opt/gopath/src/github.com/hyperledger/fabric

git checkout v1.0.0

3, CD/OPT/GOPATH/SRC/GITHUB.COM/HYPERLEDGER/FABRIC/EXAMPLES/E2E_CLI

Docker Accelerator configuration:

Curl-ssl https://get.daocloud.io/daotools/set_mirror.sh | Sh-s Http://8ad7943c.m.daocloud.io

Docker image Download:

SOURCE download-dockerimages.sh-c x86_64-1.0.0-f x86_64-1.0.0 (fabric switch version to be consistent with mirrored version)

Download results:


Modify the Peer-base.yaml in the/opt/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli/base directory

Change the network name to the following name:-Core_vm_docker_hostconfig_networkmode=e2e_cli_default

Run network_setup.sh

Operation Result:

Single-machine test succeeded.

The next chapter starts a multi-machine deployment.

Related Article

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.