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
2020-02-20, 1168🔥, 0💬
Popular Posts:
What Is HTML? HTML (HyperText Markup Language) is the standard markup language for creating Web page...
Why I am getting "The Windows SDK version 8.1 was not found" error, when building my C++ application...
Where to see some Examples of Invalid JSON Values? Here are some Examples of Invalid JSON Values: 1....
How To Get the Minimum or Maximum Value of an Array in PHP? If you want to get the minimum or maximu...
Can Multiple Paragraphs Be Included in a List Item? Yes. You can include multiple paragraphs in a si...