dongzouh51192 2017-03-01 16:04
浏览 65

如何在Hyperledger编程中使用stub.CreateTable

A chaincode based on Hyperledger uses stub.PutState and stub.GetState to interact with the data base. However, if I have a struct with more than one attibutes, for example :

person { "ID": "123", "firstname":"joe", "lastname":"doe", "age":"34", }

Then if I want to update the age, what arguments should I send to the method ?

I noticed that there is stub.CreateTable method which seems to be more convenient for my case, however, I couldn't find any document or explication about how to use this method. Would you please give me a link to the document or some brief explication please ?

Thanks.

  • 写回答

3条回答 默认 最新

  • doumu8911 2017-03-02 01:52
    关注

    You can not change anything on the ledger.The only way you can update the person infomation is insert a new line to cover the old.

    评论

报告相同问题?