Hyperledger Fabric Peer Join Channel

发布于 2025-01-23 01:20:32 字数 941 浏览 4 评论 0 原文

用例是:

  1. 我创建了一个带有一个通道的网络,其中一个通道说, channel1 与三个组织(org1,org2 and org3)。
  2. org1和org2对等方已加入通道 Channel1
  3. org3仅存在于频道配置中,但尚未加入频道。
  4. 现在,我在系统通道和Channel1配置中添加了新的订购器端点,并删除了旧订购器端点。
  5. 我的新订单器工作正常,能够为两个通道提供配置。
  6. 我从org3 peer获取了Channel1的0块,并发出了JOIN命令。
  7. 该命令工作正常,但是在对等方面,我会遇到这些错误:
2022-04-20 05:28:18.210 UTC 006b WARN [peer.blocksprovider] func1 -> Encountered an error reading from deliver stream: EOF channel=channel1 orderer-address=orderer.example.com:7050
2022-04-20 05:28:18.210 UTC 006c WARN [peer.blocksprovider] DeliverBlocks -> Got error while attempting to receive blocks: received bad status SERVICE_UNAVAILABLE from orderer channel=channel1 orderer-address=orderer.example.com:7050

org3对等方仍在尝试与较旧的订单器端点连接(因为它们最初是在0块中定义的)。

那么如何解决这个问题?

我可以认为的一种方法是使用org1/org2对等的快照。

你的想法是什么?

谢谢

The use case is:

  1. I created a network with Raft Ordering service having one channel say, channel1 with three Organisations (Org1, Org2 and Org3).
  2. Org1 and Org2 peers have joined the channel channel1.
  3. Org3 is just present in the channel config but not joined the channel yet.
  4. Now I added the new orderer endpoints in the system channel and channel1 config and removed the old orderer endpoints.
  5. My new orderers are working fine, able to fetch the config for both channels.
  6. I fetched the 0 block of channel1 from Org3 peer and issued the join command.
  7. The command works fine, but in the peer I am getting these error:
2022-04-20 05:28:18.210 UTC 006b WARN [peer.blocksprovider] func1 -> Encountered an error reading from deliver stream: EOF channel=channel1 orderer-address=orderer.example.com:7050
2022-04-20 05:28:18.210 UTC 006c WARN [peer.blocksprovider] DeliverBlocks -> Got error while attempting to receive blocks: received bad status SERVICE_UNAVAILABLE from orderer channel=channel1 orderer-address=orderer.example.com:7050

The Org3 peer is still trying to connect with the older orderer endpoints (as they were defined in the 0 block initially).

So how to sort out this problem?

One way I can think is to use the snapshot of the Org1/Org2 peer maybe.

What are your thoughts?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一身软味 2025-01-30 01:20:32

我找到了解决方案,因此,如果将来有人需要它,可以在订单器端点在频道配置中更新订单器端点时使用此答案加入频道。

方法1:

在同伴配置中,您可以覆盖一些变量,以用新的订单器端点覆盖旧订购器端点。

配置文件和参数的链接是:

此方法将允许您使用Genesis Block加入对等,并得到较旧版本的织物(< = V2.2)的支持,该版本不支持加入加入通过快照。

方法2:

如果您在织物v2.2+上,则可以使用方法1或使用来自另一个对等的快照连接通道。
官方文档中有教程,请检查:

谢谢,
萨希尔

I found the solution, so if anyone in the future needs it, can use this answer to join the channel when the orderer endpoints are updated in the channel configuration.

Method 1:

In the peer configuration you can override some of the variables to override the old orderer endpoint with the new orderer endpoints.

The link to the config file and params is:
https://github.com/hyperledger/fabric/blob/main/sampleconfig/core.yaml#L382-L388

This method will allow you to join the peer using genesis block and is supported by older versions of Fabric (<=v2.2) which does not support joining by snapshot.

Method 2:

If you are on Fabric v2.2+, then you can either use the Method 1 or join the channel using a snapshot from another peer.
There is tutorial in the official docs for that, please check it:
https://hyperledger-fabric.readthedocs.io/en/release-2.3/peer_ledger_snapshot.html

Thanks,
Sahil

为你拒绝所有暧昧 2025-01-30 01:20:32

来自HLF文档

通过快照加入将为对等提供最新的频道配置,如果自创世纪块以来频道配置发生了变化,这可能很重要。例如,对等方可能需要从最新频道配置中的订单端点或CA证书,然后才能成功地从订购服务提取块。

From HLF docs

joining by snapshot will provide a peer with the latest channel configuration, which may be important if the channel configuration has changed since the genesis block. For example, the peer may need the orderer endpoints or CA certificates from the latest channel configuration before it can successfully pull blocks from the ordering service.

Taking ledger snapshots and using them to join channels

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文