Skip to content

Commit

Permalink
[FIX] - Adding references to tutorials (#230)
Browse files Browse the repository at this point in the history
* fix: adding reference to tutorials on asset hub page

* Add xcm channels

* Add runtime upgrades

* Add chain spec

* Add custom parachains

* fix: adding chopsticks

* fix: zombienet

* Update develop/parachains/get-started/build-custom-parachains.md

Co-authored-by: Nicolás Hussein <[email protected]>

* fix: xcm channels references

* fix: generate chain specs references

* fix: generate chain specs 'where to go next'

* fix: build custom parachains references

* fix: runtime upgrades references

* fix: chopsticks get started references

* fix: zombienet get started references

* fix: asset hub references

* fix: add existing pallets references

* fix: add smart contract funcionality references

* fix: make custom pallet references

* fix: pallet testing references

* fix: generate chain specs references

* fix: adding comment in build custom parachains

* fix: deploy parachain to polkadot references

* fix: setup references

* fix: consensus get started references removed

* fix: architecture parachains references

---------

Co-authored-by: 0xLucca <[email protected]>
Co-authored-by: 0xLucca <[email protected]>
  • Loading branch information
3 people committed Dec 12, 2024
1 parent 4bb3fd1 commit d5ac8cc
Show file tree
Hide file tree
Showing 15 changed files with 313 additions and 22 deletions.
21 changes: 19 additions & 2 deletions develop/interoperability/xcm-channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,22 @@ Parachain developers have a few options for triggering the required extrinsic ca

Explore the following tutorials for detailed, step-by-step guidance on setting up cross-chain communication channels in Polkadot:

- [Opening HRMP Channels Between Parachains](/tutorials/interoperability/xcm-channels/para-to-para/)
- [Opening HRMP Channels with System Parachains](/tutorials/interoperability/xcm-channels/para-to-system/)
<div class="grid cards" markdown>

- <span class="badge tutorial">Tutorial</span> __Opening HRMP Channels Between Parachains__

---

Learn how to open HRMP channels between parachains on Polkadot. Discover the step-by-step process for establishing uni- and bidirectional communication.

[:octicons-arrow-right-24: Reference](/tutorials/interoperability/xcm-channels/para-to-para/)

- <span class="badge tutorial">Tutorial</span> __Opening HRMP Channels with System Parachains__

---

Learn how to open HRMP channels with Polkadot system parachains. Discover the process for establishing bi-directional communication using a single XCM message.

[:octicons-arrow-right-24: Reference](/tutorials/interoperability/xcm-channels/para-to-system/)

</div>
21 changes: 19 additions & 2 deletions develop/parachains/customize-parachain/add-existing-pallets.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,22 @@ Finally, to compose the runtime, update the list of pallets in the same file by

With the pallet successfully added and configured, the runtime is ready to be compiled and used. Following this guides steps, youve integrated a new pallet into the runtime, set up its dependencies, and ensured proper configuration. You can now proceed to any of the following points:

- Dive deeper by [creating your custom pallet](/develop/parachains/customize-parachain/make-custom-pallet/) to expand the functionality of your blockchain
- Ensure robustness with [Pallet Testing](/develop/parachains/customize-parachain/pallet-testing/) to verify the accuracy and behavior of your code
<div class="grid cards" markdown>

- <span class="badge guide">Guide</span> __Make a Custom Pallet__

---

Learn how to create custom pallets using FRAME, allowing for flexible, modular, and scalable blockchain development. Follow the step-by-step guide.

[:octicons-arrow-right-24: Reference](/develop/parachains/customize-parachain/make-custom-pallet/)

- <span class="badge guide">Guide</span> __Pallet Testing__

---

Learn how to efficiently test pallets in the Polkadot SDK, ensuring the reliability and security of your pallets operations.

[:octicons-arrow-right-24: Reference](/develop/parachains/customize-parachain/pallet-testing/)

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,30 @@ For a real-world example of how this pallet is implemented in production, you ca

Now that you understand how to enable smart contract functionality in your blockchain, you might want to:

- Take a step back and learn more about EVM and Wasm contracts by visiting the [Smart Contracts](/develop/smart-contracts/overview) guide
- Start building with [Wasm (ink!) contracts](/develop/smart-contracts/wasm-ink/)
- Start building with [EVM contracts](/develop/smart-contracts/evm/)
<div class="grid cards" markdown>

- <span class="badge guide">Guide</span> __Smart Contracts Overview__

---

Learn how developers can build smart contracts on Polkadot by leveraging either Wasm/ink! or EVM contracts across many parachains.

[:octicons-arrow-right-24: Reference](/develop/smart-contracts/overview/)

- <span class="badge guide">Guide</span> __Wasm (ink!) Contracts__

---

Learn to build Wasm smart contracts with ink!, a Rust-based eDSL. Explore installation, contract structure, and key features.

[:octicons-arrow-right-24: Reference](/develop/smart-contracts/wasm-ink/)

- <span class="badge guide">Guide</span> __EVM Contracts__

---

Learn how Polkadot parachains such as Moonbeam, Astar, Acala, and Manta leverage the Ethereum Virtual Machine (EVM) and integrate it into their parachains.

[:octicons-arrow-right-24: Reference](/develop/smart-contracts/evm/)

</div>
30 changes: 28 additions & 2 deletions develop/parachains/customize-parachain/make-custom-pallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,34 @@ After following all the previous steps, the pallet is now fully implemented. Bel
With the pallet implemented, the next steps involve ensuring its reliability and performance before integrating it into a runtime. Check the following sections:
- [**Testing**](/develop/parachains/testing/) - learn how to effectively test the functionality and reliability of your pallet to ensure it behaves as expected
<div class="grid cards" markdown>
<<<<<<< HEAD
- [**Benchmarking**](/develop/parachains/testing/benchmarking/) - explore methods to measure the performance and execution cost of your pallet
=======
- <span class="badge guide">Guide</span> __Testing__
>>>>>>> 8df580b ([FIX] - Adding references to tutorials (#230))
- [**Add a Pallet to the Runtime**](/develop/parachains/customize-parachain/add-existing-pallets/) - follow this guide to include your pallet in a Polkadot SDK-based runtime, making it ready for use in your blockchain
---
Learn how to effectively test the functionality and reliability of your pallet to ensure it behaves as expected.
[:octicons-arrow-right-24: Reference](/develop/parachains/testing/)
- <span class="badge guide">Guide</span> __Benchmarking__
---
Explore methods to measure the performance and execution cost of your pallet.
[:octicons-arrow-right-24: Reference](/develop/parachains/testing/benchmarking)
- <span class="badge guide">Guide</span> __Add a Pallet to the Runtime__
---
Follow this guide to include your pallet in a Polkadot SDK-based runtime, making it ready for use in your blockchain.
[:octicons-arrow-right-24: Reference](/develop/parachains/customize-parachain/add-existing-pallets/)
</div>
32 changes: 29 additions & 3 deletions develop/parachains/deployment/generate-chain-specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,32 @@ The raw chain specification can be used to initialize the genesis storage for a

After generating a chain specification, you can use it to initialize the genesis storage for a node. Refer to the following guides to learn how to proceed with the deployment of your blockchain:

- [**Obtain Coretime**](/develop/parachains/deployment/obtain-coretime/) - learn how to obtain the necessary coretime configuration to synchronize your blockchain’s timestamping and enhance its performance
- [**Deployment**](/develop/parachains/deployment/) - explore the steps required to deploy your chain specification, ensuring a smooth launch of your network and proper node operation
- [**Maintenance**](/develop/parachains/maintenance/) - discover best practices for maintaining your blockchain post-deployment, including how to manage upgrades and monitor network health
<div class="grid cards" markdown>

- <span class="badge guide">Guide</span> __Obtain Coretime__

---

Learn how to obtain the necessary coretime configuration to synchronize your blockchain’s timestamping and enhance its performance.

[:octicons-arrow-right-24: Reference](/develop/parachains/deployment/obtain-coretime/)

- <span class="badge guide">Guide</span> __Deployment__

---

Explore the steps required to deploy your chain specification, ensuring a smooth launch of your network and proper node operation.


[:octicons-arrow-right-24: Reference](/develop/parachains/deployment/)

- <span class="badge guide">Guide</span> __Maintenance__

---

Discover best practices for maintaining your blockchain post-deployment, including how to manage upgrades and monitor network health.


[:octicons-arrow-right-24: Reference](/develop/parachains/maintenance/)

</div>
3 changes: 2 additions & 1 deletion develop/parachains/get-started/build-custom-parachains.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ Building a custom blockchain with the Polkadot SDK involves several core steps,

Each of these steps is designed to build on the last, helping ensure that your custom blockchain is functional, optimized, and ready for deployment within the Polkadot ecosystem or beyond.

<!-- This page will be removed -->
## Where to Go Next

Once your chain is functional locally, depending on your project’s goals, you can deploy to a TestNet to monitor performance and gather feedback or launch directly on a MainNet. To learn more about this process, check the [Deploy a Parachain](/develop/parachains/deployment/) section of the documentation.

After deployment, regular monitoring and maintenance are essential to ensure that the chain is functioning as expected. Developers need to be able to monitor the chain's performance, identify issues, and troubleshoot problems. Key activities include tracking network health, node performance, and transaction throughput. It's also essential to test the blockchain’s scalability under high load and perform security audits regularly to prevent vulnerabilities. For more information on monitoring and maintenance, refer to the [Maintenance](/develop/parachains/maintenance/) section.
After deployment, regular monitoring and maintenance are essential to ensure that the chain is functioning as expected. Developers need to be able to monitor the chain's performance, identify issues, and troubleshoot problems. Key activities include tracking network health, node performance, and transaction throughput. It's also essential to test the blockchain’s scalability under high load and perform security audits regularly to prevent vulnerabilities. For more information on monitoring and maintenance, refer to the [Maintenance](/develop/parachains/maintenance/) section.
40 changes: 36 additions & 4 deletions develop/parachains/get-started/deploy-parachain-to-polkadot.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,39 @@ flowchart TD

Deploying a Polkadot SDK-based blockchain is a multi-step process that requires careful planning, from generating chain specs and compiling the runtime to managing post-launch updates. By understanding the deployment process and utilizing the right tools, developers can confidently take their blockchain from development to production. For more on this topic, check out the following resources:

- [**Generate Chain Specifications**](/develop/parachains/deployment/generate-chain-specs/) - learn how to generate a chain specification for your blockchain
- [**Building Deterministic Runtimes**](/develop/parachains/deployment/build-deterministic-runtime/) - learn how to build deterministic runtimes for your blockchain
- [**Infrastructure**](/infrastructure/) - learn about the different infrastructure options available for your blockchain
- [**Maintenance**](/develop/parachains/maintenance/) - discover how to manage updates on your blockchain to ensure smooth operation
<div class="grid cards" markdown>

- <span class="badge guide">Guide</span> __Generate Chain Specifications__

---

Learn how to generate a chain specification for your blockchain.

[:octicons-arrow-right-24: Reference](/develop/parachains/deployment/generate-chain-specs/)

- <span class="badge guide">Guide</span> __Building Deterministic Runtimes__

---

Learn how to build deterministic runtimes for your blockchain.

[:octicons-arrow-right-24: Reference](/develop/parachains/deployment/build-deterministic-runtime/)

- <span class="badge guide">Guide</span> __Infrastructure__

---

Learn about the different infrastructure options available for your blockchain.

[:octicons-arrow-right-24: Reference](/infrastructure/)


- <span class="badge guide">Guide</span> __Maintenance__

---

Discover how to manage updates on your blockchain to ensure smooth operation.

[:octicons-arrow-right-24: Reference](/develop/parachains/maintenance/)

</div>
12 changes: 12 additions & 0 deletions develop/parachains/maintenance/runtime-upgrades.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,16 @@ FRAME storage migrations run in this order:
2. System `frame_system::on_runtime_upgrade` functions
3. All `on_runtime_upgrade` functions defined in the runtime starting with the last pallet in the `construct_runtime!` macro

## Where to Go Next

<div class="grid cards" markdown>

- <span class="badge tutorial">Tutorial</span> __Upgrade a Running Network__

---

Learn how to perform forkless runtime upgrades on a Polkadot SDK-based blockchain. Add features and modify parameters without network disruption.

[:octicons-arrow-right-24: Reference](tutorials/polkadot-sdk/parachains/local-chain/upgrade-a-running-network/)

</div>
6 changes: 6 additions & 0 deletions develop/parachains/testing/pallet-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ Some key considerations are:
---
<<<<<<< HEAD:develop/parachains/testing/pallet-testing.md
Learn how to use FRAME's benchmarking framework to benchmark your custom pallets and provide correct weights for on-chain computation and execution of extrinsics.

[:octicons-arrow-right-24: Reference](/develop/parachains/testing/benchmarking/)
=======
Explore methods to measure the performance and execution cost of your pallet.

[:octicons-arrow-right-24: Reference](/develop/parachains/testing/benchmarking)
>>>>>>> 8df580b ([FIX] - Adding references to tutorials (#230)):develop/parachains/customize-parachain/pallet-testing.md

</div>
67 changes: 67 additions & 0 deletions develop/parachains/testing/setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Testing Setup for a Polkadot SDK-Based Chain
description: Learn how to create a mock environment to test complete runtime functionalities in the Polkadot SDK, ensuring integration between pallets and system components.
---

# Testing Setup

## Introduction

In Polkadot SDK development, testing is crucial to ensure your blockchain works as expected. While unit testing for individual pallets validates isolated functionality, as discussed in [Pallet Testing](/develop/parachains/customize-parachain/pallet-testing/){target=\_blank}, it's equally important to test how these pallets function together within the runtime. Runtime testing fills this role by providing a complete simulation of the blockchain system.

This guide will help you set up an environment to test an entire runtime. Runtime testing will enable you to assess how different pallets, their configurations, and system components interact, ensuring your blockchain behaves correctly under real-world conditions.

## Runtime Testing

In the context of Polkadot SDK, runtime testing involves creating a simulated environment that mimics actual blockchain conditions. This type of testing goes beyond individual pallet validation, focusing on how multiple components integrate and collaborate across the system. This way, multiple runtimes can be tested if needed.

While unit tests provide confidence that individual pallets function correctly in isolation, runtime tests offer a holistic view. These tests validate pallets' communication and interaction, ensuring a seamless and functional blockchain system. By running integration tests at the runtime level, you can catch issues that only arise when multiple pallets are combined, which is critical for building a stable and reliable blockchain.

### Configuring a Mock Runtime for Integration Tests

The mock runtime includes all the necessary pallets and configurations needed for testing. To simplify the process, you can create a module that integrates all components, making it easier to assess how pallets and system elements interact.

Here's a simple example of how to create a testing module that simulates these interactions:

```rust
--8<-- 'code/develop/parachains/testing/setup/integration-testing-module.rs'
```
!!! note
The `crate::*;` snippet imports all the components from your crate (including runtime configurations, pallet modules, and utility functions) into the `integration_testing` module. This allows you to write tests without manually importing each piece, making the code more concise and readable.
Once the testing module is set, the next step is configuring the genesis storage—the initial state of your blockchain. Genesis storage sets the starting conditions for the runtime, defining how pallets are configured before any blocks are produced.
In Polkadot SDK, you can create this storage using the [`BuildStorage`](https://paritytech.github.io/polkadot-sdk/master/sp_runtime/trait.BuildStorage.html){target=\_blank} trait from the [`sp_runtime`](https://paritytech.github.io/polkadot-sdk/master/sp_runtime){target=\_blank} crate. This trait is essential for building the configuration that initializes the blockchain's state.

The function `new_test_ext()` demonstrates setting up this environment. It uses `frame_system::GenesisConfig::<Runtime>::default()` to generate a default genesis configuration for the runtime, followed by `.build_storage()` to create the initial storage state. This storage is then converted into a format usable by the testing framework, [`sp_io::TestExternalities`](https://paritytech.github.io/polkadot-sdk/master/sp_io/type.TestExternalities.html){target=\_blank}, allowing tests to be executed in a simulated blockchain environment.

Here's the code that sets up the mock runtime:

```rust
--8<-- 'code/develop/parachains/testing/setup/genesis-config.rs'
```
You can also customize the genesis storage to set initial values for your runtime pallets. For example, you can set the initial balance for accounts like this:
```rust
--8<-- 'code/develop/parachains/testing/setup/genesis-config-custom.rs'
```
## Where to Go Next
With the mock environment in place, you can now write tests to validate how your pallets interact within the runtime. This approach ensures that your blockchain behaves as expected when the entire runtime is assembled.
You can view a complete example of an integration test in the [Astar parachain](https://github.com/AstarNetwork/Astar/tree/master/tests/integration){target=\_blank} codebase.
<div class="grid cards" markdown>
- <span class="badge guide">Guide</span> __Pallet Testing__
---
Learn how to test your blockchain functionality using unit tests.
[:octicons-arrow-right-24: Reference](/develop/parachains/testing/pallet-testing/)
</div>
12 changes: 11 additions & 1 deletion develop/toolkit/parachains/fork-chains/chopsticks/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,14 @@ These are the methods that can be invoked and their parameters:

## Where to Go Next

- Visit the [Fork a Chain with Chopsticks](/tutorials/polkadot-sdk/testing/fork-live-chains/){target=\_blank} guide for step-by-step instructions for configuring and interacting with your forked chain.
<div class="grid cards" markdown>

- <span class="badge tutorial">Tutorial</span> __Fork a Chain with Chopsticks__

---

Visit this guide for step-by-step instructions for configuring and interacting with your forked chain.

[:octicons-arrow-right-24: Reference](/tutorials/polkadot-sdk/testing/fork-live-chains/)

</div>
12 changes: 12 additions & 0 deletions develop/toolkit/parachains/spawn-chains/zombienet/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -840,4 +840,16 @@ You can use the `hrmp_channels` keyword to define further parameters for the XCM
- `max_capacity` ++"number"++ - maximum capacity of the HRMP channel
- `max_message_size` ++"number"++ - maximum message size allowed in the HRMP channel

## Where to Go Next

<div class="grid cards" markdown>

- <span class="badge tutorial">Tutorial</span> __Spawn a Basic Chain with Zombienet__

---

Learn to spawn, connect to and monitor a basic blockchain network with Zombienet, using customizable configurations for streamlined development and debugging.

[:octicons-arrow-right-24: Reference](/tutorials/polkadot-sdk/testing/spawn-basic-chain/)

</div>
3 changes: 1 addition & 2 deletions polkadot-protocol/architecture/parachains/consensus.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,4 @@ It is important to understand that relay chain blocks do not store full parachai

For more technical details, refer to the:

- [Parachain Wiki](https://wiki.polkadot.network/docs/learn-parachains){target=\_blank} page
- [Polkadot SDK Implementation Guide](/develop/parachains/get-started) section
- [Parachain Wiki](https://wiki.polkadot.network/docs/learn-parachains){target=\_blank} page
Loading

0 comments on commit d5ac8cc

Please sign in to comment.