Reputation: 775
I have a theoretical question.
Let's say we have a transaction that needs endorsement by 2 peers. But the two peers have different requirements to endorse a transaction. For example if we want to change the value of the number N, for peer 1 it will endorse it only if the value is higher than 5, and for peer 2 it will only endorse it if the value is higher than 10 (I know it doesn't make a lot of sense this example but... let's say it's like that).
What is the way to split that logic in the chaincode? How to understand on which peer the chaincode is executed at the moment so I can check if the value should be over 5 or over 10 in order to endorse it?
Upvotes: 2
Views: 330
Reputation: 5140
You can support that in v1.1 if you install a custom authentication filter in the peer(s) that will parse the proposal and deny it in some cases.
Basically you create a .so file and put the reference in core.yaml and then the peer loads with it.
Take a look at an auth filter that checks for the expiration of the client's certificate.
Upvotes: 3