'How to select endorsing peers when submitting transaction in 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?
Solution 1:[1]
If you're using the gateway package to submit the transaction, then you should use WithEndorsingPeers as the optional argument.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Andrew Coleman |
