GO SDK提交交易时如何选择背书节点

发布于 2025-01-18 06:22:14 字数 391 浏览 3 评论 0原文

我有一个包含两个组织的 Hyperledger-Fabric 网络:Org1 和 Org2。发现已启用。 当我运行网关客户端并提交交易时,它总是由peer0.peer.org1.com 认可。 在特定场景中,我可能想选择特定的节点来背书交易。

注意到Go SDK中有一个函数,称为channel.WithTargetEndpoints(),我想我可以使用这个函数来附加RequestOption。当我使用 org1 中的任何目标对等点时,事务可以成功处理,但是,当我尝试指定 org2 中的对等点时,它不起作用。 猜测我的用户证书是由 org1 签署的。 NetworkPeerConfig 可以根据键(名称或 URL)获取对等配置。但是,org1 内的用户无法获取 org2 对等方的对等配置。

GO SDK提交交易时如何选择背书节点?

I have a Hyperledger-Fabric network with two organisations: Org1 and Org2. Discovery is enabled.
When I run a Gateway client and submit a transaction, it always be endorsed by peer0.peer.org1.com.
In particular scenario, I may want to select particular peer to endorse the transaction.

Noticed that there is a function in Go SDK, called channel.WithTargetEndpoints(), I thought that i could use this function to append RequestOption. When I used any target peers from org1, the transaction could be processed successfully, however, when I tried to specify peers from org2, it didnt work.
Guess my user certificate was signed by org1. NetworkPeerConfig can fetch the peer configuration based on a key (name or URL). However, user within org1 cannot fetch the peer configuration for org2's peers.

How to select endorsing peers when submitting transaction in GO SDK?

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

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

发布评论

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

评论(1

许你一世情深 2025-01-25 06:22:14

如果您使用网关软件包提交交易,则应使用 witchEndorSingpeers 作为可选参数。

If you're using the gateway package to submit the transaction, then you should use WithEndorsingPeers as the optional argument.

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