返回顶部

【系列】安装fabric

Hyperledger Fabric v1.1.0安装记录(国内源版)

参考:Luckary的博客,有删改

    \           ALLAN           /
     \                         /
      \      KEEP RUNNING     /
       ]     KEEP CODING     [    ,'|
       ]                     [   /  |
       ]___               ___[ ,'   |
       ]  ]\             /[  [ |:   |
       ]  ] \           / [  [ |:   |
       ]  ]  ]         [  [  [ |:   |
       ]  ]  ]__     __[  [  [ |:   |
       ]  ]  ] ]\ _ /[ [  [  [ |:   |
       ]  ]  ] ] (#) [ [  [  [ :===='
       ]  ]  ]_].nHn.[_[  [  [
       ]  ]  ]  HHHHH. [  [  [
       ]  ] /   `HH("N  \ [  [
       ]__]/     HHH  "  \[__[
       ]         NNN         [
       ]         N/"         [
       ]         N H         [
      /          N            \
     /           q,            \
    /                           \

1. 安装虚拟机

虚拟机软件采用:VMware

操作系统选择:Ubuntu 16.04

内存:4G

CPU:2核

硬盘:200G

2.(可选)更改ssh配置使得root可以通过SSH登录

为root设置密码

sudo passwd root

安装openSSH

编辑/etc/ssh/sshd_config配置文件,允许root用户通过SSH登录

sudo vi /etc/ssh/sshd_config`
修改内容
`PermitRootLogin  yes

重启sshd服务

sudo service ssh restart

3. 安装必要的工具

sudo apt-get update

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common git make gcc

4. 安装Docker(17.06.2-ce or greater is required)

4.1 使用国内的阿里源安装Docker

curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

sudo apt-get -y update

sudo apt-get install docker-ce

4.2 添加阿里云的Docker hub镜像

sudo mkdir -p /etc/docker

vi /etc/docker/daemon.json

在daemon.json中添加

{

    "registry-mirrors" : ["https://obou6wyb.mirror.aliyuncs.com"]  

}

4.3 重新启动Docker服务

service docker restart

5. 安装docker-compose(version 1.14.0 or greater)

curl -L https://get.daocloud.io/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m`>/usr/local/bin/docker-compose

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

docker-compose version

6. 安装Golang环境(Go version 1.10.x is required

cd ~

wget https://studygolang.com/dl/golang/go1.10.1.linux-amd64.tar.gz

tar -C /usr/local -xzf go1.10.1.linux-amd64.tar.gz

mkdir go

Go环境变量设置
vi /etc/profile

添加

           export GOPATH=~/go

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

使环境变量生效

source /etc/profile

go version

7. 安装Node.js和NPM(version 8.9.x or greater,但目前不支持9.x)

cd ~

wget https://npm.taobao.org/mirrors/node/v8.11.2/node-v8.11.2-linux-x64.tar.xz

mkdir node

tar xvf node-v*.tar.?z --strip-components=1 -C ./node

rm -rf node-v*

mkdir node/etc

echo 'prefix=/usr/local' > node/etc/npmrc

sudo mv node /opt/

sudo chown -R root: /opt/node

sudo ln -s /opt/node/bin/node /usr/local/bin/node

sudo ln -s /opt/node/bin/npm /usr/local/bin/npm

node -v

npm -v

8. python版本确认(2.7, npm install需要)

python --version

为git设置代理

git config --global http.proxy http://127.0.0.1:10809 
git config --global https.proxy http://127.0.0.1:10809

9. hyperledger fabric源代码下载

# 下载fabric源码
mkdir -p ~/go/src/github.com/hyperledger
cd ~/go/src/github.com/hyperledger/
git clone https://github.com/hyperledger/fabric.git
# 切换到release-1.1分支
cd ~/go/src/github.com/hyperledger/fabric/
git checkout v1.1.0
# git checkout release-1.1
git branch -a

10. hyperledger fabric docker镜像下载

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

chmod +x download-dockerimages.sh

source download-dockerimages.sh -c x86_64-1.1.0 -f x86_64-1.1.0

docker pull hyperledger/fabric-kafka:latest
docker pull hyperledger/fabric-couchdb:latest
docker pull hyperledger/fabric-zookeeper:latest

docker images

运行第五行命令后输出如下。可以看到有三个镜像拉取失败,所以单独的再次进行拉取。

root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli# source download-dockerimages.sh -c x86_64-1.1.0 -f x86_64-1.1.0
Pull CA IMAGES
Pull FABRIC TAG
===> Pulling fabric Images
==> FABRIC IMAGE: peer

x86_64-1.1.0: Pulling from hyperledger/fabric-peer
1be7f2b886e8: Pull complete 
6fbc4a21b806: Pull complete 
c71a6f8e1378: Pull complete 
4be3072e5a37: Pull complete 
06c6d2f59700: Pull complete 
4d536120d8a5: Pull complete 
0baaf9ec263e: Pull complete 
770563795186: Pull complete 
15763b7bd14b: Pull complete 
62f2823da7f3: Pull complete 
Digest: sha256:57417699ddf50c5ebd47a9a2cc74c0324fbba0281eb1104b9ddd05a67776b01f
Status: Downloaded newer image for hyperledger/fabric-peer:x86_64-1.1.0
docker.io/hyperledger/fabric-peer:x86_64-1.1.0
==> FABRIC IMAGE: orderer

x86_64-1.1.0: Pulling from hyperledger/fabric-orderer
1be7f2b886e8: Already exists 
6fbc4a21b806: Already exists 
c71a6f8e1378: Already exists 
4be3072e5a37: Already exists 
06c6d2f59700: Already exists 
4d536120d8a5: Already exists 
0baaf9ec263e: Already exists 
770563795186: Already exists 
61d33418a569: Pull complete 
b1b98004e7c6: Pull complete 
Digest: sha256:0c3a3b5ecfd24b513da22bbb77da7b3f5bca9c121cc0ac5c46ba04c97c163654
Status: Downloaded newer image for hyperledger/fabric-orderer:x86_64-1.1.0
docker.io/hyperledger/fabric-orderer:x86_64-1.1.0
==> FABRIC IMAGE: couchdb
---------------------------------ALLAN-TAGS---------------------------------
Error response from daemon: manifest for hyperledger/fabric-couchdb:x86_64-1.1.0 not found: manifest unknown: manifest unknown
Error response from daemon: No such image: hyperledger/fabric-couchdb:x86_64-1.1.0
==> FABRIC IMAGE: ccenv

x86_64-1.1.0: Pulling from hyperledger/fabric-ccenv
1be7f2b886e8: Already exists 
6fbc4a21b806: Already exists 
c71a6f8e1378: Already exists 
4be3072e5a37: Already exists 
06c6d2f59700: Already exists 
4d536120d8a5: Already exists 
0baaf9ec263e: Already exists 
3ea9b6cc6f21: Pull complete 
6173b9a5fe5e: Pull complete 
e73719e0bcbe: Pull complete 
b55408c6ced5: Pull complete 
e1267c65ed62: Pull complete 
2839c20999d1: Pull complete 
444429f2833f: Pull complete 
Digest: sha256:07818367dc6d4264472d24b21819f9dc4e16e890d81ddfacee0341a22d72050b
Status: Downloaded newer image for hyperledger/fabric-ccenv:x86_64-1.1.0
docker.io/hyperledger/fabric-ccenv:x86_64-1.1.0
==> FABRIC IMAGE: javaenv

x86_64-1.1.0: Pulling from hyperledger/fabric-javaenv
1be7f2b886e8: Already exists 
6fbc4a21b806: Already exists 
c71a6f8e1378: Already exists 
4be3072e5a37: Already exists 
06c6d2f59700: Already exists 
4d536120d8a5: Already exists 
0baaf9ec263e: Already exists 
3ea9b6cc6f21: Already exists 
6173b9a5fe5e: Already exists 
e73719e0bcbe: Already exists 
b55408c6ced5: Already exists 
d72e92165d22: Pull complete 
bbb7025c0883: Pull complete 
8fa39f27c772: Pull complete 
5187f67cb3f8: Pull complete 
05488c815030: Pull complete 
3bd91626e779: Pull complete 
47aa3719a5d6: Pull complete 
cd3dc7bf95ff: Pull complete 
Digest: sha256:d2588c0556b6fc79131f638b02a7a77337363e2c2f38a9c47798a6d99bd2f20e
Status: Downloaded newer image for hyperledger/fabric-javaenv:x86_64-1.1.0
docker.io/hyperledger/fabric-javaenv:x86_64-1.1.0
==> FABRIC IMAGE: kafka
---------------------------------ALLAN-TAGS---------------------------------
Error response from daemon: manifest for hyperledger/fabric-kafka:x86_64-1.1.0 not found: manifest unknown: manifest unknown
Error response from daemon: No such image: hyperledger/fabric-kafka:x86_64-1.1.0
==> FABRIC IMAGE: tools

x86_64-1.1.0: Pulling from hyperledger/fabric-tools
1be7f2b886e8: Already exists 
6fbc4a21b806: Already exists 
c71a6f8e1378: Already exists 
4be3072e5a37: Already exists 
06c6d2f59700: Already exists 
4d536120d8a5: Already exists 
0baaf9ec263e: Already exists 
3ea9b6cc6f21: Already exists 
6173b9a5fe5e: Already exists 
e73719e0bcbe: Already exists 
b55408c6ced5: Already exists 
1a8bca84adfa: Pull complete 
b54c1992cc9c: Pull complete 
68093aff3e84: Pull complete 
3827dc0ff46d: Pull complete 
1e22360bf4e7: Pull complete 
Digest: sha256:36d7fa8e8ddcc19fed8e1c3c06bc6ae1dac18c35e8a884188d2c08df3e5a4472
Status: Downloaded newer image for hyperledger/fabric-tools:x86_64-1.1.0
docker.io/hyperledger/fabric-tools:x86_64-1.1.0
==> FABRIC IMAGE: zookeeper
---------------------------------ALLAN-TAGS---------------------------------
Error response from daemon: manifest for hyperledger/fabric-zookeeper:x86_64-1.1.0 not found: manifest unknown: manifest unknown
Error response from daemon: No such image: hyperledger/fabric-zookeeper:x86_64-1.1.0
===> Pulling fabric ca Image
==> FABRIC CA IMAGE

x86_64-1.1.0: Pulling from hyperledger/fabric-ca
1be7f2b886e8: Already exists 
6fbc4a21b806: Already exists 
c71a6f8e1378: Already exists 
4be3072e5a37: Already exists 
06c6d2f59700: Already exists 
4d536120d8a5: Already exists 
0baaf9ec263e: Already exists 
ab27f0b1192c: Pull complete 
7e1142a727eb: Pull complete 
a7624c188c44: Pull complete 
0c8524afd242: Pull complete 
23e14758f709: Pull complete 
Digest: sha256:92f44d0811cddb0d335f7879f7e3b3c4b631f31740c76f3e7b85438c244b03f4
Status: Downloaded newer image for hyperledger/fabric-ca:x86_64-1.1.0
docker.io/hyperledger/fabric-ca:x86_64-1.1.0

===> List out hyperledger docker images
hyperledger/fabric-ca        latest         72617b4fa9b4   3 years ago   299MB
hyperledger/fabric-ca        x86_64-1.1.0   72617b4fa9b4   3 years ago   299MB
hyperledger/fabric-tools     latest         b7bfddf508bc   3 years ago   1.46GB
hyperledger/fabric-tools     x86_64-1.1.0   b7bfddf508bc   3 years ago   1.46GB
hyperledger/fabric-orderer   latest         ce0c810df36a   3 years ago   180MB
hyperledger/fabric-orderer   x86_64-1.1.0   ce0c810df36a   3 years ago   180MB
hyperledger/fabric-peer      latest         b023f9be0771   3 years ago   187MB
hyperledger/fabric-peer      x86_64-1.1.0   b023f9be0771   3 years ago   187MB
hyperledger/fabric-javaenv   latest         82098abb1a17   3 years ago   1.52GB
hyperledger/fabric-javaenv   x86_64-1.1.0   82098abb1a17   3 years ago   1.52GB
hyperledger/fabric-ccenv     latest         c8b4909d8d46   3 years ago   1.39GB
hyperledger/fabric-ccenv     x86_64-1.1.0   c8b4909d8d46   3 years ago   1.39GB

重新拉取后,应当有以下镜像:

root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli# docker images
REPOSITORY                     TAG            IMAGE ID       CREATED         SIZE
hyperledger/fabric-zookeeper   latest         bbcd552150f4   13 months ago   276MB
hyperledger/fabric-kafka       latest         7e0396b6d64e   13 months ago   270MB
hyperledger/fabric-couchdb     latest         b967e8b98b6b   13 months ago   261MB
hyperledger/fabric-ca          latest         72617b4fa9b4   3 years ago     299MB
hyperledger/fabric-ca          x86_64-1.1.0   72617b4fa9b4   3 years ago     299MB
hyperledger/fabric-tools       latest         b7bfddf508bc   3 years ago     1.46GB
hyperledger/fabric-tools       x86_64-1.1.0   b7bfddf508bc   3 years ago     1.46GB
hyperledger/fabric-orderer     latest         ce0c810df36a   3 years ago     180MB
hyperledger/fabric-orderer     x86_64-1.1.0   ce0c810df36a   3 years ago     180MB
hyperledger/fabric-peer        latest         b023f9be0771   3 years ago     187MB
hyperledger/fabric-peer        x86_64-1.1.0   b023f9be0771   3 years ago     187MB
hyperledger/fabric-javaenv     latest         82098abb1a17   3 years ago     1.52GB
hyperledger/fabric-javaenv     x86_64-1.1.0   82098abb1a17   3 years ago     1.52GB
hyperledger/fabric-ccenv       latest         c8b4909d8d46   3 years ago     1.39GB
hyperledger/fabric-ccenv       x86_64-1.1.0   c8b4909d8d46   3 years ago     1.39GB

11. 启动Fabric网络完成chaincode测试(运行例子:e2e_cli)

注意:修改示例源代码中的一个错误(少了一个下划线)

cd ~/go/src/github.com/hyperledger/fabric/examples/e2e_cli/base/

vi peer-base.yaml

将以下内容:
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2ecli_default
修改为:
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=e2e_cli_default

运行示例

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

./network_setup.sh up

显示:

root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli# ./network_setup.sh up
setting to default channel 'mychannel'
mychannel

Building cryptogen
make: Entering directory '/home/allan/go/src/github.com/hyperledger/fabric'
Makefile:92: *** "No go in PATH: Check dependencies"。 停止。
make: Leaving directory '/home/allan/go/src/github.com/hyperledger/fabric'

##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
generateArtifacts.sh: 行 58: /home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli/../../release/linux-amd64/bin/cryptogen: 没有那个文件或目录

generateArtifacts.sh: 第 33 行: cd: crypto-config/peerOrganizations/org1.example.com/ca/: 没有那个文件或目录
ls: 无法访问'*_sk': 没有那个文件或目录
generateArtifacts.sh: 第 37 行: cd: crypto-config/peerOrganizations/org2.example.com/ca/: 没有那个文件或目录
ls: 无法访问'*_sk': 没有那个文件或目录
Building configtxgen
make: Entering directory '/home/allan/go/src/github.com/hyperledger/fabric'
Makefile:92: *** "No go in PATH: Check dependencies"。 停止。
make: Leaving directory '/home/allan/go/src/github.com/hyperledger/fabric'
##########################################################
#########  Generating Orderer Genesis block ##############
##########################################################
generateArtifacts.sh: 行 78: /home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli/../../release/linux-amd64/bin/configtxgen: 没有那个文件或目录

#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
generateArtifacts.sh: 行 84: /home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli/../../release/linux-amd64/bin/configtxgen: 没有那个文件或目录

#################################################################
#######    Generating anchor peer update for Org1MSP   ##########
#################################################################
generateArtifacts.sh: 行 90: /home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli/../../release/linux-amd64/bin/configtxgen: 没有那个文件或目录

#################################################################
#######    Generating anchor peer update for Org2MSP   ##########
#################################################################
generateArtifacts.sh: 行 96: /home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli/../../release/linux-amd64/bin/configtxgen: 没有那个文件或目录

Creating network "e2e_cli_default" with the default driver
Creating peer0.org1.example.com ... done
Creating zookeeper0             ... done
Creating peer1.org1.example.com ... done
Creating peer1.org2.example.com ... done
Creating zookeeper2             ... done
Creating zookeeper1             ... done
Creating peer0.org2.example.com ... done
Creating kafka2                 ... done
Creating kafka3                 ... done
Creating kafka1                 ... done
Creating kafka0                 ... done
Creating orderer.example.com    ... done
Creating cli                    ... done

 ____    _____      _      ____    _____           _____   ____    _____ 
/ ___|  |_   _|    / \    |  _ \  |_   _|         | ____| |___ \  | ____|
\___ \    | |     / _ \   | |_) |   | |    _____  |  _|     __) | |  _|  
 ___) |   | |    / ___ \  |  _ <    | |   |_____| | |___   / __/  | |___ 
|____/    |_|   /_/   \_\ |_| \_\   |_|           |_____| |_____| |_____|
Channel name : mychannel
Check orderering service availability...
Attempting to fetch system channel 'testchainid' ...3 secs
Attempting to fetch system channel 'testchainid' ...6 secs
Attempting to fetch system channel 'testchainid' ...9 secs
Attempting to fetch system channel 'testchainid' ...12 secs
Attempting to fetch system channel 'testchainid' ...15 secs
Attempting to fetch system channel 'testchainid' ...18 secs
Attempting to fetch system channel 'testchainid' ...21 secs
Attempting to fetch system channel 'testchainid' ...25 secs
Attempting to fetch system channel 'testchainid' ...28 secs
Attempting to fetch system channel 'testchainid' ...31 secs
Attempting to fetch system channel 'testchainid' ...34 secs
Attempting to fetch system channel 'testchainid' ...37 secs
Attempting to fetch system channel 'testchainid' ...40 secs
Attempting to fetch system channel 'testchainid' ...43 secs
Attempting to fetch system channel 'testchainid' ...46 secs
Attempting to fetch system channel 'testchainid' ...49 secs
Attempting to fetch system channel 'testchainid' ...52 secs
Attempting to fetch system channel 'testchainid' ...55 secs
Attempting to fetch system channel 'testchainid' ...58 secs
Attempting to fetch system channel 'testchainid' ...61 secs
2021-08-10 09:06:39.406 UTC [main] main -> ERRO 001 Cannot run peer because error when setting up MSP of type bccsp from directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp: could not load a valid signer certificate from directory /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts: stat /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/signcerts: no such file or directory
!!!!!!!!!!!!!!! Ordering Service is not available, Please try again ... !!!!!!!!!!!!!!!!
================== ERROR !!! FAILED to execute End-2-End Scenario ==================

成功运行后显示:

root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli# ./network_setup.sh up
setting to default channel 'mychannel'
mychannel

Building cryptogen
make: Entering directory '/home/allan/go/src/github.com/hyperledger/fabric'
Building release/linux-amd64/bin/configtxgen for linux-amd64
mkdir -p release/linux-amd64/bin
CGO_CFLAGS=" " GOOS=linux GOARCH=amd64 go build -o /home/allan/go/src/github.com/hyperledger/fabric/release/linux-amd64/bin/configtxgen -tags "nopkcs11" -ldflags "-X github.com/hyperledger/fabric/common/tools/configtxgen/metadata.Version=1.1.0" github.com/hyperledger/fabric/common/tools/configtxgen
Building release/linux-amd64/bin/cryptogen for linux-amd64
mkdir -p release/linux-amd64/bin
CGO_CFLAGS=" " GOOS=linux GOARCH=amd64 go build -o /home/allan/go/src/github.com/hyperledger/fabric/release/linux-amd64/bin/cryptogen -tags "nopkcs11" -ldflags "-X github.com/hyperledger/fabric/common/tools/cryptogen/metadata.Version=1.1.0" github.com/hyperledger/fabric/common/tools/cryptogen
Building release/linux-amd64/bin/configtxlator for linux-amd64
mkdir -p release/linux-amd64/bin
CGO_CFLAGS=" " GOOS=linux GOARCH=amd64 go build -o /home/allan/go/src/github.com/hyperledger/fabric/release/linux-amd64/bin/configtxlator -tags "nopkcs11" -ldflags "-X github.com/hyperledger/fabric/common/tools/configtxlator/metadata.Version=1.1.0" github.com/hyperledger/fabric/common/tools/configtxlator
Building release/linux-amd64/bin/peer for linux-amd64
mkdir -p release/linux-amd64/bin
CGO_CFLAGS=" " GOOS=linux GOARCH=amd64 go build -o /home/allan/go/src/github.com/hyperledger/fabric/release/linux-amd64/bin/peer -tags "nopkcs11" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.1.0 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.4.6 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.Experimental=false" github.com/hyperledger/fabric/peer
Building release/linux-amd64/bin/orderer for linux-amd64
mkdir -p release/linux-amd64/bin
CGO_CFLAGS=" " GOOS=linux GOARCH=amd64 go build -o /home/allan/go/src/github.com/hyperledger/fabric/release/linux-amd64/bin/orderer -tags "nopkcs11" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.1.0 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.4.6 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.Experimental=false" github.com/hyperledger/fabric/orderer
mkdir -p release/linux-amd64/bin
make: Leaving directory '/home/allan/go/src/github.com/hyperledger/fabric'

##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
org1.example.com
org2.example.com

Using configtxgen -> /home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli/../../release/linux-amd64/bin/configtxgen
##########################################################
#########  Generating Orderer Genesis block ##############
##########################################################
2021-08-10 17:32:13.221 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2021-08-10 17:32:13.232 CST [msp] getMspConfig -> INFO 002 Loading NodeOUs
2021-08-10 17:32:13.232 CST [msp] getMspConfig -> INFO 003 Loading NodeOUs
2021-08-10 17:32:13.232 CST [common/tools/configtxgen] doOutputBlock -> INFO 004 Generating genesis block
2021-08-10 17:32:13.232 CST [common/tools/configtxgen] doOutputBlock -> INFO 005 Writing genesis block

#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
2021-08-10 17:32:13.247 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2021-08-10 17:32:13.252 CST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx
2021-08-10 17:32:13.253 CST [msp] getMspConfig -> INFO 003 Loading NodeOUs
2021-08-10 17:32:13.253 CST [msp] getMspConfig -> INFO 004 Loading NodeOUs
2021-08-10 17:32:13.269 CST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 005 Writing new channel tx

#################################################################
#######    Generating anchor peer update for Org1MSP   ##########
#################################################################
2021-08-10 17:32:13.282 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2021-08-10 17:32:13.288 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2021-08-10 17:32:13.288 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update
#################################################################
#######    Generating anchor peer update for Org2MSP   ##########
#################################################################
2021-08-10 17:32:13.302 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2021-08-10 17:32:13.308 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2021-08-10 17:32:13.308 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update
Creating network "e2e_cli_default" with the default driver
Creating peer1.org1.example.com ... done
Creating zookeeper1             ... done
Creating peer0.org1.example.com ... done
Creating zookeeper0             ... done
Creating peer1.org2.example.com ... done
Creating peer0.org2.example.com ... done
Creating zookeeper2             ... done
Creating kafka1                 ... done
Creating kafka3                 ... done
Creating kafka0                 ... done
Creating kafka2                 ... done
Creating orderer.example.com    ... done
Creating cli                    ... done

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

Channel name : mychannel
Check orderering service availability...
Attempting to fetch system channel 'testchainid' ...3 secs
Attempting to fetch system channel 'testchainid' ...6 secs
2021-08-10 09:32:34.899 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:32:34.899 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:32:34.904 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2021-08-10 09:32:34.904 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2021-08-10 09:32:34.904 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2021-08-10 09:32:34.905 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2021-08-10 09:32:34.905 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2021-08-10 09:32:34.905 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0AC9060A1708021A0608B28FC9880622...10BAC276E16812080A021A0012021A00 
2021-08-10 09:32:34.905 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: 232E3B3B3CD788B89FADC97A7EA2567D89A344E5D121FE229F631EC89A0A032A 
2021-08-10 09:32:34.911 UTC [channelCmd] readBlock -> DEBU 00a Received block: 0
2021-08-10 09:32:34.912 UTC [main] main -> INFO 00b Exiting.....
===================== Ordering Service is up and running ===================== 

Creating channel...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2021-08-10 09:32:35.086 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:32:35.086 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:32:35.091 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2021-08-10 09:32:35.092 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2021-08-10 09:32:35.092 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2021-08-10 09:32:35.092 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2021-08-10 09:32:35.092 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2021-08-10 09:32:35.092 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0ABA060A074F7267314D535012AE062D...53616D706C65436F6E736F727469756D 
2021-08-10 09:32:35.092 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: B2C6958DD62763B3B642F66E520A023E1FFA2D83EDF69CAB2F3278595C7076D9 
2021-08-10 09:32:35.092 UTC [msp] GetLocalMSP -> DEBU 00a Returning existing local MSP
2021-08-10 09:32:35.092 UTC [msp] GetDefaultSigningIdentity -> DEBU 00b Obtaining default signing identity
2021-08-10 09:32:35.093 UTC [msp] GetLocalMSP -> DEBU 00c Returning existing local MSP
2021-08-10 09:32:35.093 UTC [msp] GetDefaultSigningIdentity -> DEBU 00d Obtaining default signing identity
2021-08-10 09:32:35.093 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AF1060A1508021A0608B38FC9880622...70A2CAE2B99E65C8020610F610960605 
2021-08-10 09:32:35.093 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: FC5ACEFC63FFC8807B8B933972E41A9934DC9C636490B99D7310F86AA00BE460 
2021-08-10 09:32:35.188 UTC [msp] GetLocalMSP -> DEBU 010 Returning existing local MSP
2021-08-10 09:32:35.188 UTC [msp] GetDefaultSigningIdentity -> DEBU 011 Obtaining default signing identity
2021-08-10 09:32:35.188 UTC [msp] GetLocalMSP -> DEBU 012 Returning existing local MSP
2021-08-10 09:32:35.188 UTC [msp] GetDefaultSigningIdentity -> DEBU 013 Obtaining default signing identity
2021-08-10 09:32:35.188 UTC [msp/identity] Sign -> DEBU 014 Sign: plaintext: 0AF1060A1508021A0608B38FC9880622...C947AC53A75B12080A021A0012021A00 
2021-08-10 09:32:35.188 UTC [msp/identity] Sign -> DEBU 015 Sign: digest: 3BDA2527258D8F5741039E8BDC92145474A442B37DE4D36DC5DD8940D6D20466 
2021-08-10 09:32:35.190 UTC [channelCmd] readBlock -> DEBU 016 Got status: &{NOT_FOUND}
2021-08-10 09:32:35.190 UTC [msp] GetLocalMSP -> DEBU 017 Returning existing local MSP
2021-08-10 09:32:35.190 UTC [msp] GetDefaultSigningIdentity -> DEBU 018 Obtaining default signing identity
2021-08-10 09:32:35.193 UTC [channelCmd] InitCmdFactory -> INFO 019 Endorser and orderer connections initialized
2021-08-10 09:32:35.393 UTC [msp] GetLocalMSP -> DEBU 01a Returning existing local MSP
2021-08-10 09:32:35.393 UTC [msp] GetDefaultSigningIdentity -> DEBU 01b Obtaining default signing identity
2021-08-10 09:32:35.393 UTC [msp] GetLocalMSP -> DEBU 01c Returning existing local MSP
2021-08-10 09:32:35.394 UTC [msp] GetDefaultSigningIdentity -> DEBU 01d Obtaining default signing identity
2021-08-10 09:32:35.394 UTC [msp/identity] Sign -> DEBU 01e Sign: plaintext: 0AF1060A1508021A0608B38FC9880622...3C343D38ADD712080A021A0012021A00 
2021-08-10 09:32:35.394 UTC [msp/identity] Sign -> DEBU 01f Sign: digest: C24C34A96488ED7DAAE804025D6A0894999234367CF135FDC494F66BDF5597A1 
2021-08-10 09:32:35.394 UTC [channelCmd] readBlock -> DEBU 020 Got status: &{SERVICE_UNAVAILABLE}
2021-08-10 09:32:35.394 UTC [msp] GetLocalMSP -> DEBU 021 Returning existing local MSP
2021-08-10 09:32:35.394 UTC [msp] GetDefaultSigningIdentity -> DEBU 022 Obtaining default signing identity
2021-08-10 09:32:35.396 UTC [channelCmd] InitCmdFactory -> INFO 023 Endorser and orderer connections initialized
2021-08-10 09:32:35.597 UTC [msp] GetLocalMSP -> DEBU 024 Returning existing local MSP
2021-08-10 09:32:35.597 UTC [msp] GetDefaultSigningIdentity -> DEBU 025 Obtaining default signing identity
2021-08-10 09:32:35.597 UTC [msp] GetLocalMSP -> DEBU 026 Returning existing local MSP
2021-08-10 09:32:35.597 UTC [msp] GetDefaultSigningIdentity -> DEBU 027 Obtaining default signing identity
2021-08-10 09:32:35.597 UTC [msp/identity] Sign -> DEBU 028 Sign: plaintext: 0AF1060A1508021A0608B38FC9880622...A9EE00AFCEDA12080A021A0012021A00 
2021-08-10 09:32:35.597 UTC [msp/identity] Sign -> DEBU 029 Sign: digest: 8764741EAE88619BFDB4507A97ACD299B5D6FC161A11412D67543EBFA49C6413 
2021-08-10 09:32:35.597 UTC [channelCmd] readBlock -> DEBU 02a Got status: &{SERVICE_UNAVAILABLE}
2021-08-10 09:32:35.598 UTC [msp] GetLocalMSP -> DEBU 02b Returning existing local MSP
2021-08-10 09:32:35.598 UTC [msp] GetDefaultSigningIdentity -> DEBU 02c Obtaining default signing identity
2021-08-10 09:32:35.600 UTC [channelCmd] InitCmdFactory -> INFO 02d Endorser and orderer connections initialized
2021-08-10 09:32:35.800 UTC [msp] GetLocalMSP -> DEBU 02e Returning existing local MSP
2021-08-10 09:32:35.800 UTC [msp] GetDefaultSigningIdentity -> DEBU 02f Obtaining default signing identity
2021-08-10 09:32:35.801 UTC [msp] GetLocalMSP -> DEBU 030 Returning existing local MSP
2021-08-10 09:32:35.801 UTC [msp] GetDefaultSigningIdentity -> DEBU 031 Obtaining default signing identity
2021-08-10 09:32:35.801 UTC [msp/identity] Sign -> DEBU 032 Sign: plaintext: 0AF1060A1508021A0608B38FC9880622...2C2590922AB212080A021A0012021A00 
2021-08-10 09:32:35.801 UTC [msp/identity] Sign -> DEBU 033 Sign: digest: 150F9E797C42251BD93F60D80114BEB0DA39CCD10EC71ECE140D4B05464BD776 
2021-08-10 09:32:35.814 UTC [channelCmd] readBlock -> DEBU 034 Received block: 0
2021-08-10 09:32:35.814 UTC [main] main -> INFO 035 Exiting.....
===================== Channel "mychannel" is created successfully ===================== 

Having all peers join the channel...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2021-08-10 09:32:35.859 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:32:35.859 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:32:35.862 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2021-08-10 09:32:35.862 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0AB8070A5C08011A0C08B38FC9880610...EF73407F02771A080A000A000A000A00 
2021-08-10 09:32:35.862 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: 3028533F26DC59878720DD8F063DF6EBE1F3E5F0DCC7F9EA847CD01D8BE87900 
2021-08-10 09:32:36.007 UTC [channelCmd] executeJoin -> INFO 006 Successfully submitted proposal to join channel
2021-08-10 09:32:36.007 UTC [main] main -> INFO 007 Exiting.....
===================== PEER0 joined on the channel "mychannel" ===================== 

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer1.org1.example.com:7051
2021-08-10 09:32:38.063 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:32:38.063 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:32:38.066 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2021-08-10 09:32:38.066 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0AB7070A5B08011A0B08B68FC9880610...EF73407F02771A080A000A000A000A00 
2021-08-10 09:32:38.066 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: D847AFF042DDF0A71DEAE615DEF91B4D3144B9355B8EF2C3B9040496FA5EC958 
2021-08-10 09:32:38.170 UTC [channelCmd] executeJoin -> INFO 006 Successfully submitted proposal to join channel
2021-08-10 09:32:38.170 UTC [main] main -> INFO 007 Exiting.....
===================== PEER1 joined on the channel "mychannel" ===================== 

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
2021-08-10 09:32:40.224 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:32:40.224 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:32:40.227 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2021-08-10 09:32:40.227 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0AB3070A5B08011A0B08B88FC9880610...EF73407F02771A080A000A000A000A00 
2021-08-10 09:32:40.227 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: 1543D808DF918CFCF396DB9FA57DF29D1CBC7F4A49DE6C53C5C9AC7D636675DC 
2021-08-10 09:32:40.345 UTC [channelCmd] executeJoin -> INFO 006 Successfully submitted proposal to join channel
2021-08-10 09:32:40.345 UTC [main] main -> INFO 007 Exiting.....
===================== PEER2 joined on the channel "mychannel" ===================== 

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer1.org2.example.com:7051
2021-08-10 09:32:42.395 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:32:42.395 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:32:42.397 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2021-08-10 09:32:42.398 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0AB4070A5C08011A0C08BA8FC9880610...EF73407F02771A080A000A000A000A00 
2021-08-10 09:32:42.398 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: CA70486BEA16B913A85C8E167D4DBC6A5FEE826E24844071DF7ACB2DC0AB6A4A 
2021-08-10 09:32:42.514 UTC [channelCmd] executeJoin -> INFO 006 Successfully submitted proposal to join channel
2021-08-10 09:32:42.514 UTC [main] main -> INFO 007 Exiting.....
===================== PEER3 joined on the channel "mychannel" ===================== 

Updating anchor peers for org1...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2021-08-10 09:32:44.556 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:32:44.556 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:32:44.563 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2021-08-10 09:32:44.564 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2021-08-10 09:32:44.564 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2021-08-10 09:32:44.564 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2021-08-10 09:32:44.564 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2021-08-10 09:32:44.564 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0ABA060A074F7267314D535012AE062D...2A0641646D696E732A0641646D696E73 
2021-08-10 09:32:44.564 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: 1B91A0B3C342B848DF84A8779FAAAB4559BF6640EFA3936733E5BE17B8016DCC 
2021-08-10 09:32:44.565 UTC [msp] GetLocalMSP -> DEBU 00a Returning existing local MSP
2021-08-10 09:32:44.565 UTC [msp] GetDefaultSigningIdentity -> DEBU 00b Obtaining default signing identity
2021-08-10 09:32:44.565 UTC [msp] GetLocalMSP -> DEBU 00c Returning existing local MSP
2021-08-10 09:32:44.565 UTC [msp] GetDefaultSigningIdentity -> DEBU 00d Obtaining default signing identity
2021-08-10 09:32:44.565 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AF1060A1508021A0608BC8FC9880622...7AB6B2DDA416E239E5DC5844556D2BDF 
2021-08-10 09:32:44.565 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: EB5D743C0F07036D60815BD8F5903A7B5B35147B2287A8A0B243AA2B8770E862 
2021-08-10 09:32:44.622 UTC [channelCmd] update -> INFO 010 Successfully submitted channel update
2021-08-10 09:32:44.622 UTC [main] main -> INFO 011 Exiting.....
===================== Anchor peers for org "Org1MSP" on "mychannel" is updated successfully ===================== 

Updating anchor peers for org2...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
2021-08-10 09:32:49.679 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:32:49.679 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:32:49.681 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2021-08-10 09:32:49.682 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2021-08-10 09:32:49.682 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2021-08-10 09:32:49.682 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2021-08-10 09:32:49.682 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2021-08-10 09:32:49.682 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0AB6060A074F7267324D535012AA062D...2A0641646D696E732A0641646D696E73 
2021-08-10 09:32:49.682 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: DAB4176935C9FE4622FCC0ED4FA8E6A4220ED27A5129BC43BD05118E5AA84660 
2021-08-10 09:32:49.682 UTC [msp] GetLocalMSP -> DEBU 00a Returning existing local MSP
2021-08-10 09:32:49.682 UTC [msp] GetDefaultSigningIdentity -> DEBU 00b Obtaining default signing identity
2021-08-10 09:32:49.682 UTC [msp] GetLocalMSP -> DEBU 00c Returning existing local MSP
2021-08-10 09:32:49.682 UTC [msp] GetDefaultSigningIdentity -> DEBU 00d Obtaining default signing identity
2021-08-10 09:32:49.682 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AED060A1508021A0608C18FC9880622...C05EABB246D58704F1E75C5D906CA0B4 
2021-08-10 09:32:49.682 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: B9F642E6C2AAA274DF9DDD637E65D9288BC8E8840F34BB95FED9E715810C9435 
2021-08-10 09:32:49.751 UTC [channelCmd] update -> INFO 010 Successfully submitted channel update
2021-08-10 09:32:49.751 UTC [main] main -> INFO 011 Exiting.....
===================== Anchor peers for org "Org2MSP" on "mychannel" is updated successfully ===================== 

Installing chaincode on org1/peer0...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2021-08-10 09:32:54.807 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:32:54.807 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:32:54.807 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2021-08-10 09:32:54.807 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2021-08-10 09:32:54.807 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2021-08-10 09:32:55.760 UTC [golang-platform] getCodeFromFS -> DEBU 006 getCodeFromFS github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
2021-08-10 09:32:56.493 UTC [golang-platform] func1 -> DEBU 007 Discarding GOROOT package fmt
2021-08-10 09:32:56.493 UTC [golang-platform] func1 -> DEBU 008 Discarding provided package github.com/hyperledger/fabric/core/chaincode/shim
2021-08-10 09:32:56.493 UTC [golang-platform] func1 -> DEBU 009 Discarding provided package github.com/hyperledger/fabric/protos/peer
2021-08-10 09:32:56.493 UTC [golang-platform] func1 -> DEBU 00a Discarding GOROOT package strconv
2021-08-10 09:32:56.493 UTC [golang-platform] GetDeploymentPayload -> DEBU 00b done
2021-08-10 09:32:56.493 UTC [container] WriteFileToPackage -> DEBU 00c Writing file to tarball: src/github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02/chaincode_example02.go
2021-08-10 09:32:56.497 UTC [container] WriteFileToPackage -> DEBU 00d Writing file to tarball: src/github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02/chaincode_example02_test.go
2021-08-10 09:32:56.499 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AB8070A5C08031A0C08C88FC9880610...83C77F030000FFFF1E416A37002E0000 
2021-08-10 09:32:56.499 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: F318D5CAAFB8859B2202D3F02C90E3807415EAB7D1E7F091748BF2D471A61CF1 
2021-08-10 09:32:56.511 UTC [chaincodeCmd] install -> DEBU 010 Installed remotely response:<status:200 payload:"OK" > 
2021-08-10 09:32:56.511 UTC [main] main -> INFO 011 Exiting.....
===================== Chaincode is installed on remote peer PEER0 ===================== 

Install chaincode on org2/peer0...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
2021-08-10 09:32:56.581 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:32:56.581 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:32:56.581 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2021-08-10 09:32:56.581 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2021-08-10 09:32:56.581 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2021-08-10 09:32:56.609 UTC [golang-platform] getCodeFromFS -> DEBU 006 getCodeFromFS github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
2021-08-10 09:32:56.703 UTC [golang-platform] func1 -> DEBU 007 Discarding GOROOT package fmt
2021-08-10 09:32:56.703 UTC [golang-platform] func1 -> DEBU 008 Discarding provided package github.com/hyperledger/fabric/core/chaincode/shim
2021-08-10 09:32:56.703 UTC [golang-platform] func1 -> DEBU 009 Discarding provided package github.com/hyperledger/fabric/protos/peer
2021-08-10 09:32:56.703 UTC [golang-platform] func1 -> DEBU 00a Discarding GOROOT package strconv
2021-08-10 09:32:56.703 UTC [golang-platform] GetDeploymentPayload -> DEBU 00b done
2021-08-10 09:32:56.703 UTC [container] WriteFileToPackage -> DEBU 00c Writing file to tarball: src/github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02/chaincode_example02.go
2021-08-10 09:32:56.705 UTC [container] WriteFileToPackage -> DEBU 00d Writing file to tarball: src/github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02/chaincode_example02_test.go
2021-08-10 09:32:56.705 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AB4070A5C08031A0C08C88FC9880610...83C77F030000FFFF1E416A37002E0000 
2021-08-10 09:32:56.705 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: 29C038EB8541A18DC7384E1993128BF1294669E726B6B8A55FAEBC6CB66E90BC 
2021-08-10 09:32:56.710 UTC [chaincodeCmd] install -> DEBU 010 Installed remotely response:<status:200 payload:"OK" > 
2021-08-10 09:32:56.710 UTC [main] main -> INFO 011 Exiting.....
===================== Chaincode is installed on remote peer PEER2 ===================== 

Instantiating chaincode on org2/peer2...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
2021-08-10 09:32:56.761 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:32:56.761 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:32:56.765 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2021-08-10 09:32:56.765 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2021-08-10 09:32:56.765 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2021-08-10 09:32:56.766 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0ABF070A6708031A0C08C88FC9880610...535010030A04657363630A0476736363 
2021-08-10 09:32:56.766 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: 837B834483A3EA2CED29D7CE81EAFA27C7292A3EAA4C1283590705CDD5307403 
2021-08-10 09:33:41.678 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0ABF070A6708031A0C08C88FC9880610...B3CD65A2CBF907BE22B48D9E9BD2CBE2 
2021-08-10 09:33:41.678 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: 03763293CA065A8BB64303B9BD4BF21B7DB931DE47C72C632DD6AEA19716CD14 
2021-08-10 09:33:41.693 UTC [main] main -> INFO 00a Exiting.....
===================== Chaincode Instantiation on PEER2 on channel 'mychannel' is successful ===================== 

Querying chaincode on org1/peer0...
===================== Querying on PEER0 on channel 'mychannel'... ===================== 
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
Attempting to Query PEER0 ...3 secs

2021-08-10 09:33:44.843 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:33:44.843 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:33:44.843 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2021-08-10 09:33:44.843 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2021-08-10 09:33:44.843 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2021-08-10 09:33:44.843 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0AC3070A6708031A0C08F88FC9880610...6D7963631A0A0A0571756572790A0161 
2021-08-10 09:33:44.843 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: 72640D5F055AC11DCE387452E12384A8D11B2021F7E810B171F6BFF50B277D1C 
Query Result: 100
2021-08-10 09:33:58.819 UTC [main] main -> INFO 008 Exiting.....
===================== Query on PEER0 on channel 'mychannel' is successful ===================== 
Sending invoke transaction on org1/peer0...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2021-08-10 09:33:58.912 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:33:58.912 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:33:58.914 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2021-08-10 09:33:58.914 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2021-08-10 09:33:58.914 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2021-08-10 09:33:58.914 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0AC3070A6708031A0C088690C9880610...696E766F6B650A01610A01620A023130 
2021-08-10 09:33:58.914 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: A7C8FCC998FAF95D560FDECE945BBA71AC3F9682F9166E00E427F0C3BEB85EAB 
2021-08-10 09:33:58.923 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0AC3070A6708031A0C088690C9880610...EF582BF01059FCCAED2684B682BD9337 
2021-08-10 09:33:58.923 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: EEA0F9B5C4CA70309372F1C8BD89AF5A5C85C52E5CF5521F22D6CBCBB81F50E6 
2021-08-10 09:33:58.939 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> DEBU 00a ESCC invoke result: version:1 response:<status:200 message:"OK" > payload:"\n {\326\354\234K}\034y\274\340\370\021\021\037\362\022\252@\311\241|\230\227T!\034K\374\354\276\210\252\022Y\nE\022\024\n\004lscc\022\014\n\n\n\004mycc\022\002\010\003\022-\n\004mycc\022%\n\007\n\001a\022\002\010\003\n\007\n\001b\022\002\010\003\032\007\n\001a\032\00290\032\010\n\001b\032\003210\032\003\010\310\001\"\013\022\004mycc\032\0031.0" endorsement:<endorser:"\n\007Org1MSP\022\252\006-----BEGIN CERTIFICATE-----\nMIICKDCCAc+gAwIBAgIRAJizlbkiq/DRuBaOBqmUqMAwCgYIKoZIzj0EAwIwczEL\nMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG\ncmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjEwODEwMDkyNzEzWhcNMzEwODA4MDkyNzEz\nWjBqMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN\nU2FuIEZyYW5jaXNjbzENMAsGA1UECxMEcGVlcjEfMB0GA1UEAxMWcGVlcjAub3Jn\nMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABMdQ2jH2OlFn\nrLQIxHUo4C01XYP+xRJyATQR3FcvdydE4eA/k+IZg4qkjljB1Fwqi4Si47+bLzZs\nW12bldUTGeqjTTBLMA4GA1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1Ud\nIwQkMCKAIP814ql6kIycmvhPPefiyL7+ywyswR+pKOiS+YUV47DUMAoGCCqGSM49\nBAMCA0cAMEQCIDkYQ7bYif0qHW3h8dixDOjUS8LljVHr4tR8HZZQ73PVAiAC6c+4\nIJeUkO814unKgAz7dY9oxE7KLrpgBjAo8csZiw==\n-----END CERTIFICATE-----\n" signature:"0E\002!\000\307\235\\\244\270n9=J\373y\241<\035\333\345\317v\244\\\232M\277,\304\316\000x\364\257\376\231\002 \\:\254\020\355!z\220,\212\373@\324J\r\307\357X+\360\020Y\374\312\355&\204\266\202\275\2237" > 
2021-08-10 09:33:58.939 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 00b Chaincode invoke successful. result: status:200 
2021-08-10 09:33:58.939 UTC [main] main -> INFO 00c Exiting.....
===================== Invoke transaction on PEER0 on channel 'mychannel' is successful ===================== 

Installing chaincode on org2/peer3...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer1.org2.example.com:7051
2021-08-10 09:33:58.977 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:33:58.977 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:33:58.977 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2021-08-10 09:33:58.977 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2021-08-10 09:33:58.977 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2021-08-10 09:33:59.012 UTC [golang-platform] getCodeFromFS -> DEBU 006 getCodeFromFS github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
2021-08-10 09:33:59.120 UTC [golang-platform] func1 -> DEBU 007 Discarding GOROOT package fmt
2021-08-10 09:33:59.120 UTC [golang-platform] func1 -> DEBU 008 Discarding provided package github.com/hyperledger/fabric/core/chaincode/shim
2021-08-10 09:33:59.120 UTC [golang-platform] func1 -> DEBU 009 Discarding provided package github.com/hyperledger/fabric/protos/peer
2021-08-10 09:33:59.120 UTC [golang-platform] func1 -> DEBU 00a Discarding GOROOT package strconv
2021-08-10 09:33:59.120 UTC [golang-platform] GetDeploymentPayload -> DEBU 00b done
2021-08-10 09:33:59.120 UTC [container] WriteFileToPackage -> DEBU 00c Writing file to tarball: src/github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02/chaincode_example02.go
2021-08-10 09:33:59.122 UTC [container] WriteFileToPackage -> DEBU 00d Writing file to tarball: src/github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02/chaincode_example02_test.go
2021-08-10 09:33:59.122 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AB3070A5B08031A0B088790C9880610...83C77F030000FFFF1E416A37002E0000 
2021-08-10 09:33:59.122 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: 449C687F4919E488669065684F4BFD2EE2A5527AD70397497265CCE239A404C8 
2021-08-10 09:33:59.127 UTC [chaincodeCmd] install -> DEBU 010 Installed remotely response:<status:200 payload:"OK" > 
2021-08-10 09:33:59.127 UTC [main] main -> INFO 011 Exiting.....
===================== Chaincode is installed on remote peer PEER3 ===================== 

Querying chaincode on org2/peer3...
===================== Querying on PEER3 on channel 'mychannel'... ===================== 
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer1.org2.example.com:7051
Attempting to Query PEER3 ...3 secs

2021-08-10 09:34:02.190 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 09:34:02.190 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 09:34:02.190 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2021-08-10 09:34:02.190 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2021-08-10 09:34:02.190 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2021-08-10 09:34:02.190 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0ABE070A6608031A0B088A90C9880610...6D7963631A0A0A0571756572790A0161 
2021-08-10 09:34:02.190 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: 1F5DF746682894D0F48C86490C0DE16882E3D50A294E2785065417F72DB17045 
Query Result: 90
2021-08-10 09:34:15.623 UTC [main] main -> INFO 008 Exiting.....
===================== Query on PEER3 on channel 'mychannel' is successful ===================== 

===================== All GOOD, End-2-End execution completed ===================== 


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


查看启动的容器

root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli# docker ps
CONTAINER ID   IMAGE                                                                                                  COMMAND                  CREATED       STATUS       PORTS                                                                                                                                   NAMES
98f51cecf820   dev-peer1.org2.example.com-mycc-1.0-26c2ef32838554aac4f7ad6f100aca865e87959c9a126e86d764c8d01f8346ab   "chaincode -peer.add…"   2 hours ago   Up 2 hours                                                                                                                                           dev-peer1.org2.example.com-mycc-1.0
f1e583931f87   dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9   "chaincode -peer.add…"   2 hours ago   Up 2 hours                                                                                                                                           dev-peer0.org1.example.com-mycc-1.0
416f9bece364   dev-peer0.org2.example.com-mycc-1.0-15b571b3ce849066b7ec74497da3b27e54e0df1345daff3951b94245ce09c42b   "chaincode -peer.add…"   2 hours ago   Up 2 hours                                                                                                                                           dev-peer0.org2.example.com-mycc-1.0
a0e0dda81f8c   hyperledger/fabric-tools                                                                               "/bin/bash -c './scr…"   2 hours ago   Up 2 hours                                                                                                                                           cli
dd6fa7ad40f0   hyperledger/fabric-orderer                                                                             "orderer"                2 hours ago   Up 2 hours   0.0.0.0:7050->7050/tcp, :::7050->7050/tcp                                                                                               orderer.example.com
7f4c6b5dbfc9   hyperledger/fabric-kafka                                                                               "/docker-entrypoint.…"   2 hours ago   Up 2 hours   9093/tcp, 0.0.0.0:49178->9092/tcp, :::49178->9092/tcp                                                                                   kafka0
a6eec310e603   hyperledger/fabric-kafka                                                                               "/docker-entrypoint.…"   2 hours ago   Up 2 hours   9093/tcp, 0.0.0.0:49177->9092/tcp, :::49177->9092/tcp                                                                                   kafka2
0896724d0ca8   hyperledger/fabric-kafka                                                                               "/docker-entrypoint.…"   2 hours ago   Up 2 hours   9093/tcp, 0.0.0.0:49176->9092/tcp, :::49176->9092/tcp                                                                                   kafka3
20f8038d8293   hyperledger/fabric-kafka                                                                               "/docker-entrypoint.…"   2 hours ago   Up 2 hours   9093/tcp, 0.0.0.0:49175->9092/tcp, :::49175->9092/tcp                                                                                   kafka1
75affc9f9a34   hyperledger/fabric-zookeeper                                                                           "/docker-entrypoint.…"   2 hours ago   Up 2 hours   0.0.0.0:49173->2181/tcp, :::49173->2181/tcp, 0.0.0.0:49170->2888/tcp, :::49170->2888/tcp, 0.0.0.0:49167->3888/tcp, :::49167->3888/tcp   zookeeper2
0668b944a1fc   hyperledger/fabric-peer                                                                                "peer node start"        2 hours ago   Up 2 hours   0.0.0.0:9051->7051/tcp, :::9051->7051/tcp, 0.0.0.0:9052->7052/tcp, :::9052->7052/tcp, 0.0.0.0:9053->7053/tcp, :::9053->7053/tcp         peer0.org2.example.com
eb448065a605   hyperledger/fabric-zookeeper                                                                           "/docker-entrypoint.…"   2 hours ago   Up 2 hours   0.0.0.0:49171->2181/tcp, :::49171->2181/tcp, 0.0.0.0:49168->2888/tcp, :::49168->2888/tcp, 0.0.0.0:49166->3888/tcp, :::49166->3888/tcp   zookeeper0
e86583b8bce3   hyperledger/fabric-peer                                                                                "peer node start"        2 hours ago   Up 2 hours   0.0.0.0:10051->7051/tcp, :::10051->7051/tcp, 0.0.0.0:10052->7052/tcp, :::10052->7052/tcp, 0.0.0.0:10053->7053/tcp, :::10053->7053/tcp   peer1.org2.example.com
88aaf4964fa9   hyperledger/fabric-peer                                                                                "peer node start"        2 hours ago   Up 2 hours   0.0.0.0:7051-7053->7051-7053/tcp, :::7051-7053->7051-7053/tcp                                                                           peer0.org1.example.com
1e8207071dd3   hyperledger/fabric-zookeeper                                                                           "/docker-entrypoint.…"   2 hours ago   Up 2 hours   0.0.0.0:49174->2181/tcp, :::49174->2181/tcp, 0.0.0.0:49172->2888/tcp, :::49172->2888/tcp, 0.0.0.0:49169->3888/tcp, :::49169->3888/tcp   zookeeper1
fb7fb90aa4fe   hyperledger/fabric-peer                                                                                "peer node start"        2 hours ago   Up 2 hours   0.0.0.0:8051->7051/tcp, :::8051->7051/tcp, 0.0.0.0:8052->7052/tcp, :::8052->7052/tcp, 0.0.0.0:8053->7053/tcp, :::8053->7053/tcp         peer1.org1.example.com

查询测试

打开一个命令行窗口,关联cli节点

root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli# docker exec -it cli bash

查询a账户余额:

root@a0e0dda81f8c:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}' 
2021-08-10 11:08:44.249 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 11:08:44.257 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 11:08:44.259 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2021-08-10 11:08:44.259 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2021-08-10 11:08:44.260 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2021-08-10 11:08:44.261 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0AC2070A6608031A0B08BCBCC9880610...6D7963631A0A0A0571756572790A0161 
2021-08-10 11:08:44.262 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: D53CF7D09232CE70F015609EBC063B4EA9D8D2F9E59620C3BFB95EF6AFDA99B6 
Query Result: 90
2021-08-10 11:08:44.407 UTC [main] main -> INFO 008 Exiting.....

查询b账户余额:

root@a0e0dda81f8c:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n mycc -c '{"Args":["query","b"]}' 
2021-08-10 11:09:13.002 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 11:09:13.002 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 11:09:13.003 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2021-08-10 11:09:13.003 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2021-08-10 11:09:13.003 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2021-08-10 11:09:13.004 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0AC2070A6608031A0B08D9BCC9880610...6D7963631A0A0A0571756572790A0162 
2021-08-10 11:09:13.004 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: 43EDF3EBDAFB43C5619BED0B7DE6A8A472DF8FFF5CF82421017420B0DA1114FD 
Query Result: 210
2021-08-10 11:09:13.013 UTC [main] main -> INFO 008 Exiting.....

转账测试(b向a转账30):

root@a0e0dda81f8c:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode invoke -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n mycc -c '{"Args":["invoke","b","a","30"]}'
2021-08-10 11:09:54.189 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 11:09:54.189 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 11:09:54.192 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2021-08-10 11:09:54.192 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2021-08-10 11:09:54.192 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2021-08-10 11:09:54.193 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0AC2070A6608031A0B0882BDC9880610...696E766F6B650A01620A01610A023330 
2021-08-10 11:09:54.193 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: B527B33AC981D90665232E746B96840EEBDE6897D132F05CCADF2C711A94B95C 
2021-08-10 11:09:54.201 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0AC2070A6608031A0B0882BDC9880610...24F5754001414F8B2105128A0BF45DD0 
2021-08-10 11:09:54.201 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: 8706DDE81336D1625F525803D37E99816026CE36ECCA6F177913CDD73358F638 
2021-08-10 11:09:54.330 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> DEBU 00a ESCC invoke result: version:1 response:<status:200 message:"OK" > payload:"\n z\327\210\256\315\356{\370?\351\035\243\325\257\231\206\370\277\263\263\310XH\266!\356l\216\251\336qr\022Z\nF\022\024\n\004lscc\022\014\n\n\n\004mycc\022\002\010\003\022.\n\004mycc\022&\n\007\n\001a\022\002\010\004\n\007\n\001b\022\002\010\004\032\010\n\001a\032\003120\032\010\n\001b\032\003180\032\003\010\310\001\"\013\022\004mycc\032\0031.0" endorsement:<endorser:"\n\007Org1MSP\022\252\006-----BEGIN CERTIFICATE-----\nMIICKDCCAc+gAwIBAgIRAJizlbkiq/DRuBaOBqmUqMAwCgYIKoZIzj0EAwIwczEL\nMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG\ncmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHDAaBgNVBAMTE2Nh\nLm9yZzEuZXhhbXBsZS5jb20wHhcNMjEwODEwMDkyNzEzWhcNMzEwODA4MDkyNzEz\nWjBqMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN\nU2FuIEZyYW5jaXNjbzENMAsGA1UECxMEcGVlcjEfMB0GA1UEAxMWcGVlcjAub3Jn\nMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABMdQ2jH2OlFn\nrLQIxHUo4C01XYP+xRJyATQR3FcvdydE4eA/k+IZg4qkjljB1Fwqi4Si47+bLzZs\nW12bldUTGeqjTTBLMA4GA1UdDwEB/wQEAwIHgDAMBgNVHRMBAf8EAjAAMCsGA1Ud\nIwQkMCKAIP814ql6kIycmvhPPefiyL7+ywyswR+pKOiS+YUV47DUMAoGCCqGSM49\nBAMCA0cAMEQCIDkYQ7bYif0qHW3h8dixDOjUS8LljVHr4tR8HZZQ73PVAiAC6c+4\nIJeUkO814unKgAz7dY9oxE7KLrpgBjAo8csZiw==\n-----END CERTIFICATE-----\n" signature:"0D\002 3\207\177\215\245\376\247\364\361\244\304\20290\354\274=\245\025\031\247/=\266G\336E\177o\267\307\300\002 s\324\216\214\350\005\304h\207\270\374@dR  $\365u@\001AO\213!\005\022\212\013\364]\320" > 
2021-08-10 11:09:54.330 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 00b Chaincode invoke successful. result: status:200 
2021-08-10 11:09:54.330 UTC [main] main -> INFO 00c Exiting.....

再查询一下a账户的余额:

root@a0e0dda81f8c:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}' 
2021-08-10 11:10:12.693 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 11:10:12.693 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 11:10:12.693 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2021-08-10 11:10:12.693 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2021-08-10 11:10:12.693 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2021-08-10 11:10:12.693 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0AC3070A6708031A0C0894BDC9880610...6D7963631A0A0A0571756572790A0161 
2021-08-10 11:10:12.693 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: 982F41472A07192A382BF0B63D07EA9C37BB27A89923899DCAD12F23EDC58DA8 
Query Result: 120
2021-08-10 11:10:12.701 UTC [main] main -> INFO 008 Exiting.....

再查询一下b账户的余额:

root@a0e0dda81f8c:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n mycc -c '{"Args":["query","b"]}' 
2021-08-10 11:10:17.792 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2021-08-10 11:10:17.792 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2021-08-10 11:10:17.792 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2021-08-10 11:10:17.792 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2021-08-10 11:10:17.792 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2021-08-10 11:10:17.792 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0AC3070A6708031A0C0899BDC9880610...6D7963631A0A0A0571756572790A0162 
2021-08-10 11:10:17.792 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: E9A30B26B9EB129EA59CB4A0EAD655BC003580A0186610574A78F09FE18562D8 
Query Result: 180
2021-08-10 11:10:17.802 UTC [main] main -> INFO 008 Exiting.....
root@a0e0dda81f8c:/opt/gopath/src/github.com/hyperledger/fabric/peer# exit
exit

退出测试网络

root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric/examples/e2e_cli# ./network_setup.sh down
setting to default channel 'mychannel'
WARNING: The CHANNEL_NAME variable is not set. Defaulting to a blank string.
WARNING: The TIMEOUT variable is not set. Defaulting to a blank string.
Stopping cli                    ... done
Stopping orderer.example.com    ... done
Stopping kafka0                 ... done
Stopping kafka2                 ... done
Stopping kafka3                 ... done
Stopping kafka1                 ... done
Stopping zookeeper2             ... done
Stopping peer0.org2.example.com ... done
Stopping zookeeper0             ... done
Stopping peer1.org2.example.com ... done
Stopping peer0.org1.example.com ... done
Stopping zookeeper1             ... done
Stopping peer1.org1.example.com ... done
Removing cli                    ... done
Removing orderer.example.com    ... done
Removing kafka0                 ... done
Removing kafka2                 ... done
Removing kafka3                 ... done
Removing kafka1                 ... done
Removing zookeeper2             ... done
Removing peer0.org2.example.com ... done
Removing zookeeper0             ... done
Removing peer1.org2.example.com ... done
Removing peer0.org1.example.com ... done
Removing zookeeper1             ... done
Removing peer1.org1.example.com ... done
Removing network e2e_cli_default
98f51cecf820
f1e583931f87
416f9bece364
Untagged: dev-peer1.org2.example.com-mycc-1.0-26c2ef32838554aac4f7ad6f100aca865e87959c9a126e86d764c8d01f8346ab:latest
Deleted: sha256:633aed2866a533e3e878b72db37fb577ecb51a10460663d55e741290a176780e
Deleted: sha256:118ab5f418443e0998a30026cee1f3ea75c4fbfe13667bc422082042aaae8774
Deleted: sha256:fb5435cbf410c4aa9eaaa9ce03b42e95f60d79d4b4a5046e70504154627a9dbb
Deleted: sha256:a846563a049ade2b74d7188b9056f19179c7c74d4731ea8eed6d859cd75b7a41
Untagged: dev-peer0.org1.example.com-mycc-1.0-384f11f484b9302df90b453200cfb25174305fce8f53f4e94d45ee3b6cab0ce9:latest
Deleted: sha256:258a93cf3bf8023416ec931b6dec21700fddeb83d8265b90a7f0f3afd32137d7
Deleted: sha256:e77c14e97042bf006ff049df4d9c127c01cf78a32399f46243eb06816fc6904d
Deleted: sha256:e40adbaab64dca36e3403b2465bda38b6844ba3fa3870e783bf411fe621161d7
Deleted: sha256:9f6ef7a56a84befb97a243ded9e4fc9b7de5edfc7ed37f3b0f96ba54d07a44cd
Untagged: dev-peer0.org2.example.com-mycc-1.0-15b571b3ce849066b7ec74497da3b27e54e0df1345daff3951b94245ce09c42b:latest
Deleted: sha256:4ad49203eca6ae5c6e0e6cc2955556e7960f7027c720610453b0fbe99f3f52d5
Deleted: sha256:5d7492bd788ede1dbc29051247939eeafc582b565819458ce5817426d1e584e2
Deleted: sha256:3257d59054f8435081b92a0ed95f22704bcc90380dfd9f24fe1138508ed27eb7
Deleted: sha256:57b50d94d3072e0f96c47debd580ae4fbec2eb823977e2f9def4dd783763d06a

12.[可选]安装fabric-samples

## 下载fabric-samples
cd /home/allan/go/src/github.com/hyperledger/
git clone https://github.com/hyperledger/fabric-samples.git

## 切换到release-1.1分支
cd fabric-samples
git checkout v1.1.0
# git checkout release-1.1
git branch -

## 进入到fabric-samples文件夹,通过wget下载1.1.0 版本的二进制文件
 cd fabric-samples/
# wget https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/linux-amd64-1.1.0/hyperledger-fabric-linux-amd64-1.1.0.tar.gz
 wget https://github.com/hyperledger/fabric/releases/download/v1.1.0/hyperledger-fabric-linux-amd64-1.1.0.tar.gz
# 解压下载的文件,会发现多了bin和config两个个文件夹
tar -zxvf hyperledger-fabric-linux-amd64-1.1.0.tar.gz 
# 将bin文件夹下的二进制文件,拷贝到环境变量中
cp bin/* /usr/local/bin

## 快速部署一个fabric网络
# 进入到fabric-samples/first-network
cd $GOPATH/src/github.com/hyperledger/fabric-samples/first-network
# 生成配置文件。执行下方代码后,会出现Continue? [Y/n]输入y选择同意后,则默认生成的通道名为mychannel的配置信息
./byfn.sh generate
# 起动项目
./byfn.sh -m up
# 成功后,关闭网络
./byfn.sh -m down
root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric-samples/first-network# ./byfn.sh generate

## 在这里确认生成创世区块 以及 通道
Generating certs and genesis block for with channel 'mychannel' and CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] Y
proceeding ...

## 调用cryptogen生成证书以及秘钥
## 对应的生成配置为crypto-config.yaml
## 生成的数字证书以及私钥都存储在crypto-config中
/home/allan/go/src/github.com/hyperledger/fabric-samples/first-network/../bin/cryptogen

##########################################################
##### Generate certificates using cryptogen tool #########
#####           使用cryptogen工具生成证书           #########
##########################################################
+ cryptogen generate --config=./crypto-config.yaml#这里有写配置文件
org1.example.com # 创建的两个对等节点的域名
org2.example.com
+ res=0
+ set +x

/home/allan/go/src/github.com/hyperledger/fabric-samples/first-network/../bin/configtxgen
##########################################################
#########  Generating Orderer Genesis block ##############
#########  使用configtxgen工具生成创世区块     ##############
#########  创世区块启动共识服务节点            ##############
##########################################################
+ configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
2021-08-12 22:34:38.765 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2021-08-12 22:34:38.772 CST [msp] getMspConfig -> INFO 002 Loading NodeOUs
2021-08-12 22:34:38.772 CST [msp] getMspConfig -> INFO 003 Loading NodeOUs
2021-08-12 22:34:38.772 CST [common/tools/configtxgen] doOutputBlock -> INFO 004 Generating genesis block
2021-08-12 22:34:38.772 CST [common/tools/configtxgen] doOutputBlock -> INFO 005 Writing genesis block
+ res=0
+ set +x

#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#########  使用configtxgen工具生成通道配置事务     ##############
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel
2021-08-12 22:34:38.779 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2021-08-12 22:34:38.785 CST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx
2021-08-12 22:34:38.785 CST [msp] getMspConfig -> INFO 003 Loading NodeOUs
2021-08-12 22:34:38.786 CST [msp] getMspConfig -> INFO 004 Loading NodeOUs
2021-08-12 22:34:38.807 CST [common/tools/configtxgen] doOutputChannelCreateTx -> INFO 005 Writing new channel tx
+ res=0
+ set +x

#################################################################
#######    Generating anchor peer update for Org1MSP   ##########
#########  使用configtxgen工具生成锚节点                    ########
#########  锚节点能被其他所有对等节点发现并进行通信的一种对等节点 ########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
2021-08-12 22:34:38.822 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2021-08-12 22:34:38.828 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2021-08-12 22:34:38.828 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update
+ res=0
+ set +x

#################################################################
#######    Generating anchor peer update for Org2MSP   ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org2MSPanchors.tx -channelID mychannel -asOrg Org2MSP
2021-08-12 22:34:38.841 CST [common/tools/configtxgen] main -> INFO 001 Loading configuration
2021-08-12 22:34:38.847 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2021-08-12 22:34:38.847 CST [common/tools/configtxgen] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update
+ res=0
+ set +x
## 启动网络
root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric-samples/first-network# ./byfn.sh up
Starting with channel 'mychannel' and CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] Y
proceeding ...
2021-08-12 14:52:11.668 UTC [main] main -> INFO 001 Exiting.....
LOCAL_VERSION=1.1.0
DOCKER_IMAGE_VERSION=1.1.0
Creating network "net_byfn" with the default driver
Creating volume "net_orderer.example.com" with default driver
Creating volume "net_peer0.org1.example.com" with default driver
Creating volume "net_peer1.org1.example.com" with default driver
Creating volume "net_peer0.org2.example.com" with default driver
Creating volume "net_peer1.org2.example.com" with default driver
## 创建org1中的对等节点peer0
Creating peer0.org1.example.com ... done
## 创建org2中的对等节点peer1
Creating peer1.org2.example.com ... done
## 创建org1中的对等节点peer1
Creating peer1.org1.example.com ... done
## 创建共识节点orderer
Creating orderer.example.com    ... done
## 创建org2中的对等节点peer0
Creating peer0.org2.example.com ... done
Creating cli                    ... done

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

Build your first network (BYFN) end-to-end test

Channel name : mychannel
Creating channel...## 创建通道
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
+ peer channel create -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/channel.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2021-08-12 14:52:20.695 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2021-08-12 14:52:20.736 UTC [channelCmd] InitCmdFactory -> INFO 002 Endorser and orderer connections initialized
2021-08-12 14:52:20.942 UTC [main] main -> INFO 003 Exiting.....
===================== Channel "mychannel" is created successfully ===================== 

## 将对等节点加入到通道
Having all peers join the channel...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2021-08-12 14:52:21.023 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2021-08-12 14:52:21.223 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
2021-08-12 14:52:21.223 UTC [main] main -> INFO 003 Exiting.....
===================== peer0.org1 joined on the channel "mychannel" ===================== 

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer1.org1.example.com:7051
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2021-08-12 14:52:24.294 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2021-08-12 14:52:24.406 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
2021-08-12 14:52:24.406 UTC [main] main -> INFO 003 Exiting.....
===================== peer1.org1 joined on the channel "mychannel" ===================== 

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2021-08-12 14:52:27.469 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2021-08-12 14:52:27.570 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
2021-08-12 14:52:27.571 UTC [main] main -> INFO 003 Exiting.....
===================== peer0.org2 joined on the channel "mychannel" ===================== 

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer1.org2.example.com:7051
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2021-08-12 14:52:30.637 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2021-08-12 14:52:30.734 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
2021-08-12 14:52:30.734 UTC [main] main -> INFO 003 Exiting.....
===================== peer1.org2 joined on the channel "mychannel" ===================== 

## 更新org1的锚节点为peer0.org1.example.com
Updating anchor peers for org1...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
+ peer channel update -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/Org1MSPanchors.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2021-08-12 14:52:33.783 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2021-08-12 14:52:33.795 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
2021-08-12 14:52:33.795 UTC [main] main -> INFO 003 Exiting.....
===================== Anchor peers for org "Org1MSP" on "mychannel" is updated successfully ===================== 

Updating anchor peers for org2...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
+ peer channel update -o orderer.example.com:7050 -c mychannel -f ./channel-artifacts/Org2MSPanchors.tx --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
+ res=0
+ set +x
2021-08-12 14:52:36.846 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2021-08-12 14:52:36.860 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
2021-08-12 14:52:36.860 UTC [main] main -> INFO 003 Exiting.....
===================== Anchor peers for org "Org2MSP" on "mychannel" is updated successfully ===================== 

## 在相应的节点上安装链码/智能合约
Installing chaincode on peer0.org1...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
+ peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/
+ res=0
+ set +x
2021-08-12 14:52:39.909 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2021-08-12 14:52:39.909 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2021-08-12 14:52:42.186 UTC [main] main -> INFO 003 Exiting.....
===================== Chaincode is installed on peer0.org1 ===================== 

Install chaincode on peer0.org2...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
+ peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/
+ res=0
+ set +x
2021-08-12 14:52:42.261 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2021-08-12 14:52:42.261 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2021-08-12 14:52:42.397 UTC [main] main -> INFO 003 Exiting.....
===================== Chaincode is installed on peer0.org2 ===================== 

## 实例化智能合约
Instantiating chaincode on peer0.org2...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
+ peer chaincode instantiate -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n mycc -l golang -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -P 'OR      ('\''Org1MSP.peer'\'','\''Org2MSP.peer'\'')'
+ res=0
+ set +x
2021-08-12 14:52:42.463 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2021-08-12 14:52:42.464 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2021-08-12 14:53:00.171 UTC [main] main -> INFO 003 Exiting.....
===================== Chaincode Instantiation on peer0.org2 on channel 'mychannel' is successful ===================== 

## 访问智能合约/链码
Querying chaincode on peer0.org1...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
===================== Querying on peer0.org1 on channel 'mychannel'... ===================== 
Attempting to Query peer0.org1 ...3 secs
+ peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}'
+ res=0
+ set +x

2021-08-12 14:53:03.293 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2021-08-12 14:53:03.293 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Query Result: 100
2021-08-12 14:53:16.631 UTC [main] main -> INFO 003 Exiting.....
===================== Query on peer0.org1 on channel 'mychannel' is successful ===================== 

## 调用事务
Sending invoke transaction on peer0.org1...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
+ peer chaincode invoke -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n mycc -c '{"Args":["invoke","a","b","10"]}'
+ res=0
+ set +x
2021-08-12 14:53:16.723 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2021-08-12 14:53:16.723 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2021-08-12 14:53:16.731 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 003 Chaincode invoke successful. result: status:200 
2021-08-12 14:53:16.731 UTC [main] main -> INFO 004 Exiting.....
===================== Invoke transaction on peer0.org1 on channel 'mychannel' is successful ===================== 

Installing chaincode on peer1.org2...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer1.org2.example.com:7051
+ peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/
+ res=0
+ set +x
2021-08-12 14:53:16.770 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2021-08-12 14:53:16.770 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2021-08-12 14:53:16.913 UTC [main] main -> INFO 003 Exiting.....
===================== Chaincode is installed on peer1.org2 ===================== 

Querying chaincode on peer1.org2...
CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer1.org2.example.com:7051
===================== Querying on peer1.org2 on channel 'mychannel'... ===================== 
Attempting to Query peer1.org2 ...3 secs
+ peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}'
+ res=0
+ set +x

2021-08-12 14:53:19.964 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2021-08-12 14:53:19.964 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Query Result: 90
2021-08-12 14:53:33.644 UTC [main] main -> INFO 003 Exiting.....
===================== Query on peer1.org2 on channel 'mychannel' is successful ===================== 

========= All GOOD, BYFN execution completed =========== 


 _____   _   _   ____   
| ____| | \ | | |  _ \  
|  _|   |  \| | | | | | 
| |___  | |\  | | |_| | 
|_____| |_| \_| |____/  

查看启动的镜像

root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric-samples/first-network# docker ps -a
CONTAINER ID   IMAGE                                                                                                  COMMAND                  CREATED          STATUS          PORTS                                                                                      NAMES
08c81acf0bfb   dev-peer1.org2.example.com-mycc-1.0-26c...ab   "chaincode -peer.add…"   15 minutes ago   Up 15 minutes                                                                                              dev-peer1.org2.example.com-mycc-1.0
ac8ff0340072   dev-peer0.org1.example.com-mycc-1.0-384...e9   "chaincode -peer.add…"   16 minutes ago   Up 16 minutes                                                                                              dev-peer0.org1.example.com-mycc-1.0
02485495f2a7   dev-peer0.org2.example.com-mycc-1.0-15b...2b   "chaincode -peer.add…"   16 minutes ago   Up 16 minutes                                                                                              dev-peer0.org2.example.com-mycc-1.0
285818de752e   hyperledger/fabric-tools:latest                                                                        "/bin/bash"              16 minutes ago   Up 16 minutes                                                                                              cli
60c2ae894850   hyperledger/fabric-orderer:latest                                                                      "orderer"                17 minutes ago   Up 16 minutes   0.0.0.0:7050->7050/tcp, :::7050->7050/tcp                                                  orderer.example.com
d6fcac2856eb   hyperledger/fabric-peer:latest                                                                         "peer node start"        17 minutes ago   Up 17 minutes   0.0.0.0:9051->7051/tcp, :::9051->7051/tcp, 0.0.0.0:9053->7053/tcp, :::9053->7053/tcp       peer0.org2.example.com
be92fe25f373   hyperledger/fabric-peer:latest                                                                         "peer node start"        17 minutes ago   Up 16 minutes   0.0.0.0:10051->7051/tcp, :::10051->7051/tcp, 0.0.0.0:10053->7053/tcp, :::10053->7053/tcp   peer1.org2.example.com
5b0a14536894   hyperledger/fabric-peer:latest                                                                         "peer node start"        17 minutes ago   Up 16 minutes   0.0.0.0:8051->7051/tcp, :::8051->7051/tcp, 0.0.0.0:8053->7053/tcp, :::8053->7053/tcp       peer1.org1.example.com
5fb9dd146043   hyperledger/fabric-peer:latest                                                                         "peer node start"        17 minutes ago   Up 17 minutes   0.0.0.0:7051->7051/tcp, :::7051->7051/tcp, 0.0.0.0:7053->7053/tcp, :::7053->7053/tcp       peer0.org1.example.com

查看记录

root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric-samples/first-network# docker logs dev-peer0.org1.example.com-mycc-1.0
ex02 Invoke
Query Response:{"Name":"a","Amount":"100"}
ex02 Invoke
Aval = 90, Bval = 210
root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric-samples/first-network# docker logs dev-peer0.org2.example.com-mycc-1.0
ex02 Init
Aval = 100, Bval = 200
root@hyperledger-fabric:/home/allan/go/src/github.com/hyperledger/fabric-samples/first-network# docker logs dev-peer1.org2.example.com-mycc-1.0
ex02 Invoke
Query Response:{"Name":"a","Amount":"90"}

13.切换images版本

First type:

docker images ps -a

Remove:

docker image rm --f hyperledger/fabric-ca

Download new version:

docker pull hyperledger/fabric-ca:latest
docker pull hyperledger/fabric-ca:1.4.4
docker pull hyperledger/fabric-tools:1.4.4
docker pull hyperledger/fabric-ccenv:1.4.4
docker pull hyperledger/fabric-orderer:1.4.4
docker pull hyperledger/fabric-peer:1.4.4

# untag
docker rmi -f hyperledger/fabric-javaenv:latest
docker rmi -f hyperledger/fabric-peer:latest
docker rmi -f hyperledger/fabric-ca:latest
docker rmi -f hyperledger/fabric-tools:latest
docker rmi -f hyperledger/fabric-ccenv:latest
docker rmi -f hyperledger/fabric-orderer:latest
# tag
docker tag 9756aed98c6b hyperledger/fabric-peer:latest

docker pull hyperledger/fabric-couchdb:1.4.4
docker pull hyperledger/fabric-baseos:1.4.4
docker pull hyperledger/fabric-javaenv:1.4.4
#恢复用
docker tag b023f9be0771 hyperledger/fabric-peer:latest
docker tag 72617b4fa9b4 hyperledger/fabric-ca:latest
docker tag ce0c810df36a hyperledger/fabric-orderer:latest
docker tag c8b4909d8d46 hyperledger/fabric-ccenv:latest
docker tag b7bfddf508bc hyperledger/fabric-tools:latest
docker tag 82098abb1a17 hyperledger/fabric-javaenv:latest
docker tag 220e5cf3fb7f hyperledger/fabric-baseos:latest

You have to do this with all hyperledger images.

Afterwards, run a new "docker images ps -a" to verify that you got version 1.4.4, or above

You find all images here on this page: https://hub.docker.com/r/hyperledger/fabric-ca/tags

posted @ 2022-09-01 23:02  港澳  阅读(1351)  评论(0)    收藏  举报