Skip to content

How to do runtime upgrade for calamari

AdiosXia edited this page Jul 12, 2021 · 1 revision

How to do runtime upgrade

  1. Compile calamari project.
git clone https://github.com/Manta-Network/Manta.git
cd Manta
git checkout manta-pc \\ now the branch is `add-calamari-runtime`
cargo build --release
  1. use manta-pc-launch to run a manta mini-system. If you want to know more, see https://github.com/Manta-Network/manta-pc-launch.
yarn start calamari.json
  1. Go to calamari runtime crate (Path /Manta/runtime/calamari/src/lib.rs), search the field spec_version: 1, and increase it by 1. Just like this,
...
spec_version: 2,
...

Tips: 4. Now, compile the whole project again. It should go smoothly. When it’s done, find the file (Path: /Manta/target/release/wbuild/calamari-runtime/calamari_runtime.wasm). 5. It’s time to do runtime upgrade.

  • Checkout current spec version, it’s 1.

  • Let’s do it. Follow the figure to fill dialog in Developer/Sudo. And this call will be dispatched when relaychain is recieved the upgrade data and ready. It maybe spend some times. You will see the ready icon rotate for a while.

Tips: Pay attention: You need to start unchecked weight for this call. Wasm file is big. Also it would be better if you open the console of browser, some info will be pop up, and going to tell you what changes in this new runtime.

Runtime upgrade happens in the next block on parachain. You can see it in your block explorer.

This means that the runtime upgrade is ready. parachainSystem.ValidationFunctionStored means that the validationfunction data will be stored at this relaychain block. It will be change when relaychain is busy.

  • Runtime upgrade will be happened when validation function applied on relaychain. You will see this on parachain block explorer.

Waiting a moment and refresh the browser, you will see it: