Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is read set and write set in Hyperledger Fabric 1.0?

I am confused to understand what is read and write set in fabric 1.0, Kindly someone explain by taking example if possible.

like image 788
deepak parmar Avatar asked Jul 19 '17 04:07

deepak parmar


1 Answers

Read set and write sets are related to a transaction.

Suppose you have a transaction, read key a1 (suppose a1's value = value_a1, version = version_a1), and key a2(suppose a2's value = value_a2, version = version_a2), suppose we want a1's value to be decremented, and a2's value incremented;

So this transaction's read set is :

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

i.e., the related key, its value, its version list;

This transaction's write set is:

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

i.e., the updated key and its new value list.

Read set and write set are used for transaction endorsement and commit (update world state) at committer.

like image 132
Timon Fay Avatar answered Nov 15 '22 07:11

Timon Fay