Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Blockchain by (4.1k points)

I have started learning hyperledger. Became familiarised with it by creating a sample app using the composer playground. My doubt is regarding the decentralized storage using hyperledger. I have read some few docs which mentions about :

  • Saving the hash of the data within the blockchain to ensure the immutability.

  • Saving the image within the blockchain(as an asset) through the base64 string.

Some of the things were clear but a large portion still remains uncertain. They are :

  • Where is the data stored within the blockchain? Is it in couchdb ?
  • Suppose the data is stored within the couchdb and via multipeer a new peer gets added to the channel, then does it mean that all the couchdb's of the peers get synced ?

Any resources/tutorials that mention about data storage with the blockchain, decentralized storage etc. would be very helpful.

Thanks!

1 Answer

0 votes
by (14.4k points)

The blockchain ledger is stored as a physical file, and it contains linked blocks, each of which consists of a set of transactions. Also, every state change is stored in those blocks. In contrast, the world state pertains to the current state of every asset because that is what applications exactly need.

The world state is implemented as a database (CouchDB is one of the best options). There is a simpler one available but that one offers much less in terms of querying capability. Of course, this means that the world state can be easily recreated from the ledger at any point in time. when a new peer gets added to a channel, its own world state is created from the ledger.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...