Composite Key functions in Hyperledger

前端 未结 3 1662
梦如初夏
梦如初夏 2021-01-15 01:02

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

3条回答
  •  逝去的感伤
    2021-01-15 01:42

    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)
    

提交回复
热议问题