diff --git a/README.md b/README.md index 8d4fb80a..d5e21c8f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Altogether those technologies enable an array of exciting cross-chain applications & services: -![XCM use cases](xcm-use-cases.png) +![XCM use cases](/docs/media/xcm-use-cases.png) This repository contains the source code of **Trappist**, a feature-rich parachain for exploring and learning about cross-chain applications and services, along with a script to run a complete local multi-chain environment that includes: @@ -25,7 +25,7 @@ This repository contains the source code of **Trappist**, a feature-rich paracha All these pre-configured to allow cross-chain communication via XCM messages on HRMP channels. -![Trappist topology](trappist-topology.png) +![Trappist topology](/docs/media/trappist-topology.png) ### Why "Trappist" ? @@ -55,15 +55,15 @@ First, complete the [basic Rust setup instructions](./docs/rust-setup.md). Use the following command to build the Trappist collator binary: -``` +```bash cargo b -r --features with-trappist-runtime cargo b -r --no-default-features --features with-stout-runtime --target-dir target_stout - ``` -Alternatively, run -`bash ./scripts/build_runtimes.sh` . - +Alternatively, run: +```bash +./scripts/build_runtimes.sh +``` ### XCM Playground via Zombienet @@ -72,16 +72,22 @@ Create a `bin` directory into the root of this repository and place the followin - `polkadot-parachain` (which you will build from [cumulus](https://github.com/paritytech/cumulus)) Download the [latest release of zombienet](https://github.com/paritytech/zombienet/releases/) into the root of this repository and make it executable: -``` +```bash $ chmod +x zombienet-linux # OR $ chmod +x zombienet-macos ``` Then, start the **Trappist** playground with: +```bash +./zombienet-linux -p native spawn ./zombienet/trappist_rococo.toml ``` -./zombienet-linux -p native spawn xcm-playground.toml +You can also run: +```bash +# To start Trappist and Stout together +./zombienet-linux -p native spawn ./zombienet/full_network.toml +# To only run stout +./zombienet-linux -p native spawn ./zombienet/stout_rococo.toml ``` - ### Integration Tests [parachains-integration-tests](https://github.com/paritytech/parachains-integration-tests) is a tool meant for XCM message execution in a locally spawned network. Tests are written as YAML files and converted into [Mocha](https://mochajs.org/) tests with [Chai](https://www.chaijs.com/) assertions. @@ -99,5 +105,4 @@ cd xcm-simulator && cargo test --release tests::; cd .. ``` ## License - Trappist is licensed under [Apache 2](LICENSE). diff --git a/docs/media/trappist-topology.png b/docs/media/trappist-topology.png new file mode 100644 index 00000000..f94dc7d3 Binary files /dev/null and b/docs/media/trappist-topology.png differ diff --git a/docs/media/xcm-use-cases.png b/docs/media/xcm-use-cases.png new file mode 100644 index 00000000..a1e17d37 Binary files /dev/null and b/docs/media/xcm-use-cases.png differ diff --git a/xcm-playground.toml b/zombienet/full_network.toml similarity index 95% rename from xcm-playground.toml rename to zombienet/full_network.toml index 8da6cd97..d2f26c16 100644 --- a/xcm-playground.toml +++ b/zombienet/full_network.toml @@ -21,6 +21,11 @@ default_command = "./bin/polkadot" validator = true extra_args = [ "-lparachain=debug" ] + [[relaychain.nodes]] + name = "dave" + validator = true + extra_args = [ "-lparachain=debug" ] + [[parachains]] id = 1000 add_to_genesis = true diff --git a/zombienet/stout_rococo.toml b/zombienet/stout_rococo.toml new file mode 100644 index 00000000..ab2d81db --- /dev/null +++ b/zombienet/stout_rococo.toml @@ -0,0 +1,92 @@ +[settings] +timeout = 1000 + +[relaychain] +chain = "rococo-local" +default_command = "./bin/polkadot" + + [[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 = 1000 +add_to_genesis = true +cumulus_based = true +chain = "statemine-local" + + [[parachains.collators]] + name = "statemine-collator01" + command = "./bin/polkadot-parachain" + ws_port = 9910 + args = ["--log=xcm=trace,pallet-assets=trace"] + + [[parachains.collators]] + name = "statemine-collator02" + command = "./bin/polkadot-parachain" + ws_port = 9911 + 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_stout/release/stout-collator" + ws_port = 9930 + args = ["--log=xcm=trace,pallet-assets=trace"] + + [[parachains.collators]] + name = "stout-collator02" + command = "./target_stout/release/stout-collator" + ws_port = 9931 + args = ["--log=xcm=trace,pallet-assets=trace"] + +[types.Header] +number = "u64" +parent_hash = "Hash" +post_state = "Hash" + +[[hrmp_channels]] +sender = 1000 +recipient = 3000 +max_capacity = 8 +max_message_size = 512 + +[[hrmp_channels]] +sender = 3000 +recipient = 1000 +max_capacity = 8 +max_message_size = 512 + +[[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 \ No newline at end of file diff --git a/zombienet/trappist_rococo.toml b/zombienet/trappist_rococo.toml new file mode 100644 index 00000000..088a8c45 --- /dev/null +++ b/zombienet/trappist_rococo.toml @@ -0,0 +1,80 @@ +[settings] +timeout = 1000 + +[relaychain] +chain = "rococo-local" +default_command = "./bin/polkadot" + + [[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 = 1000 +add_to_genesis = true +cumulus_based = true +chain = "statemine-local" + + [[parachains.collators]] + name = "statemine-collator01" + command = "./bin/polkadot-parachain" + ws_port = 9910 + args = ["--log=xcm=trace,pallet-assets=trace"] + + [[parachains.collators]] + name = "statemine-collator02" + command = "./bin/polkadot-parachain" + ws_port = 9911 + args = ["--log=xcm=trace,pallet-assets=trace"] + +[[parachains]] +id = 1836 +add_to_genesis = true +cumulus_based = true +chain = "trappist-local" + + [[parachains.collators]] + name = "trappist-collator01" + command = "./target/release/trappist-collator" + ws_port = 9920 + args = ["--log=xcm=trace,pallet-assets=trace"] + + [[parachains.collators]] + name = "trappist-collator02" + command = "./target/release/trappist-collator" + ws_port = 9921 + args = ["--log=xcm=trace,pallet-assets=trace"] + +[types.Header] +number = "u64" +parent_hash = "Hash" +post_state = "Hash" + +[[hrmp_channels]] +sender = 1000 +recipient = 1836 +max_capacity = 8 +max_message_size = 512 + +[[hrmp_channels]] +sender = 1836 +recipient = 1000 +max_capacity = 8 +max_message_size = 512 \ No newline at end of file