paritytech / xcm-docs

Documentation for XCM
12 stars 4 forks source link

META: Tutorials and Examples #34

Open vstam1 opened 1 year ago

vstam1 commented 1 year ago

Based on community feedback, it has become evident that there is a need for examples and tutorials for XCM. The existing documentation provides a solid foundation, but developers would greatly benefit from practical implementation guidance and code snippets (cookbook) to better understand and utilize XCM in their projects.

Furthermore, there is a specific request for examples focusing on the configuration of the xcm-executor. It would be highly beneficial to provide clear examples demonstrating the various configurations and options available for xcm-executor.

Additionally, together with the Trappist team we decided to create the examples using Trappist (https://github.com/paritytech/trappist) as the framework. Trappist is widely used as an example within the community and would be an excellent choice for showcasing XCM integration in real-world scenarios.

### Examples/Tutorials
- [ ] Integrate native token on the Asset Hub.
- [ ] Configure nfts pallet for derivative non-fungible assets.
- [ ] Showcase how to do cross chain transactions (Teleport and Reserve) and how to manage the Fee payment.
- [ ] Showcase use of ExchangeAsset with dex pallet (https://github.com/paritytech/trappist/issues/47)
- [ ] Show how to practically make use of Transact
hbulgarini commented 1 year ago

During sub0 2022, we presented with @stiiifff a complex use case that includes most of the items described above. Here is the presentation: https://www.youtube.com/watch?v=1eJwzbtqZYs The presentation rely on a use case based on real world assets (RWA) and a borrow and lending protocol from those RWA (represented as NFT).

The topology of the workshop was:

The sequence for the workshop was:

The code can be found here: https://github.com/paritytech/trappist/blob/sub0_2022 It can be considered as a reference but not definitely as a starting point since some things has changed/improved in XCM v3 from that time and also i cut some corners due to time constraints that need to be addressed. This for example:

https://github.com/paritytech/trappist/blob/sub0_2022/runtime/trappist/src/xcm_config.rs#L73:L91