What is set for read and writeset in Hyperledger Fabric 1.0?

I am confused to understand what is read and written in fabric 1.0. Please ask someone to explain using an example if possible.

+3


source to share


1 answer


Reading job sets and writing is transactional.

Suppose you have a transaction, read key a1 (suppose a1 value = value_a1, version = version_a1) and key a2 (suppose a2 value = value_a2, version = version_a2), suppose we want a1 value to decrease, a2 value increases;

So, this set for reading transactions:

{a1, value_a1, version_a1; a2, value_a2, version_a2}; 

      

ie, associated key, its value, its version list;



This set of transaction records:

{a1, (value_a1 -1); a2, (value_a2 +1)}; 

      

that is, the updated key and its new list of values.

Readset and Recordset are used to confirm the transaction and commit (update state) in the committer.

+6


source







All Articles