Running a local relaychain network

Below materials are primarily referenced from: https://hackmd.io/@s_iGZLIITG6WjSgnFX0pcg/the-collator-setup-guide

Before setting up a local relaychain network, walk through these materials:

Getting Started

Make sure they are compiled based on the same release version. If you want to connect the parachain to an already running Relay chain you can skip the Polkadot steps.

NOTE: Our polkadot version for the binaries is v1.14.0

  • Build Polkadot:

git clone https://github.com/paritytech/polkadot
cd polkadot
cargo build --release
  • Build Parachain:

git clone https://github.com/paritytech/polkadot-sdk-parachain-template
cd polkadot-sdk-parachain-template
cargo build --release

Generate chainspec, runtime wasm, genesis state

Chainspec

  • Plain:

./target/release/parachain-template-node build-spec --disable-default-bootnode > parachain-chainspec.json

Important: edit the parachain-chainspec.json where necessary. For example; set the correct para-id, protocolid or relay_chain.

The para-id needs to be reserved on the Relay Chain. Check out the "Connect a local Parachain" tutorial and look for the step "Reserve a unique identifier"

  • Raw:

./target/release/parachain-template-node build-spec --chain parachain-chainspec.json --disable-default-bootnode --raw > parachain-chainspec-raw.json

Runtime wasm

Required to register the Parachain on the Relay Chain. The Relay Chain needs the runtime code to validate blocks.

./target/release/parachain-template-node export-genesis-wasm --chain parachain-chainspec-raw.json parachain-wasm

Genesis state

Required to register the Parachain on the Relay Chain. Both the Relay Chain and the Parachain need to start from the same starting state.

./target/release/parachain-template-node export-genesis-state --chain parachain-chainspec-raw.json parachain-genesis-state

Last updated