TU-ADSP / Blockchain-Logging-Framework

This framework provides advanced querying and logging capabilities for Ethereum and Hyperledger blockchains.
Other
7 stars 5 forks source link

Blockhash and Transactionhash in Hyperledger extraction are not correct #136

Closed rohrschacht closed 3 years ago

rohrschacht commented 3 years ago

The extracted block.hash in Hyperledger is not the correct value. blockevent.hashCode() is an inherited function from Java Object, not provided by the Hyperledger fabric sdk. As a result, the block.hash that is logged to the output file is always different and does not represent the hash of the actual block.

The correct way to access a block hash is blockevent.getDataHash() and convert the byte array into a hex string.

Also, in Hyperledger, transactions do not seem to have their own hash.