Logion Collator Node
April 26, 2024 ยท View on GitHub
This project contains Logion's collator node and runtime.
Test locally
Prerequisites
Install Zombienet.
Setup
-
If not already done, download polkadot binaries with command
./scripts/download_polkadot.sh -
If not already done, build logion collator with command
cargo build --releaseor download a pre-compiled binary with./scripts/download_logion.sh -
Run
$ZOMBIENET spawn local-zombienet.tomlwhere$ZOMBIENETis the path to the Zombienet binary
JSON chainspec generation
Below, $CHAIN is one of logion, logion-dev, logion-test or local. It is recommended to define the variable before running the commands (export CHAIN=...).
- Generate plain chainspec:
./target/release/logion build-spec --chain $CHAIN --disable-default-bootnode > ./res/$CHAIN.json
- Generate raw chainspec
./target/release/logion build-spec --chain ./res/$CHAIN.json --raw --disable-default-bootnode > ./res/$CHAIN.raw.json
- Generate WASM and genesis state
./target/release/logion export-genesis-wasm --chain ./res/$CHAIN.raw.json > ./bin/$CHAIN-wasm
./target/release/logion export-genesis-state --chain ./res/$CHAIN.raw.json > ./bin/$CHAIN-genesis
Deploy an upgrade
- Build using
srtoolcp rust-toolchain.toml runtime/ ; srtool build --root --package logion-runtime --runtime-dir runtime ; rm runtime/rust-toolchain.toml
parachainSystem.authorizeUpgrade(codeHash, checkVersion)codeHash:BLAKE2_256field of compressed runtime insrtoolbuild outputcheckVersion: Yes
parachainSystem.enactAuthorizedUpgrade(code)code: the compressed runtime produced bysrtool
Try Runtime
try-runtime tool enables the testing of a new runtime against real data.
Test a runtime upgrade
Generally, what's tested here is one or several storage migrations activated by the new runtime or any Polkadot upgrade.
If not yet done, the Substrate Try Runtime CLI must be installed:
cargo install --git https://github.com/paritytech/try-runtime-cli --locked
If not yet done, the runtime has to be built with the try-runtime feature:
cargo build --release --features=try-runtime
It can then be tested by executing the following command:
try-runtime --runtime target/release/wbuild/logion-runtime/logion_runtime.compact.compressed.wasm on-runtime-upgrade live --uri wss://para-rpc01.logion.network:443
This will:
- connect to RPC node
- download current state
- execute the upgrade
- run pallets'
post_upgradehook