Closed NicolasMahe closed 4 years ago
I think the export/import should stay as close as possible to the database we use. Here we are losing the key on all export. We usually use the hash but we might change to the address or anything. We shouldn't loose this information. I would recommend to switch to a map instead of array or an array of key/value
I think the export/import should stay as close as possible to the database we use. Here we are losing the key on all export. We usually use the hash but we might change to the address or anything. We shouldn't loose this information. I would recommend to switch to a map instead of array or an array of key/value
As you say, the keys are the hash. If the data didn't contain keys, then a map can be implemented, but it's not the case. Each module can have its own export and import function, so there is no need to implement exactly the same logic everywhere.
Now the genesis contains empty array instead of null. Before:
{"instances":null}
After:
{"instances":[]}
Closes https://github.com/mesg-foundation/engine/issues/1847
This PR implements the import and export functions in modules.
To export, use the command:
To import, copy the output of previous command in the genesis.json file of a new node that doesn't have any database, start the node, and see the data are present.