Hyperledger Cookbook
上QQ阅读APP看书,第一时间看更新

How it works...

In this recipe, we learned how to use CouchDB as the state database with Hyperledger Fabric. We also looked at how to use CouchDB to deploy Marbles to the network.

Hyperledger Fabric supports two types of peer databases: LevelDB is the default state database embedded in the peer node and stores chaincode data as simple key-value pairs; and CouchDB is an optional alternate state database that supports rich queries when chaincode data values are modeled as JSON. This recipe describes the steps required to use CouchDB as the state database with Fabric. CouchDB is a JSON document datastore rather than a pure key-value store, therefore enabling indexing of the contents of the documents in the database.

In the last recipe, we will show you how to write your first smart contract application and deploy it into the blockchain.