我们正在使用基于结构1.2的IBM托管区块链,并使用Go SDK @ 5e291d3a34f59beb9a8ae2bcbba388515648dc73。当我们尝试调用已安装在对等方上的链码时,出现“没有对等方可连接”错误:
[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
在添加一些我们自己的额外日志后,似乎似乎发生了故障,因为对等方发现服务(https://github.com/hyperledger/fabric-sdk-go/blob/master/pkg/client/common/discovery/dynamicdiscovery/chservice.go#L72)在响应中未返回任何对等方。目标似乎设置正确。
转储GRPC响应后,我们得到
(*discovery.Response)(0xc4205cd600)(
results: <
members: <
peers_by_org: <
key: "org1"
value: <>
>
>
>
)
我们还使用相同的链码自行建立了一个不同的结构网络,该网络正常工作,并且相同的转储显示了这一点(已删除部分内容):
(*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>"
>
>
>
>
>
)
我不确定问题是否出在SDK或IBM Managed Fabric Network的配置中。如果这是IBM网络,那么对等方似乎不知道他们是组织的成员。
有人以前见过这种行为吗? 我在超级账本官方火箭聊天中搜索“没有同级连接”错误,出现了一些结果,但是它们似乎是由其他原因引起的,例如,同级被SDK排除在外,而不是由于对发现请求。
答案 0 :(得分:1)
确保在通道中配置了锚点。
确保对等体配置了外部终结点,即-(CORE_PEER_GOSSIP_EXTERNALENDPOINT = peer1.org1.example.com:7051)