0

I have several questions regarding Hyperledger-Fabric, for which I did not find a distinct answer in the docs.

1.) World state(s)

The ledger consists of the blockchain (containing the transactions) and the world state (stored in a database). Every transaction is stored in the blockchain forever. Furthermore, it appears like the database does not only store the current value of keys/variables but also past versions (see the following figure from the docs):

enter image description here

So is my understanding correct that the ledger does not only save all transactions but ALSO all world states that ever existed? If so, why save all states from state 0 to the current state? Why not just save a) all transactions and b) only the current world state? Wouldn't that be enough?

                    ****************************

2.) Channels and world state

Assume I have a Hyperledger-Fabric Application, where different members can comment on each other's profile pictures.

Assume further there are three members ("organisations"): Adam, Bob and Sara.

Furthermore, there is a channel between Adam and Bob. And there is a second channel between Adam and Sarah.

Obviously, this means that

  • transactions between Adam and Bob are not visible to Sarah
  • transactions between Adam and Sarah are not visible to Bob

Assume there is a transaction named "addCommentToProfile", which can be used to add comments to other profiles.

Assume Sarah sends transaction "addCommentToProfile", adding the comment "your hair looks very good!" to Adam's profile.

Obviously, the transaction is not visible to Bob (because it is only part of the channel between Adam and Sarah.)

But is the result of the transaction (a new comment "your hair looks very good!" on Adam's profile) also invisible?

Put differently, given that Adam participates in two different channels - are there also two different world states for Adam - one that is visible to Bob and one that is visible to Sarah?

                 ****************************

3.) "Hyperledger Explorer" versus "Hyperledger Composer Historian"

There is "Hyperledger Composer Historian" (https://hyperledger.github.io/composer/v0.16/business-network/historian) and there is "Hyperledger Explorer" (https://www.hyperledger.org/projects/explorer)

Are they the same thing (i.e. if one uses the Hyperledger Composer Framework, then the "Hyperledger Explorer" is simply called "Hyperledger Composer Historian")? Or are they two different things? In case they are different things:how can I prevent participants from of the business network from accessing "Hyperledger Explorer" records?

steady_progress
  • 3,311
  • 10
  • 31
  • 62

1 Answers1

1

1.) World State - the State Database does not contain the history, although there is a version number, only the current version is stored in the State Database.

2.) Channels - the channels are entirely separate, so in your example, Adam has 2 profiles, one in each channel. Your chaincode (Smart Contract) will be separately installed and instantiated on each channel.

3.) Composer and Explorer - are quite different. Composer is built on top of Fabric to create a level of abstraction from the underlying Fabric, and to create a simplified programming model. Composer then included a Historian feature to make audit simple.

You should be aware that the majority code contributor to Composer (IBM) has decided to significantly reduce development effort on Composer and Focus on improving the developer experience through the Fabric Node SDK. More details of the decision are here. So if you are planning a quick POC or Demo in the short term, Composer is very helpful, but if you are looking at a significant ongoing development project you might want to think carefully.

If you choose not to use Composer, History is key feature of Blockchains, and the native Fabric programming model allows you access to the History of an object, but it is not quite as easy as the Historian feature in Composer.

Hyperledger Explorer is a friendly viewer for Hyperledger Fabric (it may now be possible to invoke transactions through a REST API).

R Thatcher
  • 5,550
  • 1
  • 7
  • 15
  • Thank you very much for your answer ... this is really important information to know ... A follow-up question emerged from this question and the answer given to it ... I created a new post for this follow-up question here: https://stackoverflow.com/questions/52295535/hyperledger-explorer-how-to-prevent-participants-from-accessing-transaction-his ... in case you know the answer to this follow-up question as well, feel free to respond to it. – steady_progress Sep 12 '18 at 12:47