This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
comment hrmp from configs and add helper script
- Loading branch information
Showing
4 changed files
with
229 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# Helper script to open HRMP channels between Trappist, Stout and Asset Hub. | ||
# This script is meant to be run after the relay chain and parachains are spawned. | ||
|
||
# Change for your bin path | ||
POLKADOT_BIN=~/projects/trappist/bin/polkadot | ||
POLKADOT_PARACHAIN_BIN=~/projects/trappist/bin/polkadot-parachain | ||
|
||
function ensure_binaries() { | ||
echo "*** Checking for required binaries" | ||
if [[ ! -f "$POLKADOT_BIN" ]]; then | ||
echo " Required polkadot binary '$POLKADOT_BIN' does not exist!" | ||
echo " You need to build it and copy to this location!" | ||
exit 1 | ||
fi | ||
if [[ ! -f "$POLKADOT_PARACHAIN_BIN" ]]; then | ||
echo " Required polkadot-parachain binary '$POLKADOT_PARACHAIN_BIN' does not exist!" | ||
echo " You need to build it and copy to this location!" | ||
exit 1 | ||
fi | ||
echo "*** All required binaries are present" | ||
} | ||
|
||
function ensure_polkadot_js_api() { | ||
echo "*** Checking for required polkadot-js-api" | ||
if ! which polkadot-js-api &>/dev/null; then | ||
echo '' | ||
echo 'Required command `polkadot-js-api` not in PATH, please, install, e.g.:' | ||
echo "npm install -g @polkadot/api-cli" | ||
echo " or" | ||
echo "yarn global add @polkadot/api-cli" | ||
echo '' | ||
exit 1 | ||
fi | ||
} | ||
|
||
function open_hrmp_channels() { | ||
local relay_url=$1 | ||
local relay_chain_seed=$2 | ||
local sender_para_id=$3 | ||
local recipient_para_id=$4 | ||
local max_capacity=$5 | ||
local max_message_size=$6 | ||
echo " calling open_hrmp_channels:" | ||
echo " relay_url: ${relay_url}" | ||
echo " relay_chain_seed: ${relay_chain_seed}" | ||
echo " sender_para_id: ${sender_para_id}" | ||
echo " recipient_para_id: ${recipient_para_id}" | ||
echo " max_capacity: ${max_capacity}" | ||
echo " max_message_size: ${max_message_size}" | ||
echo " params:" | ||
echo "--------------------------------------------------" | ||
polkadot-js-api \ | ||
--ws "${relay_url?}" \ | ||
--seed "${relay_chain_seed?}" \ | ||
--sudo \ | ||
tx.hrmp.forceOpenHrmpChannel \ | ||
${sender_para_id} \ | ||
${recipient_para_id} \ | ||
${max_capacity} \ | ||
${max_message_size} | ||
} | ||
|
||
# Check for binaries | ||
ensure_binaries | ||
|
||
# Check for polkadot-js-api cli | ||
ensure_polkadot_js_api | ||
|
||
# HRMP: Trappist - Stout | ||
open_hrmp_channels \ | ||
"ws://127.0.0.1:9900" \ | ||
"//Alice" \ | ||
1836 3000 4 524288 | ||
|
||
# HRMP: Stout - Trappist | ||
open_hrmp_channels \ | ||
"ws://127.0.0.1:9900" \ | ||
"//Alice" \ | ||
3000 1836 4 524288 | ||
|
||
# HRMP: Trappist - Asset Hub | ||
open_hrmp_channels \ | ||
"ws://127.0.0.1:9900" \ | ||
"//Alice" \ | ||
1836 1000 4 524288 | ||
|
||
# HRMP: Asset Hub - Trappist | ||
open_hrmp_channels \ | ||
"ws://127.0.0.1:9900" \ | ||
"//Alice" \ | ||
1000 1836 4 524288 | ||
|
||
# HRMP: Stout - Asset Hub | ||
open_hrmp_channels \ | ||
"ws://127.0.0.1:9900" \ | ||
"//Alice" \ | ||
3000 1000 4 524288 | ||
|
||
# HRMP: Asset Hub - Stout | ||
open_hrmp_channels \ | ||
"ws://127.0.0.1:9900" \ | ||
"//Alice" \ | ||
1000 3000 4 524288 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
[settings] | ||
timeout = 1000 | ||
|
||
[relaychain] | ||
chain = "rococo-local" | ||
default_command = "./bin/polkadot" | ||
# chain_spec_path = "./bin/rococo-local-plain-custom.json" | ||
|
||
[[relaychain.nodes]] | ||
name = "alice" | ||
validator = true | ||
ws_port = 9900 | ||
extra_args = [ "-lparachain=debug" ] | ||
|
||
[[relaychain.nodes]] | ||
name = "bob" | ||
validator = true | ||
extra_args = [ "-lparachain=debug" ] | ||
|
||
[[relaychain.nodes]] | ||
name = "charlie" | ||
validator = true | ||
extra_args = [ "-lparachain=debug" ] | ||
|
||
[[relaychain.nodes]] | ||
name = "dave" | ||
validator = true | ||
extra_args = [ "-lparachain=debug" ] | ||
|
||
[[parachains]] | ||
id = 1836 | ||
add_to_genesis = true | ||
cumulus_based = true | ||
chain = "trappist-local" | ||
|
||
[[parachains.collators]] | ||
name = "trappist-collator01" | ||
command = "./target/release/trappist-node" | ||
ws_port = 9920 | ||
args = ["--log=xcm=trace,pallet-assets=trace"] | ||
|
||
[[parachains.collators]] | ||
name = "trappist-collator02" | ||
command = "./target/release/trappist-node" | ||
ws_port = 9921 | ||
args = ["--log=xcm=trace,pallet-assets=trace"] | ||
|
||
[[parachains]] | ||
id = 3000 | ||
add_to_genesis = true | ||
cumulus_based = true | ||
chain = "stout-local" | ||
|
||
[[parachains.collators]] | ||
name = "stout-collator01" | ||
command = "./target/release/trappist-node" | ||
ws_port = 9930 | ||
args = ["--log=xcm=trace,pallet-assets=trace"] | ||
|
||
[[parachains.collators]] | ||
name = "stout-collator02" | ||
command = "./target/release/trappist-node" | ||
ws_port = 9931 | ||
args = ["--log=xcm=trace,pallet-assets=trace"] | ||
|
||
[types.Header] | ||
number = "u64" | ||
parent_hash = "Hash" | ||
post_state = "Hash" | ||
|
||
# Currently there is a known issue with opening hrmp channels on Zombienete config. | ||
# Use hrmp_helper to open channels instead. | ||
|
||
# [[hrmp_channels]] | ||
# sender = 1836 | ||
# recipient = 3000 | ||
# max_capacity = 8 | ||
# max_message_size = 512 | ||
|
||
# [[hrmp_channels]] | ||
# sender = 3000 | ||
# recipient = 1836 | ||
# max_capacity = 8 | ||
# max_message_size = 512 |