安装fabric链码

[root@iZ8vbjcbks7pzj9po96hleZ test-network]# go env -w GOPROXY=https://goproxy.cn,direct
[root@iZ8vbjcbks7pzj9po96hleZ test-network]# ./network.sh deployCC -ccn basic -ccp …/asset-transfer-basic/chaincode-go -ccl go
Using docker and docker-compose
deploying chaincode on channel ‘mychannel’
executing with the following

  • CHANNEL_NAME: mychannel
  • CC_NAME: basic
  • CC_SRC_PATH: …/asset-transfer-basic/chaincode-go
  • CC_SRC_LANGUAGE: go
  • CC_VERSION: 1.0
  • CC_SEQUENCE: 1
  • CC_END_POLICY: NA
  • CC_COLL_CONFIG: NA
  • CC_INIT_FCN: NA
  • DELAY: 3
  • MAX_RETRY: 5
  • VERBOSE: false
    Vendoring Go dependencies at …/asset-transfer-basic/chaincode-go
    ~/fabric/scripts/fabric-samples/asset-transfer-basic/chaincode-go ~/fabric/scripts/fabric-samples/test-network
    go: downloading github.com/golang/protobuf v1.3.2
    go: downloading github.com/hyperledger/fabric-contract-api-go v1.1.0
    go: downloading github.com/hyperledger/fabric-chaincode-go v0.0.0-20200424173110-d7076418f212
    go: downloading github.com/hyperledger/fabric-protos-go v0.0.0-20200424173316-dd554ba3746e
    go: downloading github.com/stretchr/testify v1.5.1
    go: downloading google.golang.org/grpc v1.23.0
    go: downloading github.com/xeipuuv/gojsonschema v1.2.0
    go: downloading github.com/go-openapi/spec v0.19.4
    go: downloading github.com/gobuffalo/packr v1.30.1
    go: downloading github.com/pmezard/go-difflib v1.0.0
    go: downloading google.golang.org/genproto v0.0.0-20180831171423-11092d34479b
    go: downloading golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297
    go: downloading github.com/gobuffalo/envy v1.7.0
    go: downloading github.com/gobuffalo/packd v0.3.0
    go: downloading github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415
    go: downloading golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542
    go: downloading github.com/go-openapi/jsonpointer v0.19.3
    go: downloading github.com/go-openapi/jsonreference v0.19.2
    go: downloading github.com/go-openapi/swag v0.19.5
    go: downloading github.com/joho/godotenv v1.3.0
    go: downloading github.com/rogpeppe/go-internal v1.3.0
    go: downloading github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f
    go: downloading github.com/PuerkitoBio/purell v1.1.1
    go: downloading github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e
    go: downloading golang.org/x/text v0.3.2
    go: downloading github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
    ~/fabric/scripts/fabric-samples/test-network
    Finished vendoring Go dependencies
  • peer lifecycle chaincode package basic.tar.gz --path …/asset-transfer-basic/chaincode-go --lang golang --label basic_1.0
  • res=0
    Chaincode is packaged
    Installing chaincode on peer0.org1…
    Using organization 1
  • peer lifecycle chaincode install basic.tar.gz
  • res=0
    2022-07-05 15:43:54.270 CST 0001 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Installed remotely: response:<status:200 payload:“\nJbasic_1.0:2e20ce421c8037420718c8a3918a1eea76343b7361fffdac454181c54e5736c7\022\tbasic_1.0” >
    2022-07-05 15:43:54.270 CST 0002 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Chaincode code package identifier: basic_1.0:2e20ce421c8037420718c8a3918a1eea76343b7361fffdac454181c54e5736c7
    Chaincode is installed on peer0.org1
    Install chaincode on peer0.org2…
    Using organization 2
  • peer lifecycle chaincode install basic.tar.gz
  • res=0
    2022-07-05 15:44:02.571 CST 0001 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Installed remotely: response:<status:200 payload:“\nJbasic_1.0:2e20ce421c8037420718c8a3918a1eea76343b7361fffdac454181c54e5736c7\022\tbasic_1.0” >
    2022-07-05 15:44:02.571 CST 0002 INFO [cli.lifecycle.chaincode] submitInstallProposal -> Chaincode code package identifier: basic_1.0:2e20ce421c8037420718c8a3918a1eea76343b7361fffdac454181c54e5736c7
    Chaincode is installed on peer0.org2
    Using organization 1
  • peer lifecycle chaincode queryinstalled
  • res=0
    Installed chaincodes on peer:
    Package ID: basic_1.0:2e20ce421c8037420718c8a3918a1eea76343b7361fffdac454181c54e5736c7, Label: basic_1.0
    Query installed successful on peer0.org1 on channel
    Using organization 1
  • peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /root/fabric/scripts/fabric-samples/test-network/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem --channelID mychannel --name basic --version 1.0 --package-id basic_1.0:2e20ce421c8037420718c8a3918a1eea76343b7361fffdac454181c54e5736c7 --sequence 1
  • res=0
    2022-07-05 15:44:04.674 CST 0001 INFO [chaincodeCmd] ClientWait -> txid [f3a4477fe7445aeb09557e806eb283943efa9c1007216a8ca8709e25dc78db81] committed with status (VALID) at localhost:7051
    Chaincode definition approved on peer0.org1 on channel ‘mychannel’
    Using organization 1
    Checking the commit readiness of the chaincode definition on peer0.org1 on channel ‘mychannel’…
    Attempting to check the commit readiness of the chaincode definition on peer0.org1, Retry after 3 seconds.
  • peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic --version 1.0 --sequence 1 --output json
  • res=0
    {
    “approvals”: {
    “Org1MSP”: true,
    “Org2MSP”: false
    }
    }
    Checking the commit readiness of the chaincode definition successful on peer0.org1 on channel ‘mychannel’
    Using organization 2
    Checking the commit readiness of the chaincode definition on peer0.org2 on channel ‘mychannel’…
    Attempting to check the commit readiness of the chaincode definition on peer0.org2, Retry after 3 seconds.
  • peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic --version 1.0 --sequence 1 --output json
  • res=0
    {
    “approvals”: {
    “Org1MSP”: true,
    “Org2MSP”: false
    }
    }
    Checking the commit readiness of the chaincode definition successful on peer0.org2 on channel ‘mychannel’
    Using organization 2
  • peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /root/fabric/scripts/fabric-samples/test-network/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem --channelID mychannel --name basic --version 1.0 --package-id basic_1.0:2e20ce421c8037420718c8a3918a1eea76343b7361fffdac454181c54e5736c7 --sequence 1
  • res=0
    2022-07-05 15:44:12.827 CST 0001 INFO [chaincodeCmd] ClientWait -> txid [cda362eaafb282ff7973b49f667bea6ce8ef516f13984060cc6392be9f5ff97c] committed with status (VALID) at localhost:9051
    Chaincode definition approved on peer0.org2 on channel ‘mychannel’
    Using organization 1
    Checking the commit readiness of the chaincode definition on peer0.org1 on channel ‘mychannel’…
    Attempting to check the commit readiness of the chaincode definition on peer0.org1, Retry after 3 seconds.
  • peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic --version 1.0 --sequence 1 --output json
  • res=0
    {
    “approvals”: {
    “Org1MSP”: true,
    “Org2MSP”: true
    }
    }
    Checking the commit readiness of the chaincode definition successful on peer0.org1 on channel ‘mychannel’
    Using organization 2
    Checking the commit readiness of the chaincode definition on peer0.org2 on channel ‘mychannel’…
    Attempting to check the commit readiness of the chaincode definition on peer0.org2, Retry after 3 seconds.
  • peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name basic --version 1.0 --sequence 1 --output json
  • res=0
    {
    “approvals”: {
    “Org1MSP”: true,
    “Org2MSP”: true
    }
    }
    Checking the commit readiness of the chaincode definition successful on peer0.org2 on channel ‘mychannel’
    Using organization 1
    Using organization 2
  • peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls --cafile /root/fabric/scripts/fabric-samples/test-network/organizations/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem --channelID mychannel --name basic --peerAddresses localhost:7051 --tlsRootCertFiles /root/fabric/scripts/fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem --peerAddresses localhost:9051 --tlsRootCertFiles /root/fabric/scripts/fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/tlsca/tlsca.org2.example.com-cert.pem --version 1.0 --sequence 1
  • res=0
    2022-07-05 15:44:21.078 CST 0001 INFO [chaincodeCmd] ClientWait -> txid [afbaba0a6b95b3be829efce6b3a802667008470cc079427438e7e8eef0e4fde7] committed with status (VALID) at localhost:7051
    2022-07-05 15:44:21.079 CST 0002 INFO [chaincodeCmd] ClientWait -> txid [afbaba0a6b95b3be829efce6b3a802667008470cc079427438e7e8eef0e4fde7] committed with status (VALID) at localhost:9051
    Chaincode definition committed on channel ‘mychannel’
    Using organization 1
    Querying chaincode definition on peer0.org1 on channel ‘mychannel’…
    Attempting to Query committed status on peer0.org1, Retry after 3 seconds.
  • peer lifecycle chaincode querycommitted --channelID mychannel --name basic
  • res=0
    Committed chaincode definition for chaincode ‘basic’ on channel ‘mychannel’:
    Version: 1.0, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true]
    Query chaincode definition successful on peer0.org1 on channel ‘mychannel’
    Using organization 2
    Querying chaincode definition on peer0.org2 on channel ‘mychannel’…
    Attempting to Query committed status on peer0.org2, Retry after 3 seconds.
  • peer lifecycle chaincode querycommitted --channelID mychannel --name basic
  • res=0
    Committed chaincode definition for chaincode ‘basic’ on channel ‘mychannel’:
    Version: 1.0, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [Org1MSP: true, Org2MSP: true]
    Query chaincode definition successful on peer0.org2 on channel ‘mychannel’
    Chaincode initialization is not required
    [root@iZ8vbjcbks7pzj9po96hleZ test-network]# ./network.sh deployCC
    Using docker and docker-compose
    deploying chaincode on channel ‘mychannel’
    executing with the following
  • CHANNEL_NAME: mychannel
  • CC_NAME: NA
  • CC_SRC_PATH: NA
  • CC_SRC_LANGUAGE: NA
  • CC_VERSION: 1.0
  • CC_SEQUENCE: 1
  • CC_END_POLICY: NA
  • CC_COLL_CONFIG: NA
  • CC_INIT_FCN: NA
  • DELAY: 3
  • MAX_RETRY: 5
  • VERBOSE: false
    No chaincode name was provided. Valid call example: ./network.sh deployCC -ccn basic -ccp …/asset-transfer-basic/chaincode-go -ccl go
    Deploying chaincode failed
    [root@iZ8vbjcbks7pzj9po96hleZ test-network]# ./network.sh deployCC -ccn basic -ccp …/asset-transfer-basic/chaincode-go -ccl go
    Using docker and docker-compose
    deploying chaincode on channel ‘mychannel’
    executing with the following
  • CHANNEL_NAME: mychannel
  • CC_NAME: basic
  • CC_SRC_PATH: …/asset-transfer-basic/chaincode-go
  • CC_SRC_LANGUAGE: go
  • CC_VERSION: 1.0
  • CC_SEQUENCE: 1
  • CC_END_POLICY: NA
  • CC_COLL_CONFIG: NA
  • CC_INIT_FCN: NA
  • DELAY: 3
  • MAX_RETRY: 5
  • VERBOSE: false
    Vendoring Go dependencies at …/asset-transfer-basic/chaincode-go
    ~/fabric/scripts/fabric-samples/asset-transfer-basic/chaincode-go ~/fabric/scripts/fabric-samples/test-network
    ~/fabric/scripts/fabric-samples/test-network
    Finished vendoring Go dependencies
  • peer lifecycle chaincode package basic.tar.gz --path …/asset-transfer-basic/chaincode-go --lang golang --label basic_1.0
  • res=0
    Chaincode is packaged
    Installing chaincode on peer0.org1…
    Using organization 1
  • peer lifecycle chaincode install basic.tar.gz
  • res=1
    Error: chaincode install failed with status: 500 - failed to invoke backing implementation of ‘InstallChaincode’: chaincode already successfully installed (package ID ‘basic_1.0:2e20ce421c8037420718c8a3918a1eea76343b7361fffdac454181c54e5736c7’)
    Chaincode installation on peer0.org1 has failed
    Deploying chaincode failed
    [root@iZ8vbjcbks7pzj9po96hleZ test-network]#
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值