Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to install and run Hyperledger Fabric

Shulou Source: shulou.com Published: 2022-06-01 19:27:38 10月02日 Update

This article is about how Hyperledger Fabric is installed and run. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Pre-installed

Note: all of the following installation and configuration are done on Ubuntu16.04.5-server-amd64

CURL

Checck on Ubuntu16.04.5 (input command "curl-help")

Docker

Version (17.06.2-ce or greater) (input command "docker-version")

How to install Docker on Ubuntu16.04.5 (See this)

Docker Compose

Version (1.14.0 or greater) (input command "docker-compose-- version")

How to install Docker Compose on Ubuntu16.04.5 (See this)

Go

Version (1.11.x) (input command "go version")

GOPATH (export GOPATH=~/golang/gopath)

PATH (export PATH=$PATH:$GOPATH/bin)

Download the source code

The source code contains samples. After the download is complete, switch to the v1.3.0 source code.

Go get github.com/hyperledger/fabriccd $GOPATH/src/github.com/hyperledger/fabricgit checkout-b v1.3.0

Download the image

Docker pull hyperledger/fabric-tools:amd64-1.3.0docker pull hyperledger/fabric-peer:amd64-1.3.0docker pull hyperledger/fabric-orderer:amd64-1.3.0docker pull hyperledger/fabric-ca:amd64-1.3.0docker pull hyperledger/fabric-couchdb:amd64-0.4.14docker pull hyperledger/fabric-kafka:amd64-0.4.14docker pull hyperledger/fabric-zookeeper:amd64-0.4.14docker pull hyperledger/fabric-baseos:amd64-0.4.14

To facilitate the configuration of docker-compose, change all mirrored tag to latest

Docker tag hyperledger/fabric-tools:amd64-1.3.0 hyperledger/fabric-tools:latestdocker tag hyperledger/fabric-peer:amd64-1.3.0 hyperledger/fabric-peer:latestdocker tag hyperledger/fabric-orderer:amd64-1.3.0 hyperledger/fabric-orderer:latestdocker tag hyperledger/fabric-ca:amd64-1.3.0 hyperledger/fabric-ca:latestdocker tag hyperledger/fabric-couchdb:amd64-0.4.14 hyperledger/fabric-couchdb:latestdocker tag hyperledger/fabric-kafka:amd64-0.4.14 Hyperledger/fabric-kafka:latestdocker tag hyperledger/fabric-zookeeper:amd64-0.4.14 hyperledger/fabric-zookeeper:latestdocker tag hyperledger/fabric-baseos:amd64-0.4.14 hyperledger/fabric-baseos:latest

These images are relatively large. Please make sure that the network environment is stable and fast during the download process, otherwise it is easy to interrupt and fail.

Running sample

The slash here in cd $GOPATH/src/github.com/hyperledger/fabric/examples/e2e_cli# "/" needs to escape sed-I "s /\ / opt\ / gopath/\ / home\ / nealguo\ / golang\ / gopath/g". * base/*.* script/*.*

Many configuration files and scripts are used during startup, such as docker-compose-cli.yaml, base/docker-compose-base.yaml, scripts/script.sh, and many of these configuration files and scripts start with / opt/gopath (that is, the default $GOPATH is / opt/gopath)

If $GOPATH is another path, you need to modify these configuration files and scripts, such as replacing / opt/gopath with / home/nealguo/golang/gopath here (see the sed command here)

Cd $GOPATH/src/github.com/hyperledger/fabric/examples/e2e_clibash network_setup.sh up

The sample e2e_cli is run here, and the command "bash network_setup.sh down" can be used when it is closed.

Thank you for reading! This is the end of the article on "how to install and run Hyperledger Fabric". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Configure run file source code script image content command more article path process good practical beginning article slash version environment see Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Tech Info vpn NVidia Docker