Skip to content

Commit

Permalink
zombienet setup works with local polkadot node versions above 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chexware committed Apr 16, 2024
1 parent 8072295 commit 6bc2b57
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions scripts/zombienet/basic-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ timeout = 1000

[relaychain]
default_command = "./bin/polkadot"
chain = "kusama-local"
chain = "rococo-local"

[[relaychain.nodes]]
name = "alice"
Expand All @@ -19,7 +19,7 @@ chain = "kusama-local"
id = 1000
add_to_genesis = true
cumulus_based = true
chain = "asset-hub-kusama-local"
chain = "asset-hub-westend-local"

[[parachains.collators]]
name = "asset-hub-collator-1"
Expand Down
2 changes: 1 addition & 1 deletion scripts/zombienet/mnet-metaverse.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cumulus_based = true
id = 1000
add_to_genesis = true
cumulus_based = true
chain = "asset-hub-kusama-local"
chain = "asset-hub-westend-local"

[[parachains.collators]]
name = "asset-hub-collator-1"
Expand Down
24 changes: 15 additions & 9 deletions scripts/zombienet/zombienet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ bin_dir="$root_dir/bin"
working_dir="$(pwd)"

provider=native
zombienet_version=v1.3.99
pdot_branch=mergebase-polkadot-v1.0.0
zombienet_version=v1.3.100
pdot_branch=release-polkadot-v1.5.0
asset_hub_branch=mergebase-cumulus-v1.0.0
polkadot_tmp_dir=/tmp/polkadot
asset_hub_tmp_dir=/tmp/asset_hub
Expand Down Expand Up @@ -60,18 +60,24 @@ build_polkadot() {
return
fi

if [ ! -f "$polkadot_tmp_dir/$pdot_branch/polkadot/target/release/polkadot" ]; then
if [ ! -f "$polkadot_tmp_dir/$pdot_branch/target/release/polkadot" ] || [ ! -f "$polkadot_tmp_dir/$pdot_branch/target/release/polkadot-prepare-worker" ] || [ ! -f "$polkadot_tmp_dir/$pdot_branch/target/release/polkadot-execute-worker" ]; then
echo "::group::Install polkadot."
echo "Cloning polkadot into $polkadot_tmp_dir"
mkdir -p "$polkadot_tmp_dir"
git clone --branch "$pdot_branch" --depth 1 https://github.com/paritytech/polkadot-sdk "$polkadot_tmp_dir/$pdot_branch" || true
if [ ! -f "$polkadot_tmp_dir/$pdot_branch" ]; then
echo "Cloning polkadot into $polkadot_tmp_dir"
mkdir -p "$polkadot_tmp_dir"
git clone --branch "$pdot_branch" --depth 1 https://github.com/paritytech/polkadot-sdk "$polkadot_tmp_dir/$pdot_branch" || true
fi
echo "Building polkadot..."
cargo build --manifest-path "$polkadot_tmp_dir/$pdot_branch/polkadot/Cargo.toml" --features fast-runtime --release --locked
cp "$polkadot_tmp_dir/$pdot_branch/polkadot/target/release/polkadot" "$bin_dir/polkadot"
cargo build --manifest-path "$polkadot_tmp_dir/$pdot_branch/Cargo.toml" --locked --release --features fast-runtime --bin polkadot --bin polkadot-prepare-worker --bin polkadot-execute-worker
cp "$polkadot_tmp_dir/$pdot_branch/target/release/polkadot" "$bin_dir/polkadot"
cp "$polkadot_tmp_dir/$pdot_branch/target/release/polkadot-prepare-worker" "$bin_dir/polkadot-prepare-worker"
cp "$polkadot_tmp_dir/$pdot_branch/target/release/polkadot-execute-worker" "$bin_dir/polkadot-execute-worker"
echo "::endgroup::"
echo "✅ polkadot-$pdot_branch"
else
cp "$polkadot_tmp_dir/$pdot_branch/polkadot/target/release/polkadot" "$bin_dir/polkadot"
cp "$polkadot_tmp_dir/$pdot_branch/target/release/polkadot" "$bin_dir/polkadot"
cp "$polkadot_tmp_dir/$pdot_branch/target/release/polkadot-prepare-worker" "$bin_dir/polkadot-prepare-worker"
cp "$polkadot_tmp_dir/$pdot_branch/target/release/polkadot-execute-worker" "$bin_dir/polkadot-execute-worker"
echo "✅ polkadot-$pdot_branch"
fi
}
Expand Down

0 comments on commit 6bc2b57

Please sign in to comment.