How to verify that a state in the couchdb matches a transaction in the blockchain? #fabric-sdk-node #database #fabric-questions


stpcmferiwbtnundnx@...
 

In case of disputes, we need to provide assurance to our client that items in the couchdb are not manipulated and thus backed by transactions in the blockchain, which is secure and trusted by both parties.

I've tried using the following command then decoding the output to JSON using configtxlator:
> peer channel fetch newest mychannel-newest.block -c mychannel --orderer orderer.example.com:17116
However, even in JSON format, the values are still not easily readable (as they are hashed/encrypted) or linkable to the records in the db.
Sample transaction data in the block:
"writes": [{
"is_delete": false,
"key": "\u0000org.productlist\u0000\"123456789\"\u0000",
"value": "eyJjbGFzcyI6ImFpcGF5LnBheW1lbnQiLCJrZXkiOiJcIjAwMDRfd29ya3N0YXRpb25vd25lcl9qb2huZG9lXCIiLCJjdXJyZW50U3RhdGUiOm51bGwsInBheW1lbnRJZCI6IjAwMDRfd29ya3N0YXRpb25vd25lcl9qb2huZG9lIiwic2VuZGVySWQiOiJhaXByb3MiLCJyZWNpcGllbnRJZCI6ImpvaG5kb2UiLCJwYXltZW50RGV0YWlscyI6eyJpZCI6IjAwMDRfd29ya3N0YXRpb25vd25lcl9qb2huZG9lIiwiYmFsYW5jZV90cmFuc2FjdGlvbnMiOlt7Im5ldCI6MTUwfV19fQ=="
}]

So is it possible to verify, preferrably via a Node.js API, that a state in the world state db matches a transaction in a block? If so, how?

Note: I'm using fabric-contract-api v2.1.2 and fabric-network v1.4 (although I'm planning to migrate to v2.x)

Join fabric@lists.hyperledger.org to automatically receive all group messages.