Tools, FAQ, Tutorials:
Verify World State in CouchDB
How to Verify World State in CouchDB container?
✍: FYIcenter.com
Since peer0.org1.example.com uses the couchdb container to
store the world state, you can check the current states
of all assets managed by the chaincode.
1. Get database name for the chaincode "fabcar":
$ curl http://localhost:5984/_all_dbs ["_replicator","_users","mychannel_","mychannel_fabcar","mychannel_lscc"]
2. List all assets (called documents in CouchDB) of "mychannel_fabcar":
$ curl http://localhost:5984/mychannel_fabcar/_all_docs {"total_rows":10,"offset":0,"rows":[ {"id":"CAR0","key":"CAR0","value":{"rev":"2-470e6972dfda1d4e4d5451f351e0a148"}}, {"id":"CAR1","key":"CAR1","value":{"rev":"2-c3dc6200995111fd68a1b31fef101407"}}, {"id":"CAR2","key":"CAR2","value":{"rev":"2-a6152f6417c7806ca9b8cb65df610408"}}, {"id":"CAR3","key":"CAR3","value":{"rev":"2-2284005a15045726607cd868bded26e7"}}, {"id":"CAR4","key":"CAR4","value":{"rev":"2-a76d55af36a1c1d876db82bac10a5193"}}, {"id":"CAR5","key":"CAR5","value":{"rev":"2-34515cfea948a09c67f5fee6fd286ff6"}}, {"id":"CAR6","key":"CAR6","value":{"rev":"2-d52f643d550d6b6b1126c60fa71386c3"}}, {"id":"CAR7","key":"CAR7","value":{"rev":"2-bf0c75774546d03bba5e3ada27be3afe"}}, {"id":"CAR8","key":"CAR8","value":{"rev":"2-a953576d2447d0bc4c6534a0cfc1aeca"}}, {"id":"CAR9","key":"CAR9","value":{"rev":"2-06ab42f3f3274b05144522b717c04e56"}} ]}
3. Get the content of the last asset, CAR9:
$ curl http://localhost:5984/mychannel_fabcar/CAR9 { "_id": "CAR9", "_rev": "2-06ab42f3f3274b05144522b717c04e56", "colour": "brown", "make": "Holden", "model": "Barina", "owner": "Shotaro", "~version": "\u0000CgMBAwA=" }
Â
⇒ Verify Blockchain on the Channel
⇠Interact with "fabcar" Chaincode on CLI
⇑ WYFA (Writing Your First Application)
⇑⇑ Hyperledger Tutorials
2020-02-20, 803👍, 0💬
Popular Posts:
How to use "json-to-xml" Azure API Policy Statement? The "json-to-xml" Policy Statement allows you t...
How to use the Atom Online Validator at w3.org? w3.org feed validation service is provided at http:/...
Where to see resource detailed information of my API Management Service on Azure Portal? Once you ha...
How To Loop through an Array without Using "foreach" in PHP? PHP offers the following functions to a...
How to login to Azure API Management Publisher Dashboard? If you have given access permission to an ...