registering assets with ID


FemGeek
 

Hello, I would like to know how assets or records listed in the chaincode are provided with IDs.  Do I provide ID from the data or does HLF registers each asset or record with an ID for the network?


Sam Venzi
 

Hi FemGeek,

The ID (key) to register the asset is provided by you, the developer, when calling PutState. PutState receives a key and value. If you choose, you may assemble this key (deterministically) from asset data as you please, you may even use the transaction ID, but it’s ultimately provided by you.

Best,

Samuel Venzi
CTO @ GoLedger


On 2 Aug 2022 11:32 -0300, FemGeek <femgeek.massey@...>, wrote:
Hello, I would like to know how assets or records listed in the chaincode are provided with IDs.  Do I provide ID from the data or does HLF registers each asset or record with an ID for the network?