Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Polkadot BridgeHub Genesis

Compare
Choose a tag to compare
@bkontur bkontur released this 05 Apr 07:45
1e5ffdb

This release is based on the Parachain Runtimes v9382 release.

The release includes artifacts used to launch new Polkadot BridgeHub parachain (source code).

The Wasm runtime and the genesis head data are used to register the new parachain in the Polkadot network. The chainspec file, which includes both and additional configurations, is used to launch collators.

To verify the artifacts, you need to compile the wasm runtime using the same release tag and run an srtool build:

# from cumulus root directory
git checkout parachains-v9382
srtool build --runtime-dir parachains/runtimes/bridge-hubs/bridge-hub-polkadot --package bridge-hub-polkadot-runtime

...
...

# You should see output like this, which you can use bellow instead `$path_runtime_wasm`
Wasm             : parachains/runtimes/bridge-hubs/bridge-hub-polkadot/target/srtool/release/wbuild/bridge-hub-polkadot-runtime/bridge_hub_polkadot_runtime.compact.compressed.wasm

For the rest you run the following commands from the cloned cumulus repository:

# from cumulus root directory
git checkout parachains-v9382

# translate built by srtool binary wasm runtime into hexadecimal string
cat $path_runtime_wasm | od -A n -v -t x1 | tr  -d ' \n' > $path_runtime_wasm_hex

# upload spec file and place built hex runtime into
cat bridge-hub-polkadot-spec.json \
    | jq --rawfile code $path_runtime_wasm_hex '.genesis.runtime.system.code = ("0x" + $code)' \
    > $path_spec_file

# build command tool to build the raw spec and the head data
cargo build --release -p polkadot-parachain-bin

# build raw spec file
./target/release/polkadot-parachain build-spec --chain $path_spec_file --raw > $path_spec_file_raw

# head data
./target/release/polkadot-parachain export-genesis-state --chain $path_spec_file > $path_head_data

(Note that you will need the od tool that comes natively with any Linux-based system and the jq tool to run the script.)

The resulting files:
$path_runtime_wasm
$path_spec_file
$path_spec_file_raw
$path_head_data
should correspond to the
bridge-hub-polkadot_runtime-v9382.compact.compressed.wasm
bridge-hub-polkadot-spec.json
bridge-hub-polkadot-spec-raw.json
bridge-hub-polkadot-genesis-head-data
files from the release assets.

Bridge-hub-polkadot

🏋️ Runtime Size:		604.35 KB (618855 bytes)
🔥 Core Version:		bridge-hub-polkadot-9382 (bridge-hub-polkadot-0.tx1.au1)
🗜 Compressed:			Yes: 79.07%
🎁 Metadata version:		V14
🗳️ Blake2-256 hash:		0x77300e23702fa538362ed31c691051f9c33711510600d1f024a3bea22c6d676c
📦 IPFS:			QmcdnYrTSv4o5FETdnzf8ksJrkAfn1rN9FqYsG5pXGQeHL