Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Zombienet refactor #190

Merged
merged 2 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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" ?

Expand Down Expand Up @@ -55,14 +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
Expand All @@ -72,14 +73,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
Expand Down
Binary file added docs/media/trappist-topology.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file removed trappist-topology.png
Binary file not shown.
122 changes: 122 additions & 0 deletions zombienet/full_network.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
[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"]

[[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 = 1836
max_capacity = 8
max_message_size = 512

[[hrmp_channels]]
sender = 1836
recipient = 1000
max_capacity = 8
max_message_size = 512

[[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
92 changes: 92 additions & 0 deletions zombienet/stout_rococo.toml
Original file line number Diff line number Diff line change
@@ -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
80 changes: 80 additions & 0 deletions zombienet/trappist_rococo.toml
Original file line number Diff line number Diff line change
@@ -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