user9040429
user9040429

Reputation: 720

Save data while updating model file in hyperledger composer

One thing I noticed while coding in hyperledger composer, that everytime I enter an extra field in a participant the data entered previously is gone. But addition of fields can happen in day to day software development, so how can I save my data while updating the model file in composer.

Upvotes: 1

Views: 398

Answers (1)

Paul O'Mahony
Paul O'Mahony

Reputation: 6740

Do you mean Composer Playground? If so, it is exactly that - a playground...

You can see this for yourself - if you add new fields to an asset (then update the business network) you created, you can no longer see the data. If you remove the field from the model (and, again, update the business network)- you will see the data again. If you add a new field with 'optional' then you can change the model and still see data you had earlier created.

In any case, suggest a mechanism for importing/exporting data that you may wish to use for your models. Would recommend Node-Red - it has Composer nodes such as the Node-Red Composer-mid node - which allows you to save as JSON objects (on disk etc) which you can later amend (to suit the later edition model) and also a Composer-out node, to inject the data back in to the ledger so you can interact with the data in the updated business network.

See https://hyperledger.github.io/composer/integrating/node-red.

Upvotes: 2

Related Questions