Peer communication during chaincode execution


Kimheng SOK
 

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.


Yacov
 

See https://jira.hyperledger.org/browse/FAB-11980

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



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




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.




Kimheng SOK
 

Hi,

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.

Bests,


On Thu, Jan 30, 2020 at 6:14 AM Yacov Manevich <YACOVM@...> wrote:
See https://jira.hyperledger.org/browse/FAB-11980

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



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




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.




Yacov
 

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@...




Hi,

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.

Bests,


On Thu, Jan 30, 2020 at 6:14 AM Yacov Manevich <YACOVM@...> wrote:
See https://jira.hyperledger.org/browse/FAB-11980

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




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




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.






Kimheng SOK
 

Hi,

Could you show me more about those two new APIs, and where can I find all the related files related to Gossip protocol and Chaincode Shim API, 
I would love to learn and may be have time to customize those methods too.
It is good to deep dive into the protocol level as a hyperleder developer, as now I am only a fresh hyperledger user.

Bests,

On Thu, Jan 30, 2020 at 8:17 AM Yacov Manevich <YACOVM@...> wrote:
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@...




Hi,

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.

Bests,


On Thu, Jan 30, 2020 at 6:14 AM Yacov Manevich <YACOVM@...> wrote:
See https://jira.hyperledger.org/browse/FAB-11980

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




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




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.






Yacov
 

Look at my last commits from https://github.com/yacovm/fabric2/commits/p2p

There is a sample that uses this API to performa secure summation



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




Hi,

Could you show me more about those two new APIs, and where can I find all the related files related to Gossip protocol and Chaincode Shim API, 
I would love to learn and may be have time to customize those methods too.
It is good to deep dive into the protocol level as a hyperleder developer, as now I am only a fresh hyperledger user.

Bests,


On Thu, Jan 30, 2020 at 8:17 AM Yacov Manevich <YACOVM@...> wrote:
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@...




Hi,

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.

Bests,


On Thu, Jan 30, 2020 at 6:14 AM Yacov Manevich <YACOVM@...> wrote:
See
https://jira.hyperledger.org/browse/FAB-11980

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




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




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.