Re: Peer communication during chaincode execution


Unfortunately Fabric doesn't have this feature yet... you can comment in the JIRA that it's needed for you, but I am skeptic that we'll have this feature anytime soon

If you are willing to use your own Fabric build with custom modifications, I can point you to a PoC that adds 2 methods to the chaincode shim API:

        P2PSend(payload []byte, to ... string)
        P2PRecv() (payload []byte, from string)

However, this PoC is experimental.

From:        "Kimheng SOK" <sok.kimheng@...>
To:        Yacov Manevich <YACOVM@...>
Cc:        hyperledger-fabric@...
Date:        01/30/2020 02:55 AM
Subject:        [EXTERNAL] Re: [Hyperledger Fabric] Peer communication during chaincode execution
Sent by:        fabric@...


My usecase is chaincode need to call external program, in the case of multiple peers, each peer could produce non-deterministic result and the invoke function will return Error: Could not assemble transaction. So all peers need to communicate with each other about the result and compute deterministic result so that the error will not happen. 

This feature could open the possibility to avoid all peers just passively receiving the deterministic result from a client or central entity.
For sure the computation time will increase, because the more peers we have, the more communication need to be done just like gossip protocol. So it is a trade-off .
The good news is hyperledger is a permission blockchain, so the number of peers is limited depend on the use case, so some applications could be useful to have this feature.


On Thu, Jan 30, 2020 at 6:14 AM Yacov Manevich <YACOVM@...> wrote:

May I ask why do you need it? what's your use case?

"Kimheng SOK" <sok.kimheng@...>
01/29/2020 11:57 PM
[EXTERNAL] [Hyperledger Fabric] Peer communication during chaincode execution
Sent by:        

Dear all,

I wonder is it possible for peers to pass message to each other on the channel during the chaincode execution in the context of chaincode developer level not the protocol level? Or we need to modify the gossip protocol it self.

Appreciate for answering the question.

Join to automatically receive all group messages.