📔
Liberland Wiki
  • 📖Public Documents
  • 👍Primers
    • 🙋‍♀️Congress
    • 💂Executive
    • 👨‍⚖️Judiciary
    • 🤴Senate
  • 🚦Regulations
    • ✍️Drafts
      • 👮Internal Regulation of the Security Commission on the Structural and Functional Organization of the
    • 👩‍⚖️In Force
      • 🏰Orders
        • 👨Order of the President of Liberland no. 1/2021, on the Decisions of the Cabinet.
        • 👩Order of the President of Liberland no. 2/2021, on the Interim Legislature
  • ✅Policies
    • 🧑‍⚖️In Force
      • ⚖️Justice
        • 🔏Privacy policy
  • 👨‍💻Blockchain
    • 💫White Paper
    • 👨Tokenomics Primer
    • 💫Roadmap
    • 👨API
      • ⌨️Chain Explorer API
      • For CEXes
    • 🌐Ecosystem
      • 🌉How to Bridge to Ethereum
      • 🌉How to Bridge to Solana
      • How to Bridge to TRON
      • 🔁Liberland Exchange
      • How to Acquire LLD
      • How to Use Polkadot.js
      • How to use SubWallet
      • How to use Talisman
      • Known Issues
    • 🪪For Citizens and E-Residents
      • 🗳️Voting
      • Senate
      • Onboarding
      • Claiming Residency
      • Congress
      • Governance
      • Companies
    • 🖥️For Validators, Nominators & Stakers
      • Run a validator
      • Non-technical run a validator
      • Staking
      • ETH Liquidity Staking
      • SOL Liquidity Staking
      • Update node
      • Resync node
    • For Developers & Testers
      • Build, run & test using source code
      • Run in Docker
      • Manual testing guide
      • Runtime upgrade
      • Rust API docs
      • Bootstrapping new testnet
      • Chain Crash Recovery Procedure
  • Media
    • Press Kit
Powered by GitBook
On this page
  • How to upgrade the chain
  • Step 1
  • Step 2
  • Step 3
  • Step 4
  • Step 5
  • Step 6
  • Links:
  1. Blockchain
  2. For Developers & Testers

Runtime upgrade

How to upgrade the chain

Prerequirements: Read substrate official documentation Read about webassembly and utilize "subwasm" Watch Alex's runtime migrations video: https://www.youtube.com/watch?v=MQgDV37JrIY Read about runtime migrations: https://github.com/apopiak/substrate-migrations

Step 1

Add your changes to the code repository and make sure your pallets are included in the runtime. Increment the spec_version by adding +1.

Compile your node

Step 2

Go over modifed changes made to the storage and apply storage migrations to convert the old types to the new once in the on_runtime_upgrade function

Note: Failing to migrate important storage changes will have a negative effect on the chain Note: use logging to display what migrations kicked in

Step 3

Verify that the compiled wasm file looks good with subwasm and srtool(https://github.com/paritytech/srtool).

Step 4

Compile the node locally and use the current spec_version that is deployed on chain(check polkadot.js for last upgrade in chainstate) Push the runtime upgrade either with as Sudo Call or as a democracy vote on your local instance. If all is well and the pallet's interact good after the upgrade, go ahead to the next step

Step 5

Prep a release page for the node with the output from srtool and the hashes of the binary files, upload the wasm file aswell to the releases page.

Step 6

Push the upgrade on-chain

Links:

https://develop--substrate-docs.netlify.app/how-to-guides/v3/storage-migrations/basics/ https://docs.substrate.io/build/runtime-storage/ https://docs.substrate.io/build/upgrade-the-runtime/

PreviousManual testing guideNextRust API docs

Last updated 2 years ago

👨‍💻