dounuo1881 2019-01-25 18:13
浏览 349

fabric-sdk-go错误:无对等连接

We are using the IBM Managed Blockchain based on fabric 1.2, and using the Go SDK @5e291d3a34f59beb9a8ae2bcbba388515648dc73. When we try to invoke the chaincode we have installed on the peers, we get a "no peers to connect to" error:

[fabsdk/fab] 2019/01/25 12:25:57 UTC - dispatcher.(*Dispatcher).Start.func1 -> DEBU Listening for events...
[fabsdk/fab] 2019/01/25 12:25:57 UTC - client.(*Client).connect -> DEBU ... got error in connection response: no peers to connect to
[fabsdk/common] 2019/01/25 12:25:57 UTC - retry.(*RetryableInvoker).Invoke -> DEBU Failed with err [error registering for TxStatus event: no peers to connect to] on attempt #1. Checking if retry is warranted...
[fabsdk/util] 2019/01/25 12:25:57 UTC - lazyref.(*Reference).setTimerRunning -> DEBU Timer started
[fabsdk/common] 2019/01/25 12:25:57 UTC - retry.(*RetryableInvoker).Invoke -> DEBU ... retry for err [error registering for TxStatus event: no peers to connect to] is NOT warranted after 1 attempt(s).
[fabsdk/util] 2019/01/25 12:25:57 UTC - lazyref.checkTimeStarted -> DEBU Starting timer

After putting some extra logging of our own it looks like the failure happens because the peer discovery service (https://github.com/hyperledger/fabric-sdk-go/blob/master/pkg/client/common/discovery/dynamicdiscovery/chservice.go#L72) doesn't return any peers in its response. The targets seem to be set correctly.

After dumping the GRPC response, we get

(*discovery.Response)(0xc4205cd600)(
results: <
    members: <
        peers_by_org: <
            key: "org1" 
            value: <> 
        > 
    >
> 
)

We also set up a different fabric network on our own with the same chaincode, which works properly and the same dump shows this instead (some parts were redacted):

(*discovery.Response)(0xc42045ed20)(
results: <
    members: <
        peers_by_org: <
            key: "Org1MSP" 
            value: <
                peers: <
                    state_info: <
                        payload:"<redacted>"
                    >
                    membership_info: <payload:"<redacted>" > 
                    identity:"<redacted>" 
                >
                peers: <
                    state_info: <
                        payload:"<redacted>" 
                        signature:"<redacted>" 
                    > 
                    membership_info: <
                        payload:"<redacted>" 
                        signature:"<redacted>" 
                    > 
                    identity:"<redacted>"
                >
            >
        > 
        peers_by_org: <
            key:"Org2MSP"
            value: <
                peers: <
                    state_info:<
                        payload:"<redacted>" 
                        signature:"<redacted>" 
                    > 
                    membership_info: <
                        payload:"<redacted>" 
                    > 
                    identity:"<redacted>" 
                > 
                peers: <
                    state_info: <
                        payload:"<redacted>" 
                        signature:"<redacted>" 
                    > 
                    membership_info: < 
                        payload:"<redacted>" 
                        signature:"<redacted>" 
                    > 
                    identity:"<redacted>" 
                > 
            > 
        > 
    > 
>
)

I am unsure if the issue is in the configuration of the SDK or the IBM Managed fabric network. If it is the IBM network, then it seems that somehow the peers aren't aware that they are members of an organization.

Has anyone seen this behaviour before? I searched the hyperledger official rocket chat for the "no peers to connect to" error, and some results came up, but they seemed to be caused by other reasons, such as the peers being excluded by the SDK, not due to the response to the discovery request.

  • 写回答

2条回答 默认 最新

  • donqo88682 2019-01-25 20:58
    关注
    1. Make sure you have anchor peers configured in the channel.

    2. Make sure the peers have external endpoints configured, i.e - (CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051)

    评论

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题