Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data migration script to copy data to updated contracts #13

Open
bumi opened this issue Jun 18, 2017 · 5 comments
Open

Data migration script to copy data to updated contracts #13

bumi opened this issue Jun 18, 2017 · 5 comments

Comments

@bumi
Copy link
Contributor

bumi commented Jun 18, 2017

As contracts are immutable but we want to iterate developing our contracts we need a method to migrate data from the "old" contract to a newly deployed contract. This will be useful in the current experimental stage.
A simple and quick solution could be a script like the seed.js script that reads data from the old contract and populates the new contract.

In the future we need to get rid of such a centralized, off-chain script but for now this would be a quick solution.

@bumi
Copy link
Contributor Author

bumi commented Jun 18, 2017

I think the embark-framework has some kind of "migrations". I am not sure what it exactly does but the name suggest that it might be worth looking into it.

@raucao
Copy link
Member

raucao commented Jun 18, 2017

Wouldn't it be easier to just implement the splitting out of the data to super simple contracts, that we don't have to change anymore? Our actual data now mostly lives in IPFS anyway, so for our current problem of losing e.g. contributors, I think that specific contract could be simple enough, so we don't have to migrate data after publishing it. But maybe I'm missing sth.

@bumi
Copy link
Contributor Author

bumi commented Jun 19, 2017

yeah that would be the overall goal.
But I still would think it would be a good idea to somehow have the chance to for example get the contributor IPFS hashes into a possible new contract.

@raucao
Copy link
Member

raucao commented Jun 20, 2017

Yes, probably. I'm just trying to figure out if it makes sense to spend the time on that script instead of on splitting out the data, so it's better from the start, with the same effort, and we don't have planned manual migrations by design.

@bumi
Copy link
Contributor Author

bumi commented Jun 21, 2017

I had experimented with this seed script that basically consumes a JSON and calls methods on the contract.
If the contract supports that (for example: that the owner is allowed to set certain data) not much would be missing to copy some data.
but I agree that this is not the goal and not what we want. - more hack until we're there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants