Hyperledger Fabric命令詳解之 up

kakushao發表於2018-08-06

sudo ./byfn.sh up


a@ubuntu:~/hyfa/fabric-samples/first-network$ sudo ./byfn.sh up


> 建立網路,peer,orderer,cli


Starting with channel `mychannel` and CLI timeout of `10` seconds and CLI delay of `3` seconds
Continue? [Y/n] y

執行中。。。

proceeding …

2018-07-10 01:55:17.481 UTC [main] main -> INFO 001 Exiting…..

LOCAL_VERSION=1.1.0

DOCKER_IMAGE_VERSION=1.1.0

建立網路

Creating network “net_byfn” with the default driver

使用預設引擎,建立組織節點的volume

Creating volume “net_peer0.org2.example.com” with default driver

Creating volume “net_peer1.org2.example.com” with default driver

Creating volume “net_peer1.org1.example.com” with default driver

Creating volume “net_peer0.org1.example.com” with default driver

Creating volume “net_orderer.example.com” with default driver

建立節點,peer和指定oederer (.example.com是域名)

Creating peer0.org2.example.com

Creating peer1.org2.example.com

Creating peer1.org1.example.com

Creating orderer.example.com

Creating peer0.org1.example.com

建立cli

Creating cli


start


建立你的第一個拜占庭網路,end-to-end 測試

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

Channel name : mychannel

> 建立通道

Creating channel…

peer TLS 根證書 檔案

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

peer TLS KTY 檔案

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

peer 本地msp ID

CORE_PEER_LOCALMSPID=Org1MSP

VM 埠

CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock

peer TLS 證書 檔案

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

peer TLS 狀態

CORE_PEER_TLS_ENABLED=true

peer TLS 配置路徑

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp

peer ID

CORE_PEER_ID=cli

登陸 等級

CORE_LOGGING_LEVEL=INFO

peer 地址

CORE_PEER_ADDRESS=peer0.org1.example.com:7051

+peer channel create

-o orderer.example.com:7050

-c mychannel

-f ./channel-artifacts/channel.tx

–tls true

–cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

+res=0

+set +x

2018-07-10 01:55:27.536 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized

2018-07-10 01:55:27.637 UTC [main] main -> INFO 002 Exiting…..

建立通道成功

===================== Channel “mychannel” is created successfully =====================


> 將所有節點加入通道


Having all peers join the channel…

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt

CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key

CORE_PEER_LOCALMSPID=Org1MSP

CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock

CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt

CORE_PEER_TLS_ENABLED=true

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp

CORE_PEER_ID=cli

CORE_LOGGING_LEVEL=INFO

CORE_PEER_ADDRESS=peer0.org1.example.com:7051

+peer channel join -b mychannel.block

+res=0

+set +x

2018-07-10 01:55:27.705 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized

2018-07-10 01:55:27.870 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel

2018-07-10 01:55:27.870 UTC [main] main -> INFO 003 Exiting…..

peer0.org1 加入通道

===================== peer0.org1 joined on the channel “mychannel” =====================

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt

CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key

CORE_PEER_LOCALMSPID=Org1MSP

CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock

CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt

CORE_PEER_TLS_ENABLED=true

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp

CORE_PEER_ID=cli

CORE_LOGGING_LEVEL=INFO

CORE_PEER_ADDRESS=peer1.org1.example.com:7051

+peer channel join -b mychannel.block

+res=0

+set +x

2018-07-10 01:55:30.932 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized

2018-07-10 01:55:31.051 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel

2018-07-10 01:55:31.051 UTC [main] main -> INFO 003 Exiting…..

peer1.org1 加入通道

===================== peer1.org1 joined on the channel “mychannel” =====================

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt

CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key

CORE_PEER_LOCALMSPID=Org2MSP

CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock

CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt

CORE_PEER_TLS_ENABLED=true

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp

CORE_PEER_ID=cli

CORE_LOGGING_LEVEL=INFO

CORE_PEER_ADDRESS=peer0.org2.example.com:7051

+peer channel join -b mychannel.block

+res=0

+set +x

2018-07-10 01:55:34.140 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized

2018-07-10 01:55:34.299 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel

2018-07-10 01:55:34.299 UTC [main] main -> INFO 003 Exiting…..

peer0.org2 加入通道

===================== peer0.org2 joined on the channel “mychannel” =====================

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt

CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key

CORE_PEER_LOCALMSPID=Org2MSP

CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock

CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt

CORE_PEER_TLS_ENABLED=true

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp

CORE_PEER_ID=cli

CORE_LOGGING_LEVEL=INFO

CORE_PEER_ADDRESS=peer1.org2.example.com:7051

+peer channel join -b mychannel.block

+res=0

+set +x

INFO 001 Endorser 和 orderer 連線初始化完成

2018-07-10 01:55:37.360 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized

INFO 002 成功提交請求(請求加入通道)

2018-07-10 01:55:37.468 UTC [channelCmd] executeJoin -> INFO 002 Successfully submitted proposal to join channel

INFO 003 退出中。。

2018-07-10 01:55:37.468 UTC [main] main -> INFO 003 Exiting…..

peer1.org2加入通道

===================== peer1.org2 joined on the channel “mychannel” =====================

更新org1 的anchor節點

Updating anchor peers for org1…

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt

CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key

CORE_PEER_LOCALMSPID=Org1MSP

CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock

CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt

CORE_PEER_TLS_ENABLED=true

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp

CORE_PEER_ID=cli

CORE_LOGGING_LEVEL=INFO

CORE_PEER_ADDRESS=peer0.org1.example.com:7051

+peer channel update

-o orderer.example.com:7050

-c mychannel

-f ./channel-artifacts/Org1MSPanchors.tx

–tls true

–cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

+res=0

+set +x

INFO 001 , Endorser 和 orderer 連線 初始化完成

2018-07-10 01:55:40.523 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized

INFO 002 成功提交提交通道更新

2018-07-10 01:55:40.537 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update

INFO 003 退出中。。

2018-07-10 01:55:40.537 UTC [main] main -> INFO 003 Exiting…..

通道上Org1MSP 的anchor節點 更新成功

===================== Anchor peers for org “Org1MSP” on “mychannel” is updated successfully =====================

更新org2 的anchor節點。。。

Updating anchor peers for org2…

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt

CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key

CORE_PEER_LOCALMSPID=Org2MSP

CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock

CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt

CORE_PEER_TLS_ENABLED=true

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp

CORE_PEER_ID=cli

CORE_LOGGING_LEVEL=INFO

CORE_PEER_ADDRESS=peer0.org2.example.com:7051

+peer channel update

-o orderer.example.com:7050

-c mychannel

-f ./channel-artifacts/Org2MSPanchors.tx

–tls true

–cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

+res=0

+set +x

2018-07-10 01:55:43.745 UTC [channelCmd] InitCmdFactory -> INFO 001 Endorser and orderer connections initialized

2018-07-10 01:55:43.766 UTC [channelCmd] update -> INFO 002 Successfully submitted channel update

2018-07-10 01:55:43.766 UTC [main] main -> INFO 003 Exiting…..

通道中的org2MSP 的anchor節點 更新成功

===================== Anchor peers for org “Org2MSP” on “mychannel” is updated successfully =====================


安裝鏈碼到peer0.org1


Installing chaincode on peer0.org1…

+peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt

CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key

CORE_PEER_LOCALMSPID=Org1MSP

CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock

CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt

CORE_PEER_TLS_ENABLED=true

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp

CORE_PEER_ID=cli

CORE_LOGGING_LEVEL=INFO

CORE_PEER_ADDRESS=peer0.org1.example.com:7051

+res=0

+set +x

INFO 001,使用預設escc

2018-07-10 01:55:46.900 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc

INFO 002,使用預設vscc

2018-07-10 01:55:46.900 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc

INFO 003 退出。。。

2018-07-10 01:55:48.856 UTC [main] main -> INFO 003 Exiting…..

peer0.org1 上鍊碼,安裝成功

===================== Chaincode is installed on peer0.org1 =====================

在peer0.org2 上安裝鏈碼

Install chaincode on peer0.org2…

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt

CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key

CORE_PEER_LOCALMSPID=Org2MSP

CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock

CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt

CORE_PEER_TLS_ENABLED=true

CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp

CORE_PEER_ID=cli

CORE_LOGGING_LEVEL=INFO

CORE_PEER_ADDRESS=peer0.org2.example.com:7051

節點鏈碼安裝 –注意格式 -n鏈碼 -v版本號 -l語言 -p

+peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/

+res=0

+set +x

2018-07-10 01:55:48.956 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc

2018-07-10 01:55:48.956 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc

2018-07-10 01:55:49.125 UTC [main] main -> INFO 003 Exiting…..

peer0.org2 上鍊碼安裝成功

===================== Chaincode is installed on peer0.org2 =====================


例項化 peer0.org2上的鏈碼。。。


Instantiating chaincode on peer0.org2…

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org2.example.com:7051

節點鏈碼例項化–注意格式 -o –tls –cafile -C -n -l -c

+peer chaincode instantiate

-o orderer.example.com:7050

–tls true

–cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

-C mychannel

-n mycc

-l golang -v 1.0

-c `{“Args”:[“init”,”a”,”100″,”b”,”200″]}` -P `OR (“`Org1MSP.peer“`,“`Org2MSP.peer“`)`

+res=0

+set +x

2018-07-10 01:55:49.315 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc

2018-07-10 01:55:49.315 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc

2018-07-10 01:56:26.781 UTC [main] main -> INFO 003 Exiting…..

通道上 peer0.org2 鏈碼例項化成功

===================== Chaincode Instantiation on peer0.org2 on channel `mychannel` is successful =====================


請求 peer0.org1 。。。


Querying chaincode on peer0.org1…

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org1.example.com:7051

在通道上,請求 peer0.org1

===================== Querying on peer0.org1 on channel `mychannel`… =====================

節點鏈碼請求-注意格式-C通道 -n鏈碼 -c引數

+peer chaincode query -C mychannel -n mycc -c `{“Args”:[“query”,”a”]}`

Attempting to Query peer0.org1 …3 secs

+res=0

+set +x

2018-07-10 01:56:30.181 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc

2018-07-10 01:56:30.181 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc

請求結果:100

Query Result: 100

2018-07-10 01:57:05.171 UTC [main] main -> INFO 003 Exiting…..

通道上,向peer0.org1的請求成功

===================== Query on peer0.org1 on channel `mychannel` is successful =====================


鏈碼呼叫,傳送交易到peer0.org1。。。


Sending invoke transaction on peer0.org1…

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org1MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer0.org1.example.com:7051

+peer chaincode invoke

-o orderer.example.com:7050

–tls true –cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem

-C mychannel

-n mycc

-c `{“Args”:[“invoke”,”a”,”b”,”10″]}`

+res=0

+set +x

2018-07-10 01:57:06.763 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc

2018-07-10 01:57:06.763 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc

鏈碼呼叫or請求,INFO 003,鏈碼呼叫:成功,結果狀態碼:200

2018-07-10 01:57:06.835 UTC [chaincodeCmd] chaincodeInvokeOrQuery -> INFO 003 Chaincode invoke successful. result: status:200

INFO 004 退出。。。

2018-07-10 01:57:06.835 UTC [main] main -> INFO 004 Exiting…..

通道上,向peer0.org1傳送的交易invoke,成功

===================== Invoke transaction on peer0.org1 on channel `mychannel` is successful =====================


在peer1.org2上安裝鏈碼


Installing chaincode on peer1.org2…

+peer chaincode install -n mycc -v 1.0 -l golang -p github.com/chaincode/chaincode_example02/go/

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer1.org2.example.com:7051

+res=0

+set +x

2018-07-10 01:57:06.953 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-07-10 01:57:06.954 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2018-07-10 01:57:08.024 UTC [main] main -> INFO 003 Exiting…..

peer1.org2上鍊碼安裝成功

===================== Chaincode is installed on peer1.org2 =====================

請求 peer1.org2上 鏈碼。。。

Querying chaincode on peer1.org2…

CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
CORE_PEER_LOCALMSPID=Org2MSP
CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
CORE_PEER_TLS_ENABLED=true
CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp
CORE_PEER_ID=cli
CORE_LOGGING_LEVEL=INFO
CORE_PEER_ADDRESS=peer1.org2.example.com:7051

請求peer1.org2上鍊碼

===================== Querying on peer1.org2 on channel `mychannel`… =====================

+peer chaincode query -C mychannel -n mycc -c `{“Args”:[“query”,”a”]}`
Attempting to Query peer1.org2 …3 secs

+res=0

+set +x

2018-07-10 01:57:11.240 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-07-10 01:57:11.240 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc

請求結果:90

Query Result: 90

2018-07-10 01:57:43.272 UTC [main] main -> INFO 003 Exiting…..

通道上,peer1.org2請求成功

通道上,peer1.org2,請求成功

===================== Query on peer1.org2 on channel `mychannel` is successful =====================

拜占庭執行完成

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


end


相關文章