Skip to content
This repository was archived by the owner on May 21, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Backport Zombienet and CI testing (#194)
* zombienet refactor and ci fix

* swap-storage removed from CI

* ci fix

* CI fix

---------

Co-authored-by: Valentin Fernandez <[email protected]>
  • Loading branch information
valentinfernandez1 and Valentin Fernandez authored May 26, 2023
commit 7ee241539b51d410028543e67d486c45ff6301fd
27 changes: 16 additions & 11 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,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

Expand All @@ -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.

Expand All @@ -99,5 +105,4 @@ cd xcm-simulator && cargo test --release tests::; cd ..
```

## License

Trappist is licensed under [Apache 2](LICENSE).
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.
Binary file added docs/media/xcm-use-cases.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions xcm-playground.toml → zombienet/full_network.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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