https://hyperledger-fabric.readthedocs.io/en/release-1.4/install.html
wang@wang:~/go/src/github.com/hyperledger$ curl -sSL https://bit.ly/2ysbOFE | bash -s -- 1.4.2 1.4.2 0.4.15
Installing hyperledger/fabric-samples repo
===> Cloning hyperledger/fabric-samples repo and checkout v1.4.2
Cloning into 'fabric-samples'...
remote: Enumerating objects: 147, done.
remote: Counting objects: 100% (147/147), done.
remote: Compressing objects: 100% (95/95), done.
remote: Total 3559 (delta 35), reused 123 (delta 11), pack-reused 3412
Receiving objects: 100% (3559/3559), 1.20 MiB | 188.00 KiB/s, done.
Resolving deltas: 100% (1704/1704), done.
Checking connectivity... done.
Note: checking out 'v1.4.2'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b
HEAD is now at 9e0eed1... [FAB-15104] Remove scripts/bootstrap.sh
Installing Hyperledger Fabric binaries
===> Downloading version 1.4.2 platform specific fabric binaries
===> Downloading: https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric/linux-amd64-1.4.2/hyperledger-fabric-linux-amd64-1.4.2.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 51.9M 100 51.9M 0 0 114k 0 0:07:45 0:07:45 --:--:-- 135k
==> Done.
===> Downloading version 1.4.2 platform specific fabric-ca-client binary
===> Downloading: https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric-ca/hyperledger-fabric-ca/linux-amd64-1.4.2/hyperledger-fabric-ca-linux-amd64-1.4.2.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6324k 100 6324k 0 0 211k 0 0:00:29 0:00:29 --:--:-- 126k
==> Done.
Installing Hyperledger Fabric docker images
===> Pulling fabric Images
...
...
...
...
...
===> List out hyperledger docker images
hyperledger/fabric-javaenv 1.4.2 1cd707531ce7 11 days ago 1.76GB
hyperledger/fabric-javaenv latest 1cd707531ce7 11 days ago 1.76GB
hyperledger/fabric-ca 1.4.2 f289675c9874 12 days ago 253MB
hyperledger/fabric-ca latest f289675c9874 12 days ago 253MB
hyperledger/fabric-tools 1.4.2 0abc124a9400 12 days ago 1.55GB
hyperledger/fabric-tools latest 0abc124a9400 12 days ago 1.55GB
hyperledger/fabric-ccenv 1.4.2 fc0f502399a6 12 days ago 1.43GB
hyperledger/fabric-ccenv latest fc0f502399a6 12 days ago 1.43GB
hyperledger/fabric-orderer 1.4.2 362021998003 12 days ago 173MB
hyperledger/fabric-orderer latest 362021998003 12 days ago 173MB
hyperledger/fabric-peer 1.4.2 d79f2f4f3257 12 days ago 178MB
hyperledger/fabric-peer latest d79f2f4f3257 12 days ago 178MB
hyperledger/fabric-javaenv 2.0.0-alpha a62112471af5 3 months ago 414MB
hyperledger/fabric-tools 2.0.0-alpha 2b3da7c0691e 3 months ago 463MB
hyperledger/fabric-ccenv 2.0.0-alpha 3c52930a2ac0 3 months ago 500MB
hyperledger/fabric-orderer 2.0.0-alpha c5538b4543a7 3 months ago 39.3MB
hyperledger/fabric-peer 2.0.0-alpha 22fa2912a344 3 months ago 46.7MB
hyperledger/fabric-baseos 2.0.0-alpha 169d45dc8974 3 months ago 6.92MB
hyperledger/fabric-baseos latest 169d45dc8974 3 months ago 6.92MB
hyperledger/fabric-nodeenv 2.0.0-alpha dc4cd74aba9c 3 months ago 256MB
hyperledger/fabric-nodeenv latest dc4cd74aba9c 3 months ago 256MB
hyperledger/fabric-zookeeper 0.4.15 20c6045930c8 4 months ago 1.43GB
hyperledger/fabric-zookeeper latest 20c6045930c8 4 months ago 1.43GB
hyperledger/fabric-kafka 0.4.15 b4ab82bbaf2f 4 months ago 1.44GB
hyperledger/fabric-kafka latest b4ab82bbaf2f 4 months ago 1.44GB
hyperledger/fabric-couchdb 0.4.15 8de128a55539 4 months ago 1.5GB
hyperledger/fabric-couchdb latest 8de128a55539 4 months ago 1.5GB
wang@wang:~/go/src/github.com/hyperledger$ ls
fabric fabric-samples fabric-samples_2.0alpha
选择raft共识:
https://hyperledger-fabric.readthedocs.io/en/release-1.4/build_network.html
wang@wang:~/go/src/github.com/hyperledger/fabric-samples/first-network$ ./byfn.sh generate
Generating certs and genesis block for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] Y
proceeding ...
/home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/../bin/cryptogen
##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
+ cryptogen generate --config=./crypto-config.yaml
org1.example.com
org2.example.com
+ res=0
+ set +x
/home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/../bin/configtxgen
##########################################################
######### Generating Orderer Genesis block ##############
##########################################################
CONSENSUS_TYPE=solo
+ '[' solo == solo ']'
+ configtxgen -profile TwoOrgsOrdererGenesis -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
2019-07-30 14:28:59.422 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-07-30 14:28:59.542 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 002 orderer type: solo
2019-07-30 14:28:59.542 CST [common.tools.configtxgen.localconfig] Load -> INFO 003 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 14:28:59.652 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 004 orderer type: solo
2019-07-30 14:28:59.652 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 005 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 14:28:59.654 CST [common.tools.configtxgen] doOutputBlock -> INFO 006 Generating genesis block
2019-07-30 14:28:59.655 CST [common.tools.configtxgen] doOutputBlock -> INFO 007 Writing genesis block
+ res=0
+ set +x
#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel
2019-07-30 14:28:59.716 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-07-30 14:28:59.810 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 14:28:59.908 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2019-07-30 14:28:59.908 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 14:28:59.908 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 005 Generating new channel configtx
2019-07-30 14:28:59.910 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 006 Writing new channel tx
+ res=0
+ set +x
#################################################################
####### Generating anchor peer update for Org1MSP ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
2019-07-30 14:28:59.957 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-07-30 14:29:00.061 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 14:29:00.177 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2019-07-30 14:29:00.177 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 14:29:00.177 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 005 Generating anchor peer update
2019-07-30 14:29:00.178 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 006 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
2019-07-30 14:29:00.226 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-07-30 14:29:00.356 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 14:29:00.458 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2019-07-30 14:29:00.458 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 14:29:00.458 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 005 Generating anchor peer update
2019-07-30 14:29:00.459 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 006 Writing anchor peer update
+ res=0
+ set +x
wang@wang:~/go/src/github.com/hyperledger/fabric-samples/first-network$ ./byfn.sh up -o etcdraft
Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds
Continue? [Y/n] Y
proceeding ...
LOCAL_VERSION=1.4.2
DOCKER_IMAGE_VERSION=1.4.2
Creating network "net_byfn" with the default driver
Creating volume "net_orderer.example.com" with default driver
Creating volume "net_orderer2.example.com" with default driver
Creating volume "net_peer0.org2.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_peer1.org2.example.com" with default driver
Creating volume "net_orderer5.example.com" with default driver
Creating volume "net_orderer4.example.com" with default driver
Creating volume "net_orderer3.example.com" with default driver
Creating peer1.org1.example.com
Creating peer0.org1.example.com
Creating orderer3.example.com
Creating orderer2.example.com
Creating orderer4.example.com
Creating peer0.org2.example.com
Creating orderer.example.com
Creating peer1.org2.example.com
Creating orderer5.example.com
Creating cli
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9e04784561e6 hyperledger/fabric-tools:latest "/bin/bash" 1 second ago Up Less than a second cli
668131eac91c hyperledger/fabric-orderer:latest "orderer" 9 seconds ago Up 1 second 0.0.0.0:7050->7050/tcp orderer.example.com
7c36b7446c8b hyperledger/fabric-peer:latest "peer node start" 9 seconds ago Up 2 seconds 0.0.0.0:10051->10051/tcp peer1.org2.example.com
13c115529a4b hyperledger/fabric-orderer:latest "orderer" 9 seconds ago Up 1 second 0.0.0.0:11050->7050/tcp orderer5.example.com
1e8cdb304527 hyperledger/fabric-orderer:latest "orderer" 9 seconds ago Up 5 seconds 0.0.0.0:10050->7050/tcp orderer4.example.com
944bcb1f5f4f hyperledger/fabric-peer:latest "peer node start" 9 seconds ago Up 1 second 0.0.0.0:7051->7051/tcp peer0.org1.example.com
19a3dbc52d09 hyperledger/fabric-peer:latest "peer node start" 9 seconds ago Up 2 seconds 0.0.0.0:9051->9051/tcp peer0.org2.example.com
2abf137857ba hyperledger/fabric-orderer:latest "orderer" 9 seconds ago Up 3 seconds 0.0.0.0:8050->7050/tcp orderer2.example.com
ee6757ecdabf hyperledger/fabric-peer:latest "peer node start" 9 seconds ago Up 3 seconds 0.0.0.0:8051->8051/tcp peer1.org1.example.com
a3f8f3e9449e hyperledger/fabric-orderer:latest "orderer" 9 seconds ago Up 5 seconds 0.0.0.0:9050->7050/tcp orderer3.example.com
Sleeping 15s to allow etcdraft cluster to complete booting
____ _____ _ ____ _____
/ ___| |_ _| / \ | _ \ |_ _|
\___ \ | | / _ \ | |_) | | |
___) | | | / ___ \ | _ < | |
|____/ |_| /_/ \_\ |_| \_\ |_|
Build your first network (BYFN) end-to-end test
Channel name : mychannel
Creating channel...
+ 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
2019-07-30 06:29:51.466 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 06:29:51.506 UTC [cli.common] readBlock -> INFO 002 Received block: 0
===================== Channel 'mychannel' created =====================
Having all peers join the channel...
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2019-07-30 06:29:51.605 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 06:29:51.673 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer0.org1 joined channel 'mychannel' =====================
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2019-07-30 06:29:54.783 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 06:29:54.832 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer1.org1 joined channel 'mychannel' =====================
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2019-07-30 06:29:57.930 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 06:29:57.977 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer0.org2 joined channel 'mychannel' =====================
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2019-07-30 06:30:01.086 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 06:30:01.185 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer1.org2 joined channel 'mychannel' =====================
Updating anchor peers for org1...
+ 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
2019-07-30 06:30:04.270 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 06:30:04.293 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org1MSP' on channel 'mychannel' =====================
Updating anchor peers for org2...
+ 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
2019-07-30 06:30:07.380 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 06:30:07.400 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org2MSP' on channel 'mychannel' =====================
Installing chaincode on peer0.org1...
+ peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/
+ res=0
+ set +x
2019-07-30 06:30:10.504 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 06:30:10.504 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-07-30 06:30:12.777 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:
===================== Chaincode is installed on peer0.org1 =====================
Install chaincode on peer0.org2...
+ peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/
+ res=0
+ set +x
2019-07-30 06:30:12.882 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 06:30:12.882 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-07-30 06:30:13.283 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:
===================== Chaincode is installed on peer0.org2 =====================
Instantiating chaincode on peer0.org2...
+ 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 'AND ('\''Org1MSP.peer'\'','\''Org2MSP.peer'\'')'
+ res=0
+ set +x
2019-07-30 06:30:13.379 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 06:30:13.379 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
===================== Chaincode is instantiated on peer0.org2 on channel 'mychannel' =====================
Querying chaincode on peer0.org1...
===================== 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
100
===================== Query successful on peer0.org1 on channel 'mychannel' =====================
Sending invoke transaction on peer0.org1 peer0.org2...
+ 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 --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses peer0.org2.example.com:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"Args":["invoke","a","b","10"]}'
+ res=0
+ set +x
2019-07-30 06:31:36.135 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 001 Chaincode invoke successful. result: status:200
===================== Invoke transaction successful on peer0.org1 peer0.org2 on channel 'mychannel' =====================
Installing chaincode on peer1.org2...
+ peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/
+ res=0
+ set +x
2019-07-30 06:31:36.263 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 06:31:36.263 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-07-30 06:31:36.855 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:
===================== Chaincode is installed on peer1.org2 =====================
Querying chaincode on peer1.org2...
===================== 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
90
===================== Query successful on peer1.org2 on channel 'mychannel' =====================
========= All GOOD, BYFN execution completed ===========
_____ _ _ ____
| ____| | \ | | | _ \
| _| | \| | | | | |
| |___ | |\ | | |_| |
|_____| |_| \_| |____/
private data:
https://hyperledger-fabric.readthedocs.io/en/release-1.4/private_data_tutorial.html
wang@wang:~/go/src/github.com/hyperledger/fabric-samples/first-network$ ./byfn.sh up -o etcdraft -c mychannel -s couchdb
Starting for channel 'mychannel' with CLI timeout of '10' seconds and CLI delay of '3' seconds and using database 'couchdb'
Continue? [Y/n] Y
proceeding ...
LOCAL_VERSION=1.4.2
DOCKER_IMAGE_VERSION=1.4.2
/home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/../bin/cryptogen
##########################################################
##### Generate certificates using cryptogen tool #########
##########################################################
+ cryptogen generate --config=./crypto-config.yaml
org1.example.com
org2.example.com
+ res=0
+ set +x
/home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/../bin/configtxgen
##########################################################
######### Generating Orderer Genesis block ##############
##########################################################
CONSENSUS_TYPE=etcdraft
+ '[' etcdraft == solo ']'
+ '[' etcdraft == kafka ']'
+ '[' etcdraft == etcdraft ']'
+ configtxgen -profile SampleMultiNodeEtcdRaft -channelID byfn-sys-channel -outputBlock ./channel-artifacts/genesis.block
2019-07-30 15:23:52.313 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-07-30 15:23:52.427 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 002 orderer type: etcdraft
2019-07-30 15:23:52.516 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 Orderer.EtcdRaft.Options unset, setting to tick_interval:"500ms" election_tick:10 heartbeat_tick:1 max_inflight_blocks:5 snapshot_interval_size:20971520
2019-07-30 15:23:52.516 CST [common.tools.configtxgen.localconfig] Load -> INFO 004 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 15:23:52.635 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 005 orderer type: solo
2019-07-30 15:23:52.635 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 006 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 15:23:52.676 CST [common.tools.configtxgen] doOutputBlock -> INFO 007 Generating genesis block
2019-07-30 15:23:52.677 CST [common.tools.configtxgen] doOutputBlock -> INFO 008 Writing genesis block
+ res=0
+ set +x
#################################################################
### Generating channel configuration transaction 'channel.tx' ###
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID mychannel
2019-07-30 15:23:52.760 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-07-30 15:23:52.863 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 15:23:52.960 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2019-07-30 15:23:52.960 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 15:23:52.960 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 005 Generating new channel configtx
2019-07-30 15:23:52.965 CST [common.tools.configtxgen] doOutputChannelCreateTx -> INFO 006 Writing new channel tx
+ res=0
+ set +x
#################################################################
####### Generating anchor peer update for Org1MSP ##########
#################################################################
+ configtxgen -profile TwoOrgsChannel -outputAnchorPeersUpdate ./channel-artifacts/Org1MSPanchors.tx -channelID mychannel -asOrg Org1MSP
2019-07-30 15:23:53.011 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-07-30 15:23:53.104 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 15:23:53.205 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2019-07-30 15:23:53.205 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 15:23:53.205 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 005 Generating anchor peer update
2019-07-30 15:23:53.205 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 006 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
2019-07-30 15:23:53.274 CST [common.tools.configtxgen] main -> INFO 001 Loading configuration
2019-07-30 15:23:53.406 CST [common.tools.configtxgen.localconfig] Load -> INFO 002 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 15:23:53.526 CST [common.tools.configtxgen.localconfig] completeInitialization -> INFO 003 orderer type: solo
2019-07-30 15:23:53.527 CST [common.tools.configtxgen.localconfig] LoadTopLevel -> INFO 004 Loaded configuration: /home/wang/go/src/github.com/hyperledger/fabric-samples/first-network/configtx.yaml
2019-07-30 15:23:53.527 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 005 Generating anchor peer update
2019-07-30 15:23:53.527 CST [common.tools.configtxgen] doOutputAnchorPeersUpdate -> INFO 006 Writing anchor peer update
+ res=0
+ set +x
Creating network "net_byfn" with the default driver
Creating volume "net_orderer.example.com" with default driver
Creating volume "net_orderer2.example.com" with default driver
Creating volume "net_peer0.org2.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_peer1.org2.example.com" with default driver
Creating volume "net_orderer5.example.com" with default driver
Creating volume "net_orderer4.example.com" with default driver
Creating volume "net_orderer3.example.com" with default driver
Creating orderer2.example.com
Creating orderer.example.com
Creating orderer4.example.com
Creating orderer3.example.com
Creating orderer5.example.com
Creating couchdb2
Creating couchdb3
Creating couchdb0
Creating couchdb1
Creating peer0.org2.example.com
Creating peer1.org1.example.com
Creating peer0.org1.example.com
Creating peer1.org2.example.com
Creating cli
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
52e82cdf9204 hyperledger/fabric-tools:latest "/bin/bash" 2 seconds ago Up Less than a second cli
e9712ff321aa hyperledger/fabric-peer:latest "peer node start" 4 seconds ago Up 1 second 0.0.0.0:10051->10051/tcp peer1.org2.example.com
18c35f345c8a hyperledger/fabric-peer:latest "peer node start" 5 seconds ago Up 2 seconds 0.0.0.0:7051->7051/tcp peer0.org1.example.com
c84829eb3099 hyperledger/fabric-peer:latest "peer node start" 5 seconds ago Up 2 seconds 0.0.0.0:8051->8051/tcp peer1.org1.example.com
1a3228f0821c hyperledger/fabric-peer:latest "peer node start" 6 seconds ago Up 2 seconds 0.0.0.0:9051->9051/tcp peer0.org2.example.com
b73ffb1cfc77 hyperledger/fabric-couchdb "tini -- /docker-ent…" 10 seconds ago Up 5 seconds 4369/tcp, 9100/tcp, 0.0.0.0:6984->5984/tcp couchdb1
4ceab07aec42 hyperledger/fabric-couchdb "tini -- /docker-ent…" 10 seconds ago Up 5 seconds 4369/tcp, 9100/tcp, 0.0.0.0:5984->5984/tcp couchdb0
29ea091120e5 hyperledger/fabric-couchdb "tini -- /docker-ent…" 10 seconds ago Up 4 seconds 4369/tcp, 9100/tcp, 0.0.0.0:8984->5984/tcp couchdb3
d2151a95c544 hyperledger/fabric-couchdb "tini -- /docker-ent…" 10 seconds ago Up 6 seconds 4369/tcp, 9100/tcp, 0.0.0.0:7984->5984/tcp couchdb2
638e070423fa hyperledger/fabric-orderer:latest "orderer" 10 seconds ago Up 6 seconds 0.0.0.0:11050->7050/tcp orderer5.example.com
fda5bd989659 hyperledger/fabric-orderer:latest "orderer" 11 seconds ago Up 7 seconds 0.0.0.0:9050->7050/tcp orderer3.example.com
310c4251b197 hyperledger/fabric-orderer:latest "orderer" 11 seconds ago Up 5 seconds 0.0.0.0:7050->7050/tcp orderer.example.com
54f7a25b0ee5 hyperledger/fabric-orderer:latest "orderer" 11 seconds ago Up 7 seconds 0.0.0.0:10050->7050/tcp orderer4.example.com
dcbfa9d0609f hyperledger/fabric-orderer:latest "orderer" 11 seconds ago Up 7 seconds 0.0.0.0:8050->7050/tcp orderer2.example.com
Sleeping 15s to allow etcdraft cluster to complete booting
____ _____ _ ____ _____
/ ___| |_ _| / \ | _ \ |_ _|
\___ \ | | / _ \ | |_) | | |
___) | | | / ___ \ | _ < | |
|____/ |_| /_/ \_\ |_| \_\ |_|
Build your first network (BYFN) end-to-end test
Channel name : mychannel
Creating channel...
+ 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
2019-07-30 07:24:21.330 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 07:24:21.359 UTC [cli.common] readBlock -> INFO 002 Got status: &{NOT_FOUND}
2019-07-30 07:24:21.363 UTC [channelCmd] InitCmdFactory -> INFO 003 Endorser and orderer connections initialized
2019-07-30 07:24:21.727 UTC [cli.common] readBlock -> INFO 004 Got status: &{SERVICE_UNAVAILABLE}
2019-07-30 07:24:21.732 UTC [channelCmd] InitCmdFactory -> INFO 005 Endorser and orderer connections initialized
2019-07-30 07:24:21.935 UTC [cli.common] readBlock -> INFO 006 Got status: &{SERVICE_UNAVAILABLE}
2019-07-30 07:24:21.938 UTC [channelCmd] InitCmdFactory -> INFO 007 Endorser and orderer connections initialized
2019-07-30 07:24:22.140 UTC [cli.common] readBlock -> INFO 008 Got status: &{SERVICE_UNAVAILABLE}
2019-07-30 07:24:22.143 UTC [channelCmd] InitCmdFactory -> INFO 009 Endorser and orderer connections initialized
2019-07-30 07:24:22.345 UTC [cli.common] readBlock -> INFO 00a Got status: &{SERVICE_UNAVAILABLE}
2019-07-30 07:24:22.349 UTC [channelCmd] InitCmdFactory -> INFO 00b Endorser and orderer connections initialized
2019-07-30 07:24:22.550 UTC [cli.common] readBlock -> INFO 00c Got status: &{SERVICE_UNAVAILABLE}
2019-07-30 07:24:22.554 UTC [channelCmd] InitCmdFactory -> INFO 00d Endorser and orderer connections initialized
2019-07-30 07:24:22.756 UTC [cli.common] readBlock -> INFO 00e Received block: 0
===================== Channel 'mychannel' created =====================
Having all peers join the channel...
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2019-07-30 07:24:22.866 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 07:24:23.332 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer0.org1 joined channel 'mychannel' =====================
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2019-07-30 07:24:26.449 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 07:24:26.676 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer1.org1 joined channel 'mychannel' =====================
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2019-07-30 07:24:29.774 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 07:24:29.983 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer0.org2 joined channel 'mychannel' =====================
+ peer channel join -b mychannel.block
+ res=0
+ set +x
2019-07-30 07:24:33.082 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 07:24:33.276 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel
===================== peer1.org2 joined channel 'mychannel' =====================
Updating anchor peers for org1...
+ 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
2019-07-30 07:24:36.368 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 07:24:36.387 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org1MSP' on channel 'mychannel' =====================
Updating anchor peers for org2...
+ 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
2019-07-30 07:24:39.525 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized
2019-07-30 07:24:39.547 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update
===================== Anchor peers updated for org 'Org2MSP' on channel 'mychannel' =====================
Installing chaincode on peer0.org1...
+ peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/
+ res=0
+ set +x
2019-07-30 07:24:42.668 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 07:24:42.669 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-07-30 07:24:43.024 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:
===================== Chaincode is installed on peer0.org1 =====================
Install chaincode on peer0.org2...
+ peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/
+ res=0
+ set +x
2019-07-30 07:24:43.142 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 07:24:43.142 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-07-30 07:24:43.481 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:
===================== Chaincode is installed on peer0.org2 =====================
Instantiating chaincode on peer0.org2...
+ 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 'AND ('\''Org1MSP.peer'\'','\''Org2MSP.peer'\'')'
+ res=0
+ set +x
2019-07-30 07:24:43.592 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 07:24:43.593 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
===================== Chaincode is instantiated on peer0.org2 on channel 'mychannel' =====================
Querying chaincode on peer0.org1...
===================== 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
100
===================== Query successful on peer0.org1 on channel 'mychannel' =====================
Sending invoke transaction on peer0.org1 peer0.org2...
+ 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 --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --peerAddresses peer0.org2.example.com:9051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c '{"Args":["invoke","a","b","10"]}'
+ res=0
+ set +x
2019-07-30 07:25:31.047 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 001 Chaincode invoke successful. result: status:200
===================== Invoke transaction successful on peer0.org1 peer0.org2 on channel 'mychannel' =====================
Installing chaincode on peer1.org2...
+ peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/
+ res=0
+ set +x
2019-07-30 07:25:31.154 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 07:25:31.154 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-07-30 07:25:32.200 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:
===================== Chaincode is installed on peer1.org2 =====================
Querying chaincode on peer1.org2...
===================== 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
90
===================== Query successful on peer1.org2 on channel 'mychannel' =====================
========= All GOOD, BYFN execution completed ===========
_____ _ _ ____
| ____| | \ | | | _ \
| _| | \| | | | | |
| |___ | |\ | | |_| |
|_____| |_| \_| |____/
wang@wang:~/go/src/github.com/hyperledger/fabric-samples/first-network$ docker exec -it cli bash
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode install -n marblesp -v 1.0 -p github.com/chaincode/marbles02_private/go/
2019-07-30 07:27:04.784 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 07:27:04.784 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-07-30 07:27:05.202 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_ADDRESS=peer1.org1.example.com:8051
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode install -n marblesp -v 1.0 -p github.com/chaincode/marbles02_private/go/
2019-07-30 07:27:22.852 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 07:27:22.852 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-07-30 07:27:23.160 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_LOCALMSPID=Org2MSP
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export PEER0_ORG2_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG2_CA
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/[email protected]/msp
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_ADDRESS=peer0.org2.example.com:9051
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode install -n marblesp -v 1.0 -p github.com/chaincode/marbles02_private/go/
2019-07-30 07:27:47.709 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 07:27:47.709 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-07-30 07:27:47.996 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_ADDRESS=peer1.org2.example.com:10051
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode install -n marblesp -v 1.0 -p github.com/chaincode/marbles02_private/go/
2019-07-30 07:28:02.993 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 07:28:02.993 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2019-07-30 07:28:03.309 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export ORDERER_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode instantiate -o orderer.example.com:7050 --tls --cafile $ORDERER_CA -C mychannel -n marblesp -v 1.0 -c '{"Args":["init"]}' -P "OR('Org1MSP.member','Org2MSP.member')" --collections-config $GOPATH/src/github.com/chaincode/marbles02_private/collections_config.json
2019-07-30 07:28:40.370 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2019-07-30 07:28:40.370 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_ADDRESS=peer0.org1.example.com:7051
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_LOCALMSPID=Org1MSP
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export 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
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export PEER0_ORG1_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export MARBLE=$(echo -n "{\"name\":\"marble1\",\"color\":\"blue\",\"size\":35,\"owner\":\"tom\",\"price\":99}" | base64 | tr -d \\n)
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode invoke -o orderer.example.com:7050 --tls --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 marblesp -c '{"Args":["initMarble"]}' --transient "{\"marble\":\"$MARBLE\"}"
2019-07-30 07:30:52.784 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 001 Chaincode invoke successful. result: status:200
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n marblesp -c '{"Args":["readMarble","marble1"]}'
{"color":"blue","docType":"marble","name":"marble1","owner":"tom","size":35}
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n marblesp -c '{"Args":["readMarblePrivateDetails","marble1"]}'
{"docType":"marblePrivateDetails","name":"marble1","price":99}
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_ADDRESS=peer0.org2.example.com:9051
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_LOCALMSPID=Org2MSP
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export PEER0_ORG2_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG2_CA
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/[email protected]/msp
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n marblesp -c '{"Args":["readMarble","marble1"]}'
{"color":"blue","docType":"marble","name":"marble1","owner":"tom","size":35}
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n marblesp -c '{"Args":["readMarblePrivateDetails","marble1"]}'
Error: endorsement failure during query. response: status:500 message:"{\"Error\":\"Failed to get private details for marble1: GET_STATE failed: transaction ID: 1c9dc44c3ba9b60d876096336e7ae345fe81d4e41aa4703bd7df009f01424ec8: tx creator does not have read access permission on privatedata in chaincodeName:marblesp collectionName: collectionMarblePrivateDetails\"}"
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_ADDRESS=peer0.org1.example.com:7051
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_LOCALMSPID=Org1MSP
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export 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
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export PEER0_ORG1_CA=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n marblesp -c '{"Args":["readMarblePrivateDetails","marble1"]}'
{"docType":"marblePrivateDetails","name":"marble1","price":99}
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export MARBLE=$(echo -n "{\"name\":\"marble2\",\"color\":\"blue\",\"size\":35,\"owner\":\"tom\",\"price\":99}" | base64 | tr -d \\n)
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode invoke -o orderer.example.com:7050 --tls --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 marblesp -c '{"Args":["initMarble"]}' --transient "{\"marble\":\"$MARBLE\"}"
2019-07-30 07:41:53.768 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 001 Chaincode invoke successful. result: status:200
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n marblesp -c '{"Args":["readMarblePrivateDetails","marble1"]}'
{"docType":"marblePrivateDetails","name":"marble1","price":99}
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export MARBLE_OWNER=$(echo -n "{\"name\":\"marble2\",\"owner\":\"joe\"}" | base64 | tr -d \\n)
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode invoke -o orderer.example.com:7050 --tls --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 marblesp -c '{"Args":["transferMarble"]}' --transient "{\"marble_owner\":\"$MARBLE_OWNER\"}"
2019-07-30 07:42:56.254 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 001 Chaincode invoke successful. result: status:200
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n marblesp -c '{"Args":["readMarblePrivateDetails","marble1"]}'
{"docType":"marblePrivateDetails","name":"marble1","price":99}
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export MARBLE_OWNER=$(echo -n "{\"name\":\"marble2\",\"owner\":\"tom\"}" | base64 | tr -d \\n)
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode invoke -o orderer.example.com:7050 --tls --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 marblesp -c '{"Args":["transferMarble"]}' --transient "{\"marble_owner\":\"$MARBLE_OWNER\"}"
2019-07-30 07:43:32.085 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 001 Chaincode invoke successful. result: status:200
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n marblesp -c '{"Args":["readMarblePrivateDetails","marble1"]}'
{"docType":"marblePrivateDetails","name":"marble1","price":99}
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# export MARBLE_OWNER=$(echo -n "{\"name\":\"marble2\",\"owner\":\"jerry\"}" | base64 | tr -d \\n)
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode invoke -o orderer.example.com:7050 --tls --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 marblesp -c '{"Args":["transferMarble"]}' --transient "{\"marble_owner\":\"$MARBLE_OWNER\"}"
2019-07-30 07:43:55.735 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 001 Chaincode invoke successful. result: status:200
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer# peer chaincode query -C mychannel -n marblesp -c '{"Args":["readMarblePrivateDetails","marble1"]}'
Error: endorsement failure during query. response: status:500 message:"{\"Error\":\"Marble private details does not exist: marble1\"}"
root@52e82cdf9204:/opt/gopath/src/github.com/hyperledger/fabric/peer#