March 2019
Intermediate to advanced
636 pages
27h 50m
English
By default, Fabric uses LevelDB as storage for the Worldstate. Fabric also offers the option to configure peers to store Worldstate in CouchDB. When assets are stored in the form of JSON documents, CouchDB allows you to perform complex queries for assets based on the asset state.
The queries are formatted in the native CouchDB declarative JSON querying syntax. The current version of this syntax is available at: http://docs.couchdb.org/en/2.1.1/api/database/find.html.
Fabric forwards queries to CouchDB and returns an iterator (StateQueryIteratorInterface()), which can be used to iterate over the result set. The declaration of the state based query function is as follows:
func GetQueryResult(query string) (StateQueryIteratorInterface, ...
Read now
Unlock full access