In case you want to JSON Chainspecs for either or both the KILT parachain as well as the Polkadot relay chain, please put them into the specs directory. This folder will be mounted into a volume inside the KILT docker image.
- In the
.env
- Select the KILT image and the corresponding spec.
- The runtime should always be
peregrine
orspiritnet
because otherwise you would run instandalone
which does neither require nor work with the parachain setup.
KILT_IMG=kiltprotocol/kilt-node:develop KILT_RAW_SPEC_FILE=spiritnet-dev KILT_RUNTIME=spiritnet
- Select the Polkadot image to run.
- Typically, this should be the latest image. Please note that if you bump the version number, you might need to build a relay spec.
RELAY_IMG=parity/polkadot:v0.9.13 RELAY_RAW_SPEC_FILE=rococo-0.9.13.raw.json RELAY_CHAIN_SPEC=/data/spec/${RELAY_RAW_SPEC_FILE}
- If you have made adjustments to the parachain id, please change it.
- Typically, this should be
2000
. - If you are unsure, go to step 2 and check the parachain id in the logs or the Polkadot Apps at Developer > Chain State > parachainInfo::parachainId.
- You might have to manually re-build the
registerParachain
script in case you have built it before with the incorrect parachain ID.
PARA_ID=2000 RELAY_SUDO_KEY="//Alice"
- Execute the
run.sh
script.
- It uses the docker compose CLI aka
docker compose
notdocker-compose
. - The genesis state and WASM are updated after running
run.sh
and can be found in specs/kilt.wasm or specs/kilt-genesis.hex. - It will set up 3 relay chain validator and 2 parachain collators nodes, register the parachain as a parathread, upgrade it to a parachain and increase its parachain duration (leases) to more than a year.
Once you are done, you can stop all containers by executing the kill.sh
script.
When bumping the version number of the Polkadot relay chain image, chances are high that you need to create as new chain spec for the relay chain. Depending on the chain spec for the KILT collator, you either need to do this in the Polkadot or the kilt-node repo. We recommend to stick with a dev spec for simplicity.
After building the spec, please move it inside the specs directory which will be mounted inside the KILT docker image.
If you are running the KILT collators in dev spec (--runtime=spiritnet --chain=spiritnet-dev
or --runtime=peregrine --chain=dev
), you need to build a new rococo-local spec inside the Polkadot repo
cargo run --release -- build-spec --chain=rococo-local --disable-default-bootnode --raw > rococo-${POLKADOT_VERSION}.raw.json
We do not recommend running the collators with a KILT spec of our live collators because the pre-compiled genesis specs are basically outdated by now, e.g. you might encounter issues when running the relay chain on the most recent client with an old chain spec. Same holds true for the collators because the corresponding KILT runtime has received multiple runtime upgrades since go-live.
If you still want to proceed, have a look here.
The node keys can be found in keys. We recommend to use the default session keys of Alice, Bob, Charlie for your collators because else you have to configure those as well.
The following steps are only required if the registerParachain
scripts fails or if you want to add another parachain as well:
- Register the parachain
- With Sudo: Sudo > registrar > forceRegister > Submit Sudo
- Without Sudo: Register the parachain in the Polkadot Apps: Network > Parachains > Parathreads ->
+ Register
.
- Increase parachain Duration: Sudo > slots::forceLease