Hyperledger Configure Fabric1.4 Environment with Google Cloud

Keywords: Docker curl github git

Google Cloud System Configuration

As shown in the following figure: Select the ubuntu system for configuration, choose a new instance, choose any name you like, choose Hong Kong as far as possible, pick up the mirror faster, and choose a vCPU of type 3.75G is sufficient.

Select permanent disk 10GB

Fabric Environment Configuration

Start with docker installation

  1. Perform the following commands to install automatically:
sudo wget -qO- https://get.docker.com/ | bash
  1. If an error occurs above, execute the following command:
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
  1. Install docker-compose command
curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Install git

The commands are as follows:

apt-get update
apt-get install git

Install Go Language Environment

The commands are as follows:

1. Installation command: WGetHttps://dl.google.com/go/go1.11.5.linux-amd64.tar.gz
 Unzip command, execute tar unzip to/usr/loacl directory (official recommendation): tar-C/usr/local-zxvf go1.11.5.linux-amd64.Tar.gz

2.5. Add the /usr/loacl/go/bin directory to the PATH variable.Add to/etc/profile or $HOME/.profile, I am accustomed to vim, if not, you can install one with the command sudo apt-get install vim.
Open vim/etc/profile to add on the last line

export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin

Save source after exit (vim can be searched by itself) source/etc/profile


Go to Node.js Select the appropriate version to download, using the following commands:

$ wget https://npm.taobao.org/mirrors/node/v9.9.0/node-v9.9.0.tar.gz


$ tar -C /usr/local -xzf node-v9.9.0.tar.gz

Configure Fabric Environment

1. Download Fabric Source

$ mkdir -p ~/go/src/github.com/hyperledger 
$ cd ~/go/src/github.com/hyperledger 
$ git clone https://github.com/hyperledger/fabric.git

2 Use commands to download platform-specific binaries

curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s 1.4.0

Or use:

curl -sSL https://goo.gl/6wtTN5 | bash -s 1.4.0

Once the command is run, it downloads tools such as cryptogen, configtxgen, and so on, from the bin directory.
3. Enter the Bin file directory to set cryptogen, configtxgen environment:

export PATH=${PWD}/../bin:${PWD}:$PATH

4. Enter the Fabric-sample/first-network test environment to see if it is successfully built
Execute. /Byfn.shThe up command log is as follows:

Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n]
proceeding ...
Creating network "net_byfn" with the default driver
Creating peer0.org1.example.com
Creating peer1.org1.example.com
Creating peer0.org2.example.com
Creating orderer.example.com
Creating peer1.org2.example.com
Creating cli

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

Channel name : mychannel
Creating channel...

See the log above to illustrate that the environment was successfully built.
Execute. /Byfn.shDown Close and Clean Mirrors

Not finished, to be continued...

Posted by alefort on Thu, 21 May 2020 19:57:47 -0700