duandian8110 2018-03-01 22:38
浏览 165

无法实例化对等点上的链码,连接被对等点重置

I am trying to get started with Hyperledger Fabric. I managed to run the "build your first network"-tutorial from the samples, and I followed the "write your first application"-tutorial as well, which also worked.

As a next step, I wanted to create my own network more or less from scratch, by adjusting the .yaml files from the samples and running cryptogen and configtxgen manually. I managed to build a network with three organisations, two peers per org and a solo ordering service. I now want to install some basic chaincode on one of the peers, but I'm stuck, as I get a couple of weird errors:

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

After that, I get the usage information for peer chaincode instantiate

If you could provide any insight into what might be causing this error, I would be super grateful. I don't even know if it is caused by the network config or by the chaincode itself (I don't think so, since I tried two different chaincodes, one of which was "sacc" from the samples) but the installation of the chaincode seems to be working. My problem is that I have no idea what I'm doing, so after googling and fooling around with the arguments for peer chaincode instantiate, I'm all out of ideas.

My command (I run it from a .sh file) is:

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

The chaincode is taken from the sacc example installed via

peer chaincode install -n test -v 1.0 -p sacc

Thanks a lot! If you need more logs or other info, I can provide them.

  • 写回答

1条回答 默认 最新

  • dtrphb5597 2018-03-02 00:15
    关注

    Solved it. The problem had to do with the fact that I was not submitting a cafile. Basically, what I did is going back to this tutorial and trying it with their chaincode again:

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

    but I adjusted it to

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

    (I put the chaincode_example02.go file from fabric-samples/chaincode/ into my $GOPATH/src/chaincode_example02 folder and adjusted my docker-compose-cli.yaml by adding this line to cli -->volumes)

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

    Then, the crucial point:

    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')"
    

    although I adjusted this line again so that it matched my folder structure (exchanging example.com for my domain and so on.)

    That solved the issue.

    评论

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘