Build a blockchain Hyperledger Fabric v1.0 environment with zero foundation

  At the beginning of the 2018 New Year, a popular technology that has been hyped by everyone has come into the public's eyes. That's right, "blockchain". The popularity of this decentralized technology has benefited from the digital currency represented by Bitcoin in recent years. The skyrocketing growth of the market has also resulted in the emergence of various new words such as "mining", "miners", "miners"...etc. As a technical engineer, what kind of project is suitable for blockchain research and development, how to start research and development, its technical characteristics and advantages...we are most concerned about it. Let's introduce the construction process of Hyperledger Fabric v1.0~

 

Software and versions required for environment construction

Linux系统Ubuntu 16.04 + go1.9 linux/amd64 + docker17.12.0-ce + docker-compose 1.12.0

 

1. If it is a windows development environment, it is recommended to install a VMware first, and then download the iso image ubuntukylin-16.04-desktop-amd64.iso of the Ubuntu system. Load the image file into VMware to install and run. If the installed virtual machine cannot adapt to the screen size, you can refer to another blog post: How to adapt the virtual machine window installed by VMware to the screen size

 

2. Update apt source to domestic

 

Execute the following command line in the terminal to view the list of apt sources

$ sudo vi /etc/apt/sources.list 

 

If you see something like http://us.xxxxx, it's foreign, if you see something like http://cn.xxxxx, you don't need to change it. 

 

If it is us, in command mode, enter: 

:%s/us./cn./g 

Batch replace, then enter: wq to save and exit

 

3. Install go

a, Since the version of go that comes with Ubuntu's apt-get is too low, here we reinstall it and enter the command:
$ wget https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz

b, decompress
$ sudo tar -C /usr/local -xzf go1.9.linux-amd64.tar.gz

c, edit the environment variables of the current user
$ vi ~ / .profile

d, add the following at the end

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

e,:wq save and exit

f, recompile and load environment variables
$ source ~/.profile

 

Note: We set the go directory GOPATH under the current user's folder, so remember to create the go folder 

$ cd ~ go back to root directory 

$ mkdir go to create the go folder 

 

4. Install docker

For specific installation steps, please refer to another blog post: Detailed steps to install Docker17.12.0-ce in Ubuntu 16.04 environment

 

5. Install docker-compose (officially recommended version 1.8.0 or above, here we download 1.12.0) 

a, Obtain the download command of the corresponding version in the linux environment from the docker-compose official website and execute it
$ sudo curl -L https://github.com/docker/compose/releases/download/1.12.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

b, increase the executable permission of the docker-compose installation directory to the current user
$ chmod +x /usr/local/bin/docker-compose

c, check the installation version of docker-compose to verify whether the installation is successful
$ docker-compose version

 

6. Download the fabric source code

a, create a folder to store the source code
$ mkdir -p ~/go/src/github.com/hyperledger

b,切换到存放源码的文件夹目录下
$ cd ~/go/src/github.com/hyperledger

c,用git命令下载完整源码 
$ git clone https://github.com/hyperledger/fabric.git

 

7、下载fabric的docker镜像

a,切换到上一步下载好的fabric源码目录fabric/examples/e2e_cli/下
$ cd ~/go/src/github.com/hyperledger/fabric/examples/e2e_cli/

b,执行以下命令开始下载fabric的docker镜像
$ source download-dockerimages.sh -c x86_64-1.0.0 -f x86_64-1.0.0

c,执行以下命令查看已下载的docker镜像
$ docker images

 

8、启动Fabric网络

 

首先进入到fabric/examples/e2e_cli/下,这里提供了启动、关闭Fabric网络的自动化脚本。我们要启动Fabric网络,并自动运行Example02 ChainCode的测试,执行以下命令: 

$ ./network_setup.sh up

 

这个过程比较漫长,需要耐心等待一会,最终看到end-e2e打印体界面,那就说明整个Fabric网络已经通了。Ctrl + C 退出,启动成功。

 

qiangjy@ubuntu:~/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/qiangjy/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/qiangjy/go/src/github.com/hyperledger/fabric/release/linux-amd64/bin/configtxgen -tags "nopkcs11" -ldflags "-X github.com/hyperledger/fabric/common/configtx/tool/configtxgen/metadata.Version=1.0.0" github.com/hyperledger/fabric/common/configtx/tool/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/qiangjy/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.0.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/qiangjy/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.0.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/qiangjy/go/src/github.com/hyperledger/fabric/release/linux-amd64/bin/peer -tags "nopkcs11" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.0.0 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.3.1 -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" 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/qiangjy/go/src/github.com/hyperledger/fabric/release/linux-amd64/bin/orderer -tags "nopkcs11" -ldflags "-X github.com/hyperledger/fabric/orderer/metadata.Version=1.0.0" github.com/hyperledger/fabric/orderer
mkdir -p release/linux-amd64/bin
make: Leaving directory '/home/qiangjy/go/src/github.com/hyperledger/fabric'

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

Using configtxgen -> /home/qiangjy/go/src/github.com/hyperledger/fabric/examples/e2e_cli/../../release/linux-amd64/bin/configtxgen
##########################################################
#########  Generating Orderer Genesis block ##############
##########################################################
2018-02-08 15:13:52.659 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2018-02-08 15:13:52.802 CST [common/configtx/tool] doOutputBlock -> INFO 002 Generating genesis block
2018-02-08 15:13:52.804 CST [common/configtx/tool] doOutputBlock -> INFO 003 Writing genesis block

#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
2018-02-08 15:13:52.851 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2018-02-08 15:13:52.855 CST [common/configtx/tool] doOutputChannelCreateTx -> INFO 002 Generating new channel configtx
2018-02-08 15:13:52.856 CST [common/configtx/tool] doOutputChannelCreateTx -> INFO 003 Writing new channel tx

#################################################################
#######    Generating anchor peer update for Org1MSP   ##########
#################################################################
2018-02-08 15:13:52.873 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2018-02-08 15:13:52.881 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2018-02-08 15:13:52.881 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update

#################################################################
#######    Generating anchor peer update for Org2MSP   ##########
#################################################################
2018-02-08 15:13:52.895 CST [common/configtx/tool] main -> INFO 001 Loading configuration
2018-02-08 15:13:52.899 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 002 Generating anchor peer update
2018-02-08 15:13:52.900 CST [common/configtx/tool] doOutputAnchorPeersUpdate -> INFO 003 Writing anchor peer update

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

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

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
2018-02-08 07:14:27.774 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:14:27.797 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:14:27.839 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-02-08 07:14:27.840 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2018-02-08 07:14:27.840 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2018-02-08 07:14:27.840 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2018-02-08 07:14:27.840 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2018-02-08 07:14:27.840 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0A8C060A074F7267314D53501280062D...53616D706C65436F6E736F727469756D 
2018-02-08 07:14:27.840 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: 292B1080A2B609C24160DF5B5663A566949945C324C8E0A82190F79C7985E6B4 
2018-02-08 07:14:27.840 UTC [msp] GetLocalMSP -> DEBU 00a Returning existing local MSP
2018-02-08 07:14:27.840 UTC [msp] GetDefaultSigningIdentity -> DEBU 00b Obtaining default signing identity
2018-02-08 07:14:27.840 UTC [msp] GetLocalMSP -> DEBU 00c Returning existing local MSP
2018-02-08 07:14:27.840 UTC [msp] GetDefaultSigningIdentity -> DEBU 00d Obtaining default signing identity
2018-02-08 07:14:27.840 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AC3060A1508021A0608D3F1EFD30522...D9CA7D9CD07F223E568C3D3CE1A32F17 
2018-02-08 07:14:27.840 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: DA852435ABA4230866B7C4DC0F0A0AA30B92062F1E734722636CF67DC4820232 
2018-02-08 07:14:28.015 UTC [msp] GetLocalMSP -> DEBU 010 Returning existing local MSP
2018-02-08 07:14:28.015 UTC [msp] GetDefaultSigningIdentity -> DEBU 011 Obtaining default signing identity
2018-02-08 07:14:28.016 UTC [msp] GetLocalMSP -> DEBU 012 Returning existing local MSP
2018-02-08 07:14:28.016 UTC [msp] GetDefaultSigningIdentity -> DEBU 013 Obtaining default signing identity
2018-02-08 07:14:28.016 UTC [msp/identity] Sign -> DEBU 014 Sign: plaintext: 0AC3060A1508021A0608D4F1EFD30522...AB1B2224CA9D12080A021A0012021A00 
2018-02-08 07:14:28.016 UTC [msp/identity] Sign -> DEBU 015 Sign: digest: DA0C068B4BA4E3AD3827EB3D0336B99EF51BD0591E52FAB17D39F90A0CE8E1D6 
2018-02-08 07:14:28.047 UTC [channelCmd] readBlock -> DEBU 016 Got status:*orderer.DeliverResponse_Status 
2018-02-08 07:14:28.047 UTC [msp] GetLocalMSP -> DEBU 017 Returning existing local MSP
2018-02-08 07:14:28.047 UTC [msp] GetDefaultSigningIdentity -> DEBU 018 Obtaining default signing identity
2018-02-08 07:14:28.082 UTC [channelCmd] InitCmdFactory -> INFO 019 Endorser and orderer connections initialized
2018-02-08 07:14:28.283 UTC [msp] GetLocalMSP -> DEBU 01a Returning existing local MSP
2018-02-08 07:14:28.283 UTC [msp] GetDefaultSigningIdentity -> DEBU 01b Obtaining default signing identity
2018-02-08 07:14:28.283 UTC [msp] GetLocalMSP -> DEBU 01c Returning existing local MSP
2018-02-08 07:14:28.283 UTC [msp] GetDefaultSigningIdentity -> DEBU 01d Obtaining default signing identity
2018-02-08 07:14:28.283 UTC [msp/identity] Sign -> DEBU 01e Sign: plaintext: 0AC3060A1508021A0608D4F1EFD30522...B8306F66052112080A021A0012021A00 
2018-02-08 07:14:28.283 UTC [msp/identity] Sign -> DEBU 01f Sign: digest: ABB41E9CCCAB4625849D9B05E68340BDFB90A07AA0BF867D7667CB1B19C6B443 
2018-02-08 07:14:28.287 UTC [channelCmd] readBlock -> DEBU 020 Received block:0 
2018-02-08 07:14:28.288 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
2018-02-08 07:14:28.422 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:14:28.422 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:14:28.425 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-02-08 07:14:28.425 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0A8A070A5C08011A0C08D4F1EFD30510...2A56FF57326F1A080A000A000A000A00 
2018-02-08 07:14:28.425 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: D63F5A58927DC6D0AB7CD15A20C0D4616258E843CB1E0BD6F072736A3DE2FA5E 
2018-02-08 07:14:28.507 UTC [channelCmd] executeJoin -> INFO 006 Peer joined the channel!
2018-02-08 07:14:28.507 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
2018-02-08 07:14:30.691 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:14:30.691 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:14:30.694 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-02-08 07:14:30.695 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0A8A070A5C08011A0C08D6F1EFD30510...2A56FF57326F1A080A000A000A000A00 
2018-02-08 07:14:30.695 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: 28E2C3438FCC7646EFAE1AC47E025A3D3436CCB840C1CA6D90086959F9F841D2 
2018-02-08 07:14:30.758 UTC [channelCmd] executeJoin -> INFO 006 Peer joined the channel!
2018-02-08 07:14:30.758 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
2018-02-08 07:14:32.897 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:14:32.897 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:14:32.908 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-02-08 07:14:32.909 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0A8A070A5C08011A0C08D8F1EFD30510...2A56FF57326F1A080A000A000A000A00 
2018-02-08 07:14:32.909 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: 53DA21A1021245E4941F0A8559E3713B886CEF6D4350DE73413F226BFA15A71C 
2018-02-08 07:14:32.972 UTC [channelCmd] executeJoin -> INFO 006 Peer joined the channel!
2018-02-08 07:14:32.972 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
2018-02-08 07:14:35.084 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:14:35.085 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:14:35.088 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-02-08 07:14:35.088 UTC [msp/identity] Sign -> DEBU 004 Sign: plaintext: 0A89070A5B08011A0B08DBF1EFD30510...2A56FF57326F1A080A000A000A000A00 
2018-02-08 07:14:35.088 UTC [msp/identity] Sign -> DEBU 005 Sign: digest: F307A45A204FE413CA682121025C5018CD07B23F1C9F09D3996337CC426F468B 
2018-02-08 07:14:35.176 UTC [channelCmd] executeJoin -> INFO 006 Peer joined the channel!
2018-02-08 07:14:35.176 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
2018-02-08 07:14:37.330 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:14:37.330 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:14:37.334 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-02-08 07:14:37.334 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2018-02-08 07:14:37.334 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2018-02-08 07:14:37.334 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2018-02-08 07:14:37.334 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2018-02-08 07:14:37.334 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0A8C060A074F7267314D53501280062D...72731200220A0A0641646D696E731200 
2018-02-08 07:14:37.334 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: 27BF8D60C3526464F6F8F5251260282C8A7DFE92CCCE82A09AEE83492BD856A6 
2018-02-08 07:14:37.335 UTC [msp] GetLocalMSP -> DEBU 00a Returning existing local MSP
2018-02-08 07:14:37.335 UTC [msp] GetDefaultSigningIdentity -> DEBU 00b Obtaining default signing identity
2018-02-08 07:14:37.335 UTC [msp] GetLocalMSP -> DEBU 00c Returning existing local MSP
2018-02-08 07:14:37.335 UTC [msp] GetDefaultSigningIdentity -> DEBU 00d Obtaining default signing identity
2018-02-08 07:14:37.335 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AC3060A1508021A0608DDF1EFD30522...0235DC13EDB742C5F35A4494648EB56F 
2018-02-08 07:14:37.335 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: 6EC614D71AB12A1AD7C58C673B85371CF940FDEECC83BF94BDD82F4BBFB2C2CC 
2018-02-08 07:14:37.373 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
2018-02-08 07:14:42.508 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:14:42.508 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:14:42.512 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2018-02-08 07:14:42.513 UTC [msp] GetLocalMSP -> DEBU 004 Returning existing local MSP
2018-02-08 07:14:42.513 UTC [msp] GetDefaultSigningIdentity -> DEBU 005 Obtaining default signing identity
2018-02-08 07:14:42.513 UTC [msp] GetLocalMSP -> DEBU 006 Returning existing local MSP
2018-02-08 07:14:42.513 UTC [msp] GetDefaultSigningIdentity -> DEBU 007 Obtaining default signing identity
2018-02-08 07:14:42.513 UTC [msp/identity] Sign -> DEBU 008 Sign: plaintext: 0A8C060A074F7267324D53501280062D...72731200220A0A0641646D696E731200 
2018-02-08 07:14:42.513 UTC [msp/identity] Sign -> DEBU 009 Sign: digest: A4E4947C5D02CB70DF06427414F9747E6ACF15604965C2384A713769DAF70E32 
2018-02-08 07:14:42.513 UTC [msp] GetLocalMSP -> DEBU 00a Returning existing local MSP
2018-02-08 07:14:42.513 UTC [msp] GetDefaultSigningIdentity -> DEBU 00b Obtaining default signing identity
2018-02-08 07:14:42.513 UTC [msp] GetLocalMSP -> DEBU 00c Returning existing local MSP
2018-02-08 07:14:42.513 UTC [msp] GetDefaultSigningIdentity -> DEBU 00d Obtaining default signing identity
2018-02-08 07:14:42.513 UTC [msp/identity] Sign -> DEBU 00e Sign: plaintext: 0AC3060A1508021A0608E2F1EFD30522...2A3F4123A8A7BDE44D676CEF43B0E34C 
2018-02-08 07:14:42.513 UTC [msp/identity] Sign -> DEBU 00f Sign: digest: 727F48E10AB6BDFBC7357FE11A720DC4BD49DFD19D8CDF9FE8E44C5BA81AA8B7 
2018-02-08 07:14:42.568 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
2018-02-08 07:14:47.724 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:14:47.724 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:14:47.724 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2018-02-08 07:14:47.724 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2018-02-08 07:14:49.935 UTC [golang-platform] getCodeFromFS -> DEBU 005 getCodeFromFS github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
2018-02-08 07:14:51.279 UTC [golang-platform] func1 -> DEBU 006 Discarding GOROOT package fmt
2018-02-08 07:14:51.279 UTC [golang-platform] func1 -> DEBU 007 Discarding provided package github.com/hyperledger/fabric/core/chaincode/shim
2018-02-08 07:14:51.279 UTC [golang-platform] func1 -> DEBU 008 Discarding provided package github.com/hyperledger/fabric/protos/peer
2018-02-08 07:14:51.279 UTC [golang-platform] func1 -> DEBU 009 Discarding GOROOT package strconv
2018-02-08 07:14:51.280 UTC [golang-platform] GetDeploymentPayload -> DEBU 00a done
2018-02-08 07:14:51.293 UTC [msp/identity] Sign -> DEBU 00b Sign: plaintext: 0A8A070A5C08031A0C08EBF1EFD30510...175DFF090000FFFF7C012598002C0000 
2018-02-08 07:14:51.293 UTC [msp/identity] Sign -> DEBU 00c Sign: digest: 707DA98908BCB10B9FEED067FAD16BFA1CA2F065988A8DCC4CE1AD4782015224 
2018-02-08 07:14:51.313 UTC [chaincodeCmd] install -> DEBU 00d Installed remotely response:<status:200 payload:"OK" > 
2018-02-08 07:14:51.313 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
2018-02-08 07:14:51.416 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:14:51.416 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:14:51.416 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2018-02-08 07:14:51.416 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2018-02-08 07:14:51.482 UTC [golang-platform] getCodeFromFS -> DEBU 005 getCodeFromFS github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
2018-02-08 07:14:51.657 UTC [golang-platform] func1 -> DEBU 006 Discarding GOROOT package fmt
2018-02-08 07:14:51.657 UTC [golang-platform] func1 -> DEBU 007 Discarding provided package github.com/hyperledger/fabric/core/chaincode/shim
2018-02-08 07:14:51.657 UTC [golang-platform] func1 -> DEBU 008 Discarding provided package github.com/hyperledger/fabric/protos/peer
2018-02-08 07:14:51.657 UTC [golang-platform] func1 -> DEBU 009 Discarding GOROOT package strconv
2018-02-08 07:14:51.657 UTC [golang-platform] GetDeploymentPayload -> DEBU 00a done
2018-02-08 07:14:51.659 UTC [msp/identity] Sign -> DEBU 00b Sign: plaintext: 0A8A070A5C08031A0C08EBF1EFD30510...175DFF090000FFFF7C012598002C0000 
2018-02-08 07:14:51.659 UTC [msp/identity] Sign -> DEBU 00c Sign: digest: 8ECC43BDCA8965CE515EEA72B23F1EC82AD3B5DD60CFCF15BE76463BE127B504 
2018-02-08 07:14:51.665 UTC [chaincodeCmd] install -> DEBU 00d Installed remotely response:<status:200 payload:"OK" > 
2018-02-08 07:14:51.665 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
2018-02-08 07:14:51.742 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:14:51.742 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:14:51.746 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2018-02-08 07:14:51.746 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2018-02-08 07:14:51.758 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0A95070A6708031A0C08EBF1EFD30510...324D53500A04657363630A0476736363 
2018-02-08 07:14:51.758 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: BE7DF19230F9E155F8BB9171D0F38E1ACC1E77390C98BEF498990C669D3D73FD 
2018-02-08 07:15:48.325 UTC [msp/identity] Sign -> DEBU 007 Sign: plaintext: 0A95070A6708031A0C08EBF1EFD30510...961368B2BDF440FAE44422A366C351FE 
2018-02-08 07:15:48.407 UTC [msp/identity] Sign -> DEBU 008 Sign: digest: 9EAA55F2807022A0952C7672ED0E14464FECAD64808F2359B560B3ED7838B8C0 
2018-02-08 07:15:48.975 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

2018-02-08 07:15:53.672 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:15:53.686 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:15:53.686 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2018-02-08 07:15:53.686 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2018-02-08 07:15:53.686 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0A95070A6708031A0C08A9F2EFD30510...6D7963631A0A0A0571756572790A0161 
2018-02-08 07:15:53.686 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: 8D3042C9F766D93B04B54C108462325A61EEE49A1DED2BAFD0052A454447935B 
Query Result: 100
2018-02-08 07:16:58.761 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
2018-02-08 07:17:02.751 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:17:02.751 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:17:03.586 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2018-02-08 07:17:03.586 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2018-02-08 07:17:03.587 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0A95070A6708031A0C08EFF2EFD30510...696E766F6B650A01610A01620A023130 
2018-02-08 07:17:03.587 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: 97B24074EA45C15457B95F56C0F635659B5549A9C7BFDF1207F4AA2B7D7A97B1 
2018-02-08 07:17:03.852 UTC [msp/identity] Sign -> DEBU 007 Sign: plaintext: 0A95070A6708031A0C08EFF2EFD30510...CF69EFAFCAABFEA5D908B8A75359C9CB 
2018-02-08 07:17:03.852 UTC [msp/identity] Sign -> DEBU 008 Sign: digest: 7353551348EEA0527A72CA62F9CEF56DE0BE41F3AC1179CD7459044A1C8B04AB 
2018-02-08 07:17:04.459 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> DEBU 009 ESCC invoke result: version:1 response:<status:200 message:"OK" > payload:"\n I\r\244\202\330~\347xjF\203H07\271\241U/\360AnVj\312\233\337\346+\200\025\004>\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\374\005-----BEGIN -----\nMIICGDCCAb+gAwIBAgIQOlMl6mZqYZKA0mr6Sm9PmTAKBggqhkjOPQQDAjBzMQsw\nCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy\nYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEcMBoGA1UEAxMTY2Eu\nb3JnMS5leGFtcGxlLmNvbTAeFw0xODAyMDgwNzEzNTFaFw0yODAyMDYwNzEzNTFa\nMFsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T\nYW4gRnJhbmNpc2NvMR8wHQYDVQQDExZwZWVyMC5vcmcxLmV4YW1wbGUuY29tMFkw\nEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJWwmR7xAzhj3Nh+ipgD/VAs+48V7R56y\nDphNfIk1B8yGzWNXsYXePGfCUboMbrGMRFxpP3p92LZJ44tVQcYTfKNNMEswDgYD\nVR0PAQH/BAQDAgeAMAwGA1UdEwEB/wQCMAAwKwYDVR0jBCQwIoAgSnJY4muYpP0W\nF78e+ox/bnyPpWQ0AwB5WwNEobIaTXUwCgYIKoZIzj0EAwIDRwAwRAIhAO/tMrR1\nioVQStjN1GUfHzdskYjyKEf9Qf/X8P9pR1L9Ah8xnH+ewWcWoeVMnoRrAWk+VPgE\n0Me077VvtaAxdqqS\n-----END -----\n" signature:"0D\002 v;\307v\334\356\331\257\320t:\201\177eaO\222\302\026\254!h1\024\321\241\016r\215\231\372t\002 \007\001\265(&\3037\022\016U\201\330G=\022\324\317i\357\257\312\253\376\245\331\010\270\247SY\311\313" > 
2018-02-08 07:17:04.460 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 00a Chaincode invoke successful. result: status:200 
2018-02-08 07:17:04.460 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
2018-02-08 07:17:04.745 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:17:04.745 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:17:04.803 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2018-02-08 07:17:04.803 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2018-02-08 07:17:08.292 UTC [golang-platform] getCodeFromFS -> DEBU 005 getCodeFromFS github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
2018-02-08 07:17:09.849 UTC [golang-platform] func1 -> DEBU 006 Discarding GOROOT package fmt
2018-02-08 07:17:09.849 UTC [golang-platform] func1 -> DEBU 007 Discarding provided package github.com/hyperledger/fabric/core/chaincode/shim
2018-02-08 07:17:09.849 UTC [golang-platform] func1 -> DEBU 008 Discarding provided package github.com/hyperledger/fabric/protos/peer
2018-02-08 07:17:09.849 UTC [golang-platform] func1 -> DEBU 009 Discarding GOROOT package strconv
2018-02-08 07:17:09.850 UTC [golang-platform] GetDeploymentPayload -> DEBU 00a done
2018-02-08 07:17:09.870 UTC [msp/identity] Sign -> DEBU 00b Sign: plaintext: 0A8A070A5C08031A0C08F5F2EFD30510...175DFF090000FFFF7C012598002C0000 
2018-02-08 07:17:09.870 UTC [msp/identity] Sign -> DEBU 00c Sign: digest: 7F75915586A497BCB922EC4E37DE92DA2BEAA088803980FED449566785205BCA 
2018-02-08 07:17:09.974 UTC [chaincodeCmd] install -> DEBU 00d Installed remotely response:<status:200 payload:"OK" > 
2018-02-08 07:17:09.974 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

2018-02-08 07:17:13.191 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-02-08 07:17:13.191 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-02-08 07:17:13.191 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2018-02-08 07:17:13.192 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2018-02-08 07:17:13.192 UTC [msp/identity] Sign -> DEBU 005 Sign: plaintext: 0A94070A6608031A0B08F9F2EFD30510...6D7963631A0A0A0571756572790A0161 
2018-02-08 07:17:13.192 UTC [msp/identity] Sign -> DEBU 006 Sign: digest: 079426B2F1F7E0F5C911A0964760FA5EDA5B0D684418FBB3D6B47B354FFE2CE3 
Query Result: 90
2018-02-08 07:18:20.133 UTC [main] main -> INFO 007 Exiting.....
===================== Query on PEER3 on channel 'mychannel' is successful =====================

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


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


 

9. Manually test the Fabric network through ChainCode

Here is a small example provided by the official. In the official example, the channel name is mychannel and the chain code name is mycc.
Enter the following command to enter the CLI:
$ docker exec -it cli bash

At this time, the user is root@6569408c5320, in the /opt/gopath/src/github.com/hyperledger/fabric/peer directory,
Run the following command to query the balance of account a:
peer chaincode query -C mychannel -n mycc -c '{"Args":["query","a"]}'

 

 

So far, our entire Fabric environment has been built and tested!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326081816&siteId=291194637