How can I check which hash function is being used to create block hash in hyperledger fabric

240 Views Asked by At

I have to change the default hash function of hyperledger fabric. And to check if my hash function is being used, I need to check which hash function is being used to create a new block in hyperledger fabric.

1

There are 1 best solutions below

0
Gari Singh On

There is a config value for each channel name "HashingAlgorithm" but it cannot currently be modified. It uses SHA256. It is set here: https://github.com/hyperledger/fabric/blob/release-2.1/common/channelconfig/util.go#L82

It is possible to change the hashing algorithm used by clients when signing transactions and used by peers when verifying this transactions. This is done via the bccsp config. If you want to create a custom hash algorithm and are using Fabric 2.0 or later, then you'll need to modify the core peer code and add your own bccsp provider.