Storing data on Multichain

+1 vote
I want to store user information in blockchain as transaction and if user update that information then a transaction should be created for updated data.

means transaction syntax will be:

1 Transaction type: (New / Update)

2 Key of last transaction by this user

3 No of attributes added or updated

4 updated attributes in key value pair

 

So how can I do this?
asked Jun 9, 2017 by Tarun

1 Answer

0 votes
 
Best answer

I think your best bet is to use streams, and for the "user" to be identified by the publisher of the stream item, assuming that you've set each user up to have their own address/identity on the blockchain. Each stream item is a serialized JSON object containing a set of key/value attributes. Then you can use liststreampublisheritems to retrieve all items by a particular user, and apply logic at the application level to build up the last version. (Future versions of MultiChain will take care of a lot of this for you.)

answered Jun 9, 2017 by MultiChain
selected Jun 9, 2017 by Tarun
I think I got my answer. Thanks for your help :)
...