I need to implement composite keys in hyperledger so that I could have a unique key based on the attributes put into the ledger. The function CreateCompositeKey(object
CreateCompositeKey(object
In Hyperledger Fabric there is an example chaincode which shows how to use composite keys, check it out: Marbles
Basically it almost as you said:
key, err := stub.CreateCompositeKey(index, []string{key1, key2, key3}) // Skiped stub.PutState(key, value)