Ubuntu 16.04下 hyperledger fabric1.0 网络环境搭建过程

环境:

windows10 + VirtualBox 6.1.0 + Ubuntu16.04.6

参考教程:
https://blog.csdn.net/smallone233/article/details/86569536
https://blog.csdn.net/sinat_36742186/article/details/80809954

本文为自己的一个实验记录。仅供参考。借鉴了很多人的博客和教程,基本都标注出来了。感谢网友们。

目录

1.【前期准备】

2.【环境准备】

(1)Go语言环境

(2)安装docker 17.06.2-ce 以及以上版本

(3)安装docker-compose 1.14.0 以及以上版本

(4)下载 fabric源码、fabric-samples源码、fabric镜像

(5)启动Fabric网络并完成ChainCode的测试

(6)手动测试Fabric网络


1.【前期准备】

进入虚拟机ubunt-->系统设置-->软件和更新-->软件源改为 aliyun

Ubuntu 16.04下 hyperledger fabric1.0 网络环境搭建过程_第1张图片

sudo apt-get update
安装vim          sudo apt-get install vim
安装git            sudo apt-get install git
安装curl          sudo apt-get install curl
安装wget        sudo apt-get install wget

2.【环境准备】

(1)Go语言环境

参考教程 https://www.cnblogs.com/X-knight/p/9522511.html

安装go1.11 以及以上版本

cd ~ 
wget https://studygolang.com/dl/golang/go1.11.linux-amd64.tar.gz    //下载
tar -xzf go1.11.linux-amd64.tar.gz    //解压
sudo mv go /usr/local    //移动

配置环境变量
在root下
vi /etc/profile
添加以下内容并保存
export  PATH=$PATH:/usr/local/go/bin
export  GOROOT=/usr/local/go
export  GOPATH=$HOME/go
export  PATH=$PATH:$HOME/go/bin
使文件生效
source /etc/profile

(不确定要不要弄)
vi ~/.profile
在最后添加以下内容
export  PATH=$PATH:/usr/local/go/bin
export  GOROOT=/usr/local/go
export  GOPATH=$HOME/go
export  PATH=$PATH:$HOME/go/bin
使文件生效
source ~/.profile

创建go目录(把go的目录GOPATH设置在当前用户的文件夹下)
cd ~   
mkdir  -p  go/src/github.com/hyperledger/fabric
sudo chmod -R 777 go

检验go:输入go version验证

(2)安装docker 17.06.2-ce 以及以上版本

参考教程 https://www.cnblogs.com/senlinyang/p/8203191.html

下载安装工具:

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

(如果要卸载旧版本:sudo apt-get remove docker docker-engine docker.io)

添加软件源的 GPG 密钥(国内源)
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

官方密钥(速度慢):
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

向source.list中添加 Docker 软件源

sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable"

官方源(慢):
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

下载docker-ce:
sudo apt-get update
sudo apt-get install docker-ce

问题:E: 无法获得锁 /var/lib/dpkg/lock-frontend - open (11: 资源暂时不可用)
解决方案:强制解锁:

sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

完成上面操作之后检查docker安装是否成功:docker version
Ubuntu 16.04下 hyperledger fabric1.0 网络环境搭建过程_第2张图片

将需要使用docker的用户加入docker用户组
sudo groupadd docker    创建docker组
sudo usermod -aG docker XXX  (XXX是当前用户名)

添加阿里云的Docker镜像:
sudo mkdir -p /etc/docker     
sudo vim /etc/docker/daemon.json 

将以下内容写入daemon.json:

{
"registry-mirrors": ["https://aeckruos.mirror.aliyuncs.com"],
"insecure-registries": ["192.168.6.129:5000"]
}

接下来输入:
sudo systemctl daemon-reload 
sudo systemctl restart docker 
docker version

如果权限不足,输入sudo chmod -R 777 /var/run/docker.sock
Ubuntu 16.04下 hyperledger fabric1.0 网络环境搭建过程_第3张图片

(3)安装docker-compose 1.14.0 以及以上版本

sudo apt-get install python-pip
sudo pip install docker-compose

pip install --upgrade pip
出现问题多试几次,可能是网络问题没下好...

Ubuntu 16.04下 hyperledger fabric1.0 网络环境搭建过程_第4张图片

还是继续头铁的无视通知...

查看版本:
docker-compose -version

(4)下载 fabric源码、fabric-samples源码、fabric镜像

参考教程:
https://blog.csdn.net/Sun_Hui_/article/details/100928155
https://blog.csdn.net/so5418418/article/details/78355868

下载 fabric 源码:

cd /home/lyj/go/src/github.com/hyperledger
git clone https://github.com/hyperledger/fabric.git

下载fabric docker 镜像

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

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

如果速度特别慢,在/etc/docker/中修改以下内容
sudo vim /etc/docker/daemon.json

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

下载好后看到 docker images:

Ubuntu 16.04下 hyperledger fabric1.0 网络环境搭建过程_第5张图片

 

(5)启动Fabric网络并完成ChainCode的测试

参考教程 https://blog.csdn.net/so5418418/article/details/78355868

cd /home/lyj/go/src/github.com/hyperledger/fabric/examples/e2e_cli

./network_setup.sh up

彻底关闭并清理遗留数据:./network_setup.sh down

Ubuntu 16.04下 hyperledger fabric1.0 网络环境搭建过程_第6张图片

这个指令具体进行了如下操作: 

  1. 编译生成Fabric公私钥、证书的程序,程序在目录:fabric/release/linux-amd64/bin
  2. 基于configtx.yaml生成创世区块和通道相关信息,并保存在channel-artifacts文件夹。
  3. 基于crypto-config.yaml生成公私钥和证书信息,并保存在crypto-config文件夹中。
  4. 基于docker-compose-cli.yaml启动1Orderer+4Peer+1CLI的Fabric容器。
  5. 在CLI启动的时候,会运行scripts/script.sh文件,这个脚本文件包含了创建Channel,加入Channel,安装Example02,运行Example02等功能。

期间出现的问题:

问题1.

Ubuntu 16.04下 hyperledger fabric1.0 网络环境搭建过程_第7张图片

参考教程:https://blog.csdn.net/Mr__FFF/article/details/83088464

问题2. Error: Got unexpected status: BAD_REQUEST

./network_setup.sh down 清理遗留数据

然后重新尝试。

参考教程 https://blog.csdn.net/weixin_39559301/article/details/87913359

记录一下全部内容:

lyj@lyj-VirtualBox:~/go/src/github.com/hyperledger/fabric/examples/e2e_cli$ ./network_setup.sh up
setting to default channel 'mychannel'
mychannel

Using cryptogen -> /home/lyj/go/src/github.com/hyperledger/fabric/examples/e2e_cli/../../release/linux-amd64/bin/cryptogen

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

Using configtxgen -> /home/lyj/go/src/github.com/hyperledger/fabric/examples/e2e_cli/../../release/linux-amd64/bin/configtxgen
##########################################################
#########  Generating Orderer Genesis block ##############
##########################################################
2020-04-09 20:14:29.061 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2020-04-09 20:14:29.105 CST [common/configtx/tool] doOutputBlock -> INFO 002 Generating genesis block
2020-04-09 20:14:29.122 CST [common/configtx/tool] doOutputBlock -> INFO 003 Writing genesis block

#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
2020-04-09 20:14:29.160 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2020-04-09 20:14:29.178 CST [common/configtx/tool] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx
2020-04-09 20:14:29.190 CST [common/configtx/tool] doOutputChannelCreateTx -> INFO 003 Writing new channel tx

#################################################################
#######    Generating anchor peer update for Org1MSP   ##########
#################################################################
2020-04-09 20:14:29.210 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2020-04-09 20:14:29.220 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2020-04-09 20:14:29.226 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update

#################################################################
#######    Generating anchor peer update for Org2MSP   ##########
#################################################################
2020-04-09 20:14:29.255 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2020-04-09 20:14:29.287 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2020-04-09 20:14:29.288 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update

Creating network "e2e_cli_default" with the default driver
Creating peer1.org2.example.com ... done
Creating peer1.org1.example.com ... done
Creating orderer.example.com    ... done
Creating peer0.org2.example.com ... done
Creating peer0.org1.example.com ... done
Creating cli                    ... done

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

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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2020-04-09 12:14:38.986 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:14:38.987 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:14:38.996 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2020-04-09 12:14:38.996 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2020-04-09 12:14:38.996 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2020-04-09 12:14:38.996 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2020-04-09 12:14:38.996 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2020-04-09 12:14:38.996 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0A8C060A074F7267314D53501280062D...53616D706C65436F6E736F727469756D 
2020-04-09 12:14:38.996 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: D36C45071DF368D83AA7AF78B07C82FA7C86B3614C7B1738190D20167FE19AFF 
2020-04-09 12:14:38.996 UTC [msp] GetLocalMSP -> DEBU 00a Returning existing local MSP
2020-04-09 12:14:38.996 UTC [msp] GetDefaultSigningIdentity -> DEBU 00b Obtaining default signing identity
2020-04-09 12:14:38.996 UTC [msp] GetLocalMSP -> DEBU 00c Returning existing local MSP
2020-04-09 12:14:38.996 UTC [msp] GetDefaultSigningIdentity -> DEBU 00d Obtaining default signing identity
2020-04-09 12:14:38.996 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AC3060A1508021A0608AEA3BCF40522...A8F5A5420DF761AE552F777761E23496 
2020-04-09 12:14:38.996 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: DE2C6D07F967FFEFB63A0C91AF2F16F194D3730384440F207B670758B037493B 
2020-04-09 12:14:39.312 UTC [msp] GetLocalMSP -> DEBU 010 Returning existing local MSP
2020-04-09 12:14:39.312 UTC [msp] GetDefaultSigningIdentity -> DEBU 011 Obtaining default signing identity
2020-04-09 12:14:39.312 UTC [msp] GetLocalMSP -> DEBU 012 Returning existing local MSP
2020-04-09 12:14:39.312 UTC [msp] GetDefaultSigningIdentity -> DEBU 013 Obtaining default signing identity
2020-04-09 12:14:39.312 UTC [msp/identity] Sign -> DEBU 014 Sign: plaintext: 0AC3060A1508021A0608AFA3BCF40522...BF7C7CDB9DCE12080A021A0012021A00 
2020-04-09 12:14:39.312 UTC [msp/identity] Sign -> DEBU 015 Sign: digest: 6AF772217DC3B652705865B52CA29F01572217ED3A00367D08B33AC922DADEF5 
2020-04-09 12:14:39.347 UTC [channelCmd] readBlock -> DEBU 016 Got status:*orderer.DeliverResponse_Status 
2020-04-09 12:14:39.347 UTC [msp] GetLocalMSP -> DEBU 017 Returning existing local MSP
2020-04-09 12:14:39.347 UTC [msp] GetDefaultSigningIdentity -> DEBU 018 Obtaining default signing identity
2020-04-09 12:14:39.380 UTC [channelCmd] InitCmdFactory -> INFO 019 Endorser and orderer connections initialized
2020-04-09 12:14:39.580 UTC [msp] GetLocalMSP -> DEBU 01a Returning existing local MSP
2020-04-09 12:14:39.580 UTC [msp] GetDefaultSigningIdentity -> DEBU 01b Obtaining default signing identity
2020-04-09 12:14:39.580 UTC [msp] GetLocalMSP -> DEBU 01c Returning existing local MSP
2020-04-09 12:14:39.580 UTC [msp] GetDefaultSigningIdentity -> DEBU 01d Obtaining default signing identity
2020-04-09 12:14:39.580 UTC [msp/identity] Sign -> DEBU 01e Sign: plaintext: 0AC3060A1508021A0608AFA3BCF40522...461A1D339DC812080A021A0012021A00 
2020-04-09 12:14:39.580 UTC [msp/identity] Sign -> DEBU 01f Sign: digest: 4C143FEF934F37549B3FB4B6849367994BB8C117000E795488A470DEAF611B00 
2020-04-09 12:14:39.584 UTC [channelCmd] readBlock -> DEBU 020 Received block:0 
2020-04-09 12:14:39.584 UTC [main] main -> INFO 021 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2020-04-09 12:14:39.688 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:14:39.688 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:14:39.694 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2020-04-09 12:14:39.694 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0A8A070A5C08011A0C08AFA3BCF40510...4E2E3974185A1A080A000A000A000A00 
2020-04-09 12:14:39.694 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: 4BCBD0603132B6DFF4D45EF81E71010E9557CB5478E8166561F7EFEF7082A8CE 
2020-04-09 12:14:39.779 UTC [channelCmd] executeJoin -> INFO 006 Peer joined the channel!
2020-04-09 12:14:39.779 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer1.org1.example.com:7051
2020-04-09 12:14:41.904 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:14:41.904 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:14:41.908 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2020-04-09 12:14:41.908 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0A8A070A5C08011A0C08B1A3BCF40510...4E2E3974185A1A080A000A000A000A00 
2020-04-09 12:14:41.909 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: 6846652D35F33AED2884F5E12C5A709AEAA83983A73EA00DADB7E51F098B9790 
2020-04-09 12:14:41.987 UTC [channelCmd] executeJoin -> INFO 006 Peer joined the channel!
2020-04-09 12:14:41.987 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
2020-04-09 12:14:44.102 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:14:44.102 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:14:44.105 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2020-04-09 12:14:44.105 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0A85070A5B08011A0B08B4A3BCF40510...4E2E3974185A1A080A000A000A000A00 
2020-04-09 12:14:44.105 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: BBFD2B63EDB0CC2BA6D545470B6B98695E57F6E675BD63297F51FB703DE31C5A 
2020-04-09 12:14:44.168 UTC [channelCmd] executeJoin -> INFO 006 Peer joined the channel!
2020-04-09 12:14:44.168 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer1.org2.example.com:7051
2020-04-09 12:14:46.258 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:14:46.258 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:14:46.266 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2020-04-09 12:14:46.266 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0A85070A5B08011A0B08B6A3BCF40510...4E2E3974185A1A080A000A000A000A00 
2020-04-09 12:14:46.266 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: 0C40E6A0D5E4712BA6D6656FD583B19558F23C350D06EC6749B08D7FB167F85E 
2020-04-09 12:14:46.330 UTC [channelCmd] executeJoin -> INFO 006 Peer joined the channel!
2020-04-09 12:14:46.331 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2020-04-09 12:14:48.416 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:14:48.416 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:14:48.424 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2020-04-09 12:14:48.424 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2020-04-09 12:14:48.424 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2020-04-09 12:14:48.424 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2020-04-09 12:14:48.424 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2020-04-09 12:14:48.424 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0A8C060A074F7267314D53501280062D...72731200220A0A0641646D696E731200 
2020-04-09 12:14:48.425 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: CEF406931CF7AD676712D58ED7AEA451508D79DB455DAE41A79E19A566E7FB8E 
2020-04-09 12:14:48.425 UTC [msp] GetLocalMSP -> DEBU 00a Returning existing local MSP
2020-04-09 12:14:48.425 UTC [msp] GetDefaultSigningIdentity -> DEBU 00b Obtaining default signing identity
2020-04-09 12:14:48.425 UTC [msp] GetLocalMSP -> DEBU 00c Returning existing local MSP
2020-04-09 12:14:48.425 UTC [msp] GetDefaultSigningIdentity -> DEBU 00d Obtaining default signing identity
2020-04-09 12:14:48.425 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AC3060A1508021A0608B8A3BCF40522...C2D14228540939850215610E12FC8536 
2020-04-09 12:14:48.425 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: 7057F49D960A516675070415B05DC06CA7F36EB610F0282AB99D487E723B52C2 
2020-04-09 12:14:48.499 UTC [main] main -> INFO 010 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
2020-04-09 12:14:53.597 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:14:53.597 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:14:53.604 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2020-04-09 12:14:53.605 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2020-04-09 12:14:53.605 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2020-04-09 12:14:53.605 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2020-04-09 12:14:53.605 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2020-04-09 12:14:53.605 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0A88060A074F7267324D535012FC052D...72731200220A0A0641646D696E731200 
2020-04-09 12:14:53.605 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: B0B07005193EA8F2CDC30AEAA1327DA3447E7534377936177CC07419A5EED910 
2020-04-09 12:14:53.605 UTC [msp] GetLocalMSP -> DEBU 00a Returning existing local MSP
2020-04-09 12:14:53.605 UTC [msp] GetDefaultSigningIdentity -> DEBU 00b Obtaining default signing identity
2020-04-09 12:14:53.605 UTC [msp] GetLocalMSP -> DEBU 00c Returning existing local MSP
2020-04-09 12:14:53.605 UTC [msp] GetDefaultSigningIdentity -> DEBU 00d Obtaining default signing identity
2020-04-09 12:14:53.605 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0ABF060A1508021A0608BDA3BCF40522...2D86C309B552564BBAFF0FEE6FB55CB5 
2020-04-09 12:14:53.605 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: 8332EEC9C1852B240FFE47EE96DAC000021A413D30CCC48FB819918DDCAED90E 
2020-04-09 12:14:53.732 UTC [main] main -> INFO 010 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2020-04-09 12:14:58.837 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:14:58.837 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:14:58.837 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2020-04-09 12:14:58.837 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2020-04-09 12:14:59.057 UTC [golang-platform] getCodeFromFS -> DEBU 005 getCodeFromFS github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
2020-04-09 12:14:59.407 UTC [golang-platform] func1 -> DEBU 006 Discarding GOROOT package fmt
2020-04-09 12:14:59.407 UTC [golang-platform] func1 -> DEBU 007 Discarding provided package github.com/hyperledger/fabric/core/chaincode/shim
2020-04-09 12:14:59.407 UTC [golang-platform] func1 -> DEBU 008 Discarding provided package github.com/hyperledger/fabric/protos/peer
2020-04-09 12:14:59.407 UTC [golang-platform] func1 -> DEBU 009 Discarding GOROOT package strconv
2020-04-09 12:14:59.408 UTC [golang-platform] GetDeploymentPayload -> DEBU 00a done
2020-04-09 12:14:59.411 UTC [msp/identity] Sign -> DEBU 00b Sign: plaintext: 0A8A070A5C08031A0C08C3A3BCF40510...175DFF090000FFFF7C012598002C0000 
2020-04-09 12:14:59.411 UTC [msp/identity] Sign -> DEBU 00c Sign: digest: 1B79DD400B96C3BCC0A1094A50E684FCB0935E22F82EB04D13950598BBD26B79 
2020-04-09 12:14:59.419 UTC [chaincodeCmd] install -> DEBU 00d Installed remotely response: 
2020-04-09 12:14:59.419 UTC [main] main -> INFO 00e Exiting.....
===================== Chaincode is installed on remote peer PEER0 ===================== 

Install 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
2020-04-09 12:14:59.525 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:14:59.525 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:14:59.525 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2020-04-09 12:14:59.525 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2020-04-09 12:14:59.661 UTC [golang-platform] getCodeFromFS -> DEBU 005 getCodeFromFS github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
2020-04-09 12:14:59.872 UTC [golang-platform] func1 -> DEBU 006 Discarding GOROOT package fmt
2020-04-09 12:14:59.872 UTC [golang-platform] func1 -> DEBU 007 Discarding provided package github.com/hyperledger/fabric/core/chaincode/shim
2020-04-09 12:14:59.872 UTC [golang-platform] func1 -> DEBU 008 Discarding provided package github.com/hyperledger/fabric/protos/peer
2020-04-09 12:14:59.872 UTC [golang-platform] func1 -> DEBU 009 Discarding GOROOT package strconv
2020-04-09 12:14:59.872 UTC [golang-platform] GetDeploymentPayload -> DEBU 00a done
2020-04-09 12:14:59.873 UTC [msp/identity] Sign -> DEBU 00b Sign: plaintext: 0A86070A5C08031A0C08C3A3BCF40510...175DFF090000FFFF7C012598002C0000 
2020-04-09 12:14:59.873 UTC [msp/identity] Sign -> DEBU 00c Sign: digest: C5995E12A380232B7671EBDDEF4E6AC03433839624BACDE5DB7F1A97994D8F90 
2020-04-09 12:14:59.878 UTC [chaincodeCmd] install -> DEBU 00d Installed remotely response: 
2020-04-09 12:14:59.878 UTC [main] main -> INFO 00e 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org2.example.com:7051
2020-04-09 12:14:59.986 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:14:59.986 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:14:59.993 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2020-04-09 12:14:59.994 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2020-04-09 12:14:59.995 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0A91070A6708031A0C08C3A3BCF40510...324D53500A04657363630A0476736363 
2020-04-09 12:14:59.995 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: 6F3154409A043A92C1DA1B59B225A65CDF412BB13D82D12DCD1B0DD139D1AAF7 
2020-04-09 12:15:29.040 UTC [msp/identity] Sign -> DEBU 007 Sign: plaintext: 0A91070A6708031A0C08C3A3BCF40510...C2DB0A03CC5C7358881B35BE7A698798 
2020-04-09 12:15:29.040 UTC [msp/identity] Sign -> DEBU 008 Sign: digest: 4EE85F1B18BD05CA3DD9087264C5F2E829921AEBC9A6CC38EC0C02BBE4F87E27 
2020-04-09 12:15:29.043 UTC [main] main -> INFO 009 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
Attempting to Query PEER0 ...3 secs

2020-04-09 12:15:32.189 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:15:32.189 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:15:32.189 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2020-04-09 12:15:32.189 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2020-04-09 12:15:32.189 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0A94070A6608031A0B08E4A3BCF40510...6D7963631A0A0A0571756572790A0161 
2020-04-09 12:15:32.189 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: 8F33B1AF4683A8CF69528F5062EB5AE442E4ACB4895BDFE35FF171A75AB58AF4 
Query Result: 100
2020-04-09 12:16:09.067 UTC [main] main -> INFO 007 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer0.org1.example.com:7051
2020-04-09 12:16:09.191 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:16:09.192 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:16:09.207 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2020-04-09 12:16:09.207 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2020-04-09 12:16:09.207 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0A94070A6608031A0B0889A4BCF40510...696E766F6B650A01610A01620A023130 
2020-04-09 12:16:09.207 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: A848E1C7CCA03F058C603D1E2026D827843FA9C1DA24D34A67FEE58F63D45502 
2020-04-09 12:16:09.244 UTC [msp/identity] Sign -> DEBU 007 Sign: plaintext: 0A94070A6608031A0B0889A4BCF40510...6A8E43D8C54207EAF37642D5CA5E156E 
2020-04-09 12:16:09.244 UTC [msp/identity] Sign -> DEBU 008 Sign: digest: 72528AE292E8AAD185E9FEE8E4ADC87A742562047F1A3B568E69B8B66AD728CE 
2020-04-09 12:16:09.256 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> DEBU 009 ESCC invoke result: version:1 response: payload:"\n ~\034\353\316:ZCw\026\236\267\033Gr\013\310\376\311\317\212\357*\321\370\014Pn\244\201\3339\245\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: 
2020-04-09 12:16:09.256 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 00a Chaincode invoke successful. result: status:200 
2020-04-09 12:16:09.257 UTC [main] main -> INFO 00b 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer1.org2.example.com:7051
2020-04-09 12:16:09.420 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:16:09.420 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:16:09.420 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2020-04-09 12:16:09.420 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2020-04-09 12:16:09.532 UTC [golang-platform] getCodeFromFS -> DEBU 005 getCodeFromFS github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
2020-04-09 12:16:09.800 UTC [golang-platform] func1 -> DEBU 006 Discarding GOROOT package fmt
2020-04-09 12:16:09.800 UTC [golang-platform] func1 -> DEBU 007 Discarding provided package github.com/hyperledger/fabric/core/chaincode/shim
2020-04-09 12:16:09.800 UTC [golang-platform] func1 -> DEBU 008 Discarding provided package github.com/hyperledger/fabric/protos/peer
2020-04-09 12:16:09.800 UTC [golang-platform] func1 -> DEBU 009 Discarding GOROOT package strconv
2020-04-09 12:16:09.800 UTC [golang-platform] GetDeploymentPayload -> DEBU 00a done
2020-04-09 12:16:09.801 UTC [msp/identity] Sign -> DEBU 00b Sign: plaintext: 0A86070A5C08031A0C0889A4BCF40510...175DFF090000FFFF7C012598002C0000 
2020-04-09 12:16:09.801 UTC [msp/identity] Sign -> DEBU 00c Sign: digest: A4E98B5C4A7AFB3858165CEB6175318E99FA2883529268D092B136271C77573F 
2020-04-09 12:16:09.807 UTC [chaincodeCmd] install -> DEBU 00d Installed remotely response: 
2020-04-09 12:16:09.814 UTC [main] main -> INFO 00e 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/[email protected]/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=DEBUG
CORE_PEER_ADDRESS=peer1.org2.example.com:7051
Attempting to Query PEER3 ...3 secs

2020-04-09 12:16:13.056 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2020-04-09 12:16:13.056 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2020-04-09 12:16:13.056 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2020-04-09 12:16:13.056 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2020-04-09 12:16:13.057 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0A90070A6608031A0B088DA4BCF40510...6D7963631A0A0A0571756572790A0161 
2020-04-09 12:16:13.057 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: 146FA75E2499325F835BB9A2BBF4A950A79741588B063BF3151C19F71BE55F8A 
Query Result: 90
2020-04-09 12:16:52.458 UTC [main] main -> INFO 007 Exiting.....
===================== Query on PEER3 on channel 'mychannel' is successful ===================== 

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


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


(6)手动测试Fabric网络

https://www.cnblogs.com/chenfool/p/8353425.html

首先进入CLI,然后重新打开一个命令行窗口,输入:

docker exec -it cli bash

这时用户为

以下命令可以查询a账户的余额:

peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}'

Ubuntu 16.04下 hyperledger fabric1.0 网络环境搭建过程_第8张图片

可以看到余额90,下面我们可以进行转账操作,操作为invoke ,由a转b 20:

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","20"]}

Ubuntu 16.04下 hyperledger fabric1.0 网络环境搭建过程_第9张图片

再看a的余额,变为70

Ubuntu 16.04下 hyperledger fabric1.0 网络环境搭建过程_第10张图片

关闭e2e_cli 的demo服务,然后 ./network_setup.sh down

退出docker 容器(新开的窗口)的命令行模式 exit

fabric网络启动详解,参考以下博客内容:
https://blog.csdn.net/qq_25870633/article/details/81144847
https://blog.csdn.net/Edgar_LQS/article/details/103723603

你可能感兴趣的:(区块链学习笔记,区块链)