首页 > 解决方案 > Hyperledger Fabric 教程“错误:未知标志:--peerAddresses”

问题描述

我正在遵循http://hyperledger-fabric.readthedocs.io/en/latest/build_network.html上的教程

我一直在复制和粘贴,并选择了提供选择的 Node.js 变体。

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"]}'

当我看到上面的代码时,它给了我错误“错误:未知标志:--peerAddresses”

请参阅下面的终端历史记录:

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

如果您需要更多信息,请务必告知

标签: node.jshyperledger-fabric

解决方案


这是一个半答案,但我认为您应该遵循http://hyperledger-fabric.readthedocs.io/en/release-1.1/build_network.html的教程(注意:release-1.1不是最新的)。唯一的区别是,当您实例化时的背书策略是-P "OR ('Org1MSP.peer','Org2MSP.peer')"而不是-P "AND ('Org1MSP.peer','Org2MSP.peer')"当您调用链代码时,您只对一个对等方(默认为 org1 的 peer0)背书。

CLI 能够同时获得多个同行的认可是一项新功能(参考:https ://github.com/hyperledger/fabric/commit/368b1511e23d55355d572fd267223bb1bd4de890?short_path=6a6833d#diff- 6a6833de704771c6c6879904e353c025 我认为最新的 docker image)从这篇文章(1.1.0)开始,对于 hyperledger/fabric-tools 并没有反映这种变化。


推荐阅读