Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Runtime Documentation #1282

Merged
merged 7 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
22 changes: 22 additions & 0 deletions parachains/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Parachains

This directory is the home of Parity-developed parachain runtimes. This directory is _runtime
focused,_ and does not include builds of parachain _nodes._
drahnr marked this conversation as resolved.
Show resolved Hide resolved
joepetrowski marked this conversation as resolved.
Show resolved Hide resolved

The general internal structure is:

- `chain-specs`: Chain specs for the runtimes contained in its sibling dir `runtimes`.
- `common`: Common configurations, `impl`s, etc. used by several parachain runtimes.
- `pallets`: FRAME pallets that are specific to parachains.
- `runtimes`: The entry point for parachain runtimes.

## Common Good Parachains

The `runtimes` directory includes many, but is not limited to,
[common good parachains](https://wiki.polkadot.network/docs/learn-common-goods). Likewise, not all
common good parachains are in this repo.

## Releases

The project maintainers generally try to release a set of parachain runtimes for each Polkadot
Relay Chain runtime release.
25 changes: 25 additions & 0 deletions parachains/runtimes/assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Assets Parachain

Implementation of _Statemint,_ a blockchain to support generic assets in the Polkadot and Kusama
joepetrowski marked this conversation as resolved.
Show resolved Hide resolved
networks.

Statemint allows users to:

- Deploy promise-backed assets, both fungible and non-fungible, with a DOT/KSM deposit.
- Set admin roles to manage assets and asset classes.
- Register assets as "self-sufficient" if the Relay Chain agrees, i.e. gain the ability for an
asset to justify the existance of accounts sans DOT/KSM.
- Pay transaction fees using sufficient assets.
- Transfer (and approve transfer) assets.
- Interact with the chain via its transactional API or XCM.

Statemint must stay fully aligned with the Relay Chain it is connected to. As such, it will accept
the Relay Chain's governance origins as its own.

See
[this article](https://www.parity.io/blog/statemint-generic-assets-chain-proposing-a-common-good-parachain-to-polkadot-governance/)
joepetrowski marked this conversation as resolved.
Show resolved Hide resolved
for a higher level description.

Wallets, custodians, etc. should see
[the Polkadot Wiki's Integration Guide](https://wiki.polkadot.network/docs/build-integrate-assets)
for details about support.
6 changes: 4 additions & 2 deletions parachains/runtimes/assets/statemine/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2021 Parity Technologies (UK) Ltd.
// Copyright (C) 2021-2022 Parity Technologies (UK) Ltd.
drahnr marked this conversation as resolved.
Show resolved Hide resolved
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,7 +13,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! Statemine runtime.
//! # Statemine Runtime
//!
//! Statemine is the canary network for its Polkadot cousin, Statemint.

#![cfg_attr(not(feature = "std"), no_std)]
#![recursion_limit = "256"]
Expand Down
35 changes: 33 additions & 2 deletions parachains/runtimes/assets/statemint/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2021 Parity Technologies (UK) Ltd.
// Copyright (C) 2021-2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,7 +13,38 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! Statemint runtime.
//! # Statemint Runtime
//!
//! Statemint is a parachain that provides an interface to create, manage, and use assets. Assets
//! may be fungible or non-fungible.
//!
//! ## Assets
//!
//! - Fungibles: Configuration of `pallet-assets`.
//! - Non-Fungibles (NFTs): Configuration of `pallet-uniques`.
//!
//! ## Other Functionality
//!
//! ### Native Balances
//!
//! Statemint uses its parent DOT token as its native asset.
//!
//! ### Governance
//!
//! As a common good parachain, Statemint defers its governance (namely, its `Root` origin), to its
//! Relay Chain parent, Polkadot.
//!
//! ### Collator Selection
//!
//! Statemint uses `pallet-collator-selection`, a simple first-come-first-served registration
//! system where collators can reserve a small bond to join the block producer set. There is no
//! slashing.
//!
//! ### XCM
//!
//! Because Statemint is fully under the control of the Relay Chain, it is meant to be a
//! `TrustedTeleporter`. It can also serve as a reserve location to other parachains for DOT as well
//! as other local assets.

#![cfg_attr(not(feature = "std"), no_std)]
#![recursion_limit = "256"]
Expand Down
6 changes: 4 additions & 2 deletions parachains/runtimes/assets/westmint/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2021 Parity Technologies (UK) Ltd.
// Copyright (C) 2021-2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,7 +13,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! Westmint runtime.
//! # Westmint Runtime
//!
//! Westmint is the testnet for Statemint.

#![cfg_attr(not(feature = "std"), no_std)]
#![recursion_limit = "256"]
Expand Down
6 changes: 5 additions & 1 deletion parachains/runtimes/contracts/contracts-rococo/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
//
// This program is free software: you can redistribute it and/or modify
Expand All @@ -14,6 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

//! # Contracts Parachain
//!
//! A parachain for using FRAME's `pallet-contracts` and ink! contracts.
joepetrowski marked this conversation as resolved.
Show resolved Hide resolved

#![cfg_attr(not(feature = "std"), no_std)]
#![recursion_limit = "256"]

Expand Down
7 changes: 6 additions & 1 deletion parachains/runtimes/starters/seedling/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
// Copyright 2019-2022 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.

// Cumulus is free software: you can redistribute it and/or modify
Expand All @@ -14,6 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.

//! # Seedling Runtime
//!
//! Seedling is a parachain meant to help parachain auction winners migrate a blockchain from
//! another consensus system into the consensus system of a given Relay Chain.

#![cfg_attr(not(feature = "std"), no_std)]
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
#![recursion_limit = "256"]
Expand Down
9 changes: 8 additions & 1 deletion parachains/runtimes/starters/shell/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
// Copyright 2019-2022 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.

// Cumulus is free software: you can redistribute it and/or modify
Expand All @@ -14,6 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.

//! # Shell Runtime
//!
//! The Shell runtime defines a minimal parachain. It can listen for a downward message authorizing
//! an upgrade into another parachain.
joepetrowski marked this conversation as resolved.
Show resolved Hide resolved
//!
//! Generally (so far) only used as the first parachain on a Relay.

#![cfg_attr(not(feature = "std"), no_std)]
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
#![recursion_limit = "256"]
Expand Down
2 changes: 1 addition & 1 deletion parachains/runtimes/testing/rococo-parachain/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
// Copyright 2019-2022 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.

// Cumulus is free software: you can redistribute it and/or modify
Expand Down