0

I ran the Test Network example from Hyperledger Fabric Sample and I update the config to use CouchDB.

My goal it's to find a way to catch the peer who try to tamper data.

I tampered CAR4 from the CouchDB UI (peer0 from Org1):

{
  "_id": "CAR4",
  "_rev": "13-4da33a0904fed5919e0bf094a93f2fd9",
  "colour": "black",
  "make": "Tesla",
  "model": "S",
  "owner": "some illegal update",
  "~version": "CgMBDwA="
}

And I ran the following command (peer0 from Org2):

peer chaincode ... '{"function":"changeCarOwner","Args":["CAR4","some valid update"]}'

From the peer0.org2 I got :

2020-02-07 12:39:52.026 UTC [endorser] callChaincode -> INFO 0b6 finished chaincode: fabcar duration: 1ms channel=mychannel txID=b17c59e4
2020-02-07 12:39:52.026 UTC [comm.grpc.server] 1 -> INFO 0b7 unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.25.0.1:52132 grpc.code=OK grpc.call_duration=2.25757ms
2020-02-07 12:39:54.039 UTC [gossip.privdata] StoreBlock -> INFO 0b8 [mychannel] Received block [16] from buffer
2020-02-07 12:39:54.042 UTC [committer.txvalidator] Validate -> INFO 0b9 [mychannel] Validated block [16] in 2ms
2020-02-07 12:39:54.042 UTC [gossip.privdata] prepareBlockPvtdata -> INFO 0ba Successfully fetched all eligible collection private write sets for block [16] channel=mychannel
2020-02-07 12:39:54.057 UTC [statecouchdb] commitUpdates -> WARN 0bb CouchDB batch document update encountered an problem. Reason:Document update conflict., Retrying update for document ID:CAR4
2020-02-07 12:39:54.071 UTC [kvledger] CommitLegacy -> INFO 0bc [mychannel] Committed block [16] with 1 transaction(s) in 28ms (state_validation=0ms block_and_pvtdata_commit=8ms state_commit=17ms) commitHash=[a8fe8cc2e91f74e315b6c0aa4343aa41ee73bc891552658b11b91b08c5f5df2c]

We can see that wrong with CAR4 :

2020-02-07 12:39:54.057 UTC [statecouchdb] commitUpdates -> WARN 0bb CouchDB batch document update encountered an problem. Reason:Document update conflict., Retrying update for document ID:CAR4

Of course after the valid transaction the document CAR4 from peer0.org1 is "rollback" and get the new value on both peer0 from each org1/2

But... Is there a way to catch the peer who try to tamper the data ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.