【问题标题】:Unable to instantiate chaincode on peer, connection reset by peer无法在对等点上实例化链码,对等点重置连接
【发布时间】:2018-03-01 22:38:10
【问题描述】:

我正在尝试开始使用 Hyperledger Fabric。我设法从示例中运行了“构建你的第一个网络”教程,并且我也遵循了“编写你的第一个应用程序”教程,这也很有效。

下一步,我想或多或少地从头开始创建自己的网络,方法是调整示例中的 .yaml 文件并手动运行 cryptogen 和 configtxgen。我设法建立了一个包含三个组织的网络,每个组织两个同行和一个单独的订购服务。我现在想在其中一个节点上安装一些基本的链代码,但我遇到了一些奇怪的错误:

2018-03-01 22:27:30.525 UTC [grpc] Printf -> DEBU 003 transport: http2Client.notifyError got notified that the client transport was broken read tcp 172.20.0.9:45178->172.20.0.3:7050: read: connection reset by peer.
Error: Error getting broadcast client: Error connecting to orderer.rle.de:7050 due to rpc error: code = Internal desc = transport: write tcp 172.20.0.9:45178->172.20.0.3:7050: write: broken pipe
2018-03-01 22:27:30.525 UTC [grpc] Printf -> DEBU 004 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial tcp: lookup orderer.rle.de on 127.0.0.11:53: dial udp 127.0.0.11:53: operation was canceled"; Reconnecting to {orderer.rle.de:7050 <nil>}
2018-03-01 22:27:30.525 UTC [grpc] Printf -> DEBU 005 grpc: addrConn.transportMonitor exits due to: grpc: the connection is closing

之后,我得到peer chaincode instantiate的使用信息

如果您能提供有关可能导致此错误的原因的任何见解,我将非常感激。我什至不知道它是由网络配置还是由链码本身引起的(我不这么认为,因为我尝试了两种不同的链码,其中一个是样本中的“sacc”)但是安装链码似乎正在工作。我的问题是我不知道自己在做什么,所以在谷歌搜索并胡乱使用对等链码实例化的参数之后,我完全没有想法。

我的命令(我从 .sh 文件运行)是:

peer chaincode instantiate -o orderer.rle.de:7050 -C driverlogschannel -n test -v 1.0 -c '{"Args":["John","0"]}' -P "OR ('rleMSP.member')"

链码取自通过

安装的 sacc 示例
peer chaincode install -n test -v 1.0 -p sacc

非常感谢!如果您需要更多日志或其他信息,我可以提供。

【问题讨论】:

    标签: go hyperledger-fabric hyperledger


    【解决方案1】:

    解决了。问题与我没有提交文件有关。基本上,我所做的就是回到this tutorial 并再次使用他们的链码尝试:

    peer chaincode install -n mycc -v 1.0 -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02
    

    但我把它调整为

    peer chaincode install -n mycc -v 1.0 -p chaincode_example02
    

    (我将 chaincode_example02.go 文件从 fabric-samples/chaincode/ 放到我的 $GOPATH/src/chaincode_example02 文件夹中,并通过将此行添加到 cli -->volumes 来调整我的 docker-compose-cli.yaml)

    - $GOPATH/src/chaincode_example02:/opt/gopath/src/chaincode_example02
    

    那么,关键点:

    peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --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 -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
    

    虽然我再次调整了这一行,使其与我的文件夹结构相匹配(将 example.com 交换为我的域等等。)

    这解决了问题。

    【讨论】:

      猜你喜欢
      • 2014-07-20
      • 1970-01-01
      • 1970-01-01
      • 2019-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多