Hyperledger Fabric教程“错误:未知标志:-peerAddresses" [英] Hyperledger Fabric tutorial "Error: unknown flag: --peerAddresses"

查看:50
本文介绍了Hyperledger Fabric教程“错误:未知标志:-peerAddresses"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照 http://hyperledger-fabric的教程进行操作.阅读thedocs.io/en/latest/build_network.html

我正在复制粘贴,并选择了可以选择的Node.js变体.

 对等链代码调用-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 $ CHANNEL_NAME -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:7051 --tlsRootCertFiles/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt -c'{"Args":[调用","a","b","10"]}' 

当我到达上面的代码时,它给我错误错误:未知标志:--peerAddresses"

请在下面的终端历史记录中查看:

https://paste.ubuntu.com/p/xC5NNQVJyW/

请告知是否需要其他信息

解决方案

这是一个半答案,但我认为您应该遵循而不是 -P"AND('Org1MSP.peer','Org2MSP.peer')",并且当您调用链码时,您只能将其背对一个对等方(默认为org1的peer0).

CLI能够一次获得多个同龄人的认可是一项新功能(请参阅:http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html

I am copy&pasting along the way and opted for the Node.js variants where choice was offered.

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 $CHANNEL_NAME -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:7051 --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"]}'

When I get to the code above, it gives me the error "Error: unknown flag: --peerAddresses"

Please see below the terminal history:

https://paste.ubuntu.com/p/xC5NNQVJyW/

Please do tell if you need additional information

解决方案

This is sort of a half answer but I think you should be following the tutorial for http://hyperledger-fabric.readthedocs.io/en/release-1.1/build_network.html (Note: release-1.1 not latest). The only difference is that the endorsement policy when you instantiate is -P "OR ('Org1MSP.peer','Org2MSP.peer')" instead of -P "AND ('Org1MSP.peer','Org2MSP.peer')" and when you invoke the chaincode you only endorse it against one peer (the default being peer0 of org1).

The CLI being able to get endorsements from multiple peers at once is a new feature (ref: https://github.com/hyperledger/fabric/commit/368b1511e23d55355d572fd267223bb1bd4de890?short_path=6a6833d#diff-6a6833de704771c6c6879904e353c025) and I think the latest docker image for hyperledger/fabric-tools as of this post (1.1.0) does not reflect this change.

这篇关于Hyperledger Fabric教程“错误:未知标志:-peerAddresses"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆