Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

[New Tutorial] Advanced Runtime Upgrade + Storage Migration #766

Closed
danforbes opened this issue Oct 30, 2020 · 3 comments
Closed

[New Tutorial] Advanced Runtime Upgrade + Storage Migration #766

danforbes opened this issue Oct 30, 2020 · 3 comments
Assignees

Comments

@danforbes
Copy link
Contributor

Create a new tutorial or add a new section to the existing tutorial on runtime upgrades. The new material should demonstrate the details of storage migrations as well as strategies for testing them.

Relates to #580 and #750.

@apopiak
Copy link
Contributor

apopiak commented Nov 3, 2020

Minimum steps:

  1. run original node template
  2. change Something get(fn something): Option<u32>; storage to store SomeStruct (and define SomeStruct).
  3. add storage migration function like here except putting it in a separate migration module and migrate_to_struct function. (might be missing some logging)
  4. compile the new runtime and perform an upgrade

@apopiak
Copy link
Contributor

apopiak commented Nov 3, 2020

We could also think about introducing tests. Like a unit test for the migration function. And/Or an integration test via Halva or the substrate-test-runner.

@nuke-web3
Copy link
Contributor

Closing in favor of #939 to consolidate issues here.

With respect to unit tests, we may be able to solve #638 with this one as well...?

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

Successfully merging a pull request may close this issue.

3 participants