Update docs (#261)

* typos and broken links

* evm runtime docs

* name change in code

* generic runtime description updated, and typos

* smart contract with zombienet

* quick start exported into another document and further formatting
This commit is contained in:
Özgün Özerk
2024-07-26 16:33:59 +03:00
committed by Gustavo Gonzalez
parent 1b67c98311
commit 9b9845920c
41 changed files with 1032 additions and 492 deletions
+130 -130
View File
@@ -3767,6 +3767,135 @@ dependencies = [
"zeroize",
]
[[package]]
name = "generic-runtime-template"
version = "1.0.0"
dependencies = [
"assets-common",
"cumulus-pallet-aura-ext",
"cumulus-pallet-parachain-system",
"cumulus-pallet-session-benchmarking",
"cumulus-pallet-xcm",
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
"cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
"frame-support",
"frame-system",
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
"log",
"pallet-assets",
"pallet-aura",
"pallet-authorship",
"pallet-balances",
"pallet-collator-selection",
"pallet-conviction-voting",
"pallet-message-queue",
"pallet-multisig",
"pallet-preimage",
"pallet-proxy",
"pallet-referenda",
"pallet-scheduler",
"pallet-session",
"pallet-sudo",
"pallet-timestamp",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
"pallet-utility",
"pallet-whitelist",
"pallet-xcm",
"parachains-common",
"parity-scale-codec",
"polkadot-parachain-primitives",
"polkadot-runtime-common",
"scale-info",
"smallvec",
"sp-api",
"sp-arithmetic",
"sp-block-builder",
"sp-consensus-aura",
"sp-core",
"sp-genesis-builder",
"sp-inherents",
"sp-io",
"sp-offchain",
"sp-runtime",
"sp-session",
"sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-v1.10.0)",
"sp-transaction-pool",
"sp-version",
"staging-parachain-info",
"staging-xcm",
"staging-xcm-builder",
"staging-xcm-executor",
"substrate-wasm-builder",
]
[[package]]
name = "generic-template-node"
version = "1.0.0"
dependencies = [
"clap",
"color-print",
"cumulus-client-cli",
"cumulus-client-collator",
"cumulus-client-consensus-aura",
"cumulus-client-consensus-common",
"cumulus-client-consensus-proposer",
"cumulus-client-service",
"cumulus-primitives-core",
"cumulus-primitives-parachain-inherent",
"cumulus-relay-chain-interface",
"frame-benchmarking",
"frame-benchmarking-cli",
"futures",
"generic-runtime-template",
"jsonrpsee",
"log",
"pallet-transaction-payment-rpc",
"parity-scale-codec",
"polkadot-cli",
"polkadot-primitives",
"sc-basic-authorship",
"sc-chain-spec",
"sc-cli",
"sc-client-api",
"sc-consensus",
"sc-executor",
"sc-network",
"sc-network-sync",
"sc-offchain",
"sc-rpc",
"sc-service",
"sc-sysinfo",
"sc-telemetry",
"sc-tracing",
"sc-transaction-pool",
"sc-transaction-pool-api",
"serde",
"serde_json",
"sp-api",
"sp-block-builder",
"sp-blockchain",
"sp-consensus-aura",
"sp-core",
"sp-io",
"sp-keystore",
"sp-runtime",
"sp-timestamp",
"staging-xcm",
"substrate-build-script-utils",
"substrate-frame-rpc-system",
"substrate-prometheus-endpoint",
]
[[package]]
name = "gethostname"
version = "0.2.3"
@@ -7231,135 +7360,6 @@ dependencies = [
"staging-xcm-executor",
]
[[package]]
name = "parachain-template-node"
version = "1.0.0"
dependencies = [
"clap",
"color-print",
"cumulus-client-cli",
"cumulus-client-collator",
"cumulus-client-consensus-aura",
"cumulus-client-consensus-common",
"cumulus-client-consensus-proposer",
"cumulus-client-service",
"cumulus-primitives-core",
"cumulus-primitives-parachain-inherent",
"cumulus-relay-chain-interface",
"frame-benchmarking",
"frame-benchmarking-cli",
"futures",
"jsonrpsee",
"log",
"pallet-transaction-payment-rpc",
"parachain-template-runtime",
"parity-scale-codec",
"polkadot-cli",
"polkadot-primitives",
"sc-basic-authorship",
"sc-chain-spec",
"sc-cli",
"sc-client-api",
"sc-consensus",
"sc-executor",
"sc-network",
"sc-network-sync",
"sc-offchain",
"sc-rpc",
"sc-service",
"sc-sysinfo",
"sc-telemetry",
"sc-tracing",
"sc-transaction-pool",
"sc-transaction-pool-api",
"serde",
"serde_json",
"sp-api",
"sp-block-builder",
"sp-blockchain",
"sp-consensus-aura",
"sp-core",
"sp-io",
"sp-keystore",
"sp-runtime",
"sp-timestamp",
"staging-xcm",
"substrate-build-script-utils",
"substrate-frame-rpc-system",
"substrate-prometheus-endpoint",
]
[[package]]
name = "parachain-template-runtime"
version = "1.0.0"
dependencies = [
"assets-common",
"cumulus-pallet-aura-ext",
"cumulus-pallet-parachain-system",
"cumulus-pallet-session-benchmarking",
"cumulus-pallet-xcm",
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
"cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
"frame-support",
"frame-system",
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
"log",
"pallet-assets",
"pallet-aura",
"pallet-authorship",
"pallet-balances",
"pallet-collator-selection",
"pallet-conviction-voting",
"pallet-message-queue",
"pallet-multisig",
"pallet-preimage",
"pallet-proxy",
"pallet-referenda",
"pallet-scheduler",
"pallet-session",
"pallet-sudo",
"pallet-timestamp",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
"pallet-utility",
"pallet-whitelist",
"pallet-xcm",
"parachains-common",
"parity-scale-codec",
"polkadot-parachain-primitives",
"polkadot-runtime-common",
"scale-info",
"smallvec",
"sp-api",
"sp-arithmetic",
"sp-block-builder",
"sp-consensus-aura",
"sp-core",
"sp-genesis-builder",
"sp-inherents",
"sp-io",
"sp-offchain",
"sp-runtime",
"sp-session",
"sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-v1.10.0)",
"sp-transaction-pool",
"sp-version",
"staging-parachain-info",
"staging-xcm",
"staging-xcm-builder",
"staging-xcm-executor",
"substrate-wasm-builder",
]
[[package]]
name = "parachains-common"
version = "7.0.0"
@@ -13072,9 +13072,9 @@ dependencies = [
"cumulus-test-relay-sproof-builder",
"frame-support",
"frame-system",
"generic-runtime-template",
"pallet-balances",
"pallet-timestamp",
"parachain-template-runtime",
"parachains-common",
"parity-scale-codec",
"sp-consensus-aura",
+2 -2
View File
@@ -4,10 +4,10 @@ resolver = "2"
[workspace.package]
authors = [ "OpenZeppelin" ]
description = "Runtime template(s) for Polkadot Para{chains, cores}"
description = "Generic runtime template for Polkadot Para{chains, cores}"
edition = "2021"
license = "GPL-3.0-only"
repository = "https://github.com/OpenZeppelin/polkadot-runtime-template"
repository = "https://github.com/OpenZeppelin/polkadot-runtime-templates"
[workspace.dependencies]
clap = { version = "4.5.3", features = [ "derive" ] }
+5 -5
View File
@@ -1,8 +1,8 @@
[package]
name = "parachain-template-node"
name = "generic-template-node"
authors = { workspace = true }
build = "build.rs"
description = "Node compatible with parachain runtime template."
description = "Node compatible with generic runtime template."
edition = { workspace = true }
license = { workspace = true }
publish = false
@@ -19,7 +19,7 @@ serde = { workspace = true, features = [ "derive" ] }
serde_json = { workspace = true }
# Local
parachain-template-runtime = { path = "../runtime" }
generic-runtime-template = { path = "../runtime" }
# Substrate
frame-benchmarking = { workspace = true }
@@ -80,14 +80,14 @@ experimental = []
runtime-benchmarks = [
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"parachain-template-runtime/runtime-benchmarks",
"generic-runtime-template/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"parachain-template-runtime/try-runtime",
"generic-runtime-template/try-runtime",
"polkadot-cli/try-runtime",
"sp-runtime/try-runtime",
]
+6 -8
View File
@@ -1,5 +1,5 @@
use cumulus_primitives_core::ParaId;
use parachain_template_runtime::{
use generic_runtime_template::{
constants::currency::EXISTENTIAL_DEPOSIT, AccountId, AuraId, Signature,
};
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
@@ -10,7 +10,7 @@ use sp_runtime::traits::{IdentifyAccount, Verify};
/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec =
sc_service::GenericChainSpec<parachain_template_runtime::RuntimeGenesisConfig, Extensions>;
sc_service::GenericChainSpec<generic_runtime_template::RuntimeGenesisConfig, Extensions>;
/// The default XCM version to set in genesis config.
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
@@ -61,8 +61,8 @@ where
///
/// The input must be a tuple of individual keys (a single arg for now since we
/// have just one key).
pub fn template_session_keys(keys: AuraId) -> parachain_template_runtime::SessionKeys {
parachain_template_runtime::SessionKeys { aura: keys }
pub fn template_session_keys(keys: AuraId) -> generic_runtime_template::SessionKeys {
generic_runtime_template::SessionKeys { aura: keys }
}
pub fn development_config() -> ChainSpec {
@@ -75,8 +75,7 @@ pub fn development_config() -> ChainSpec {
properties.insert("basedOn".into(), "OpenZeppelin Generic Template".into());
ChainSpec::builder(
parachain_template_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
generic_runtime_template::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions {
relay_chain: "rococo-local".into(),
// You MUST set this to the correct network!
@@ -127,8 +126,7 @@ pub fn local_testnet_config() -> ChainSpec {
#[allow(deprecated)]
ChainSpec::builder(
parachain_template_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
generic_runtime_template::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions {
relay_chain: "rococo-local".into(),
// You MUST set this to the correct network!
+1 -1
View File
@@ -3,8 +3,8 @@ use std::net::SocketAddr;
use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use generic_runtime_template::Block;
use log::info;
use parachain_template_runtime::Block;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
NetworkParams, Result, SharedParams, SubstrateCli,
+1 -1
View File
@@ -7,7 +7,7 @@
use std::sync::Arc;
use parachain_template_runtime::{opaque::Block, AccountId, Balance, Nonce};
use generic_runtime_template::{opaque::Block, AccountId, Balance, Nonce};
use sc_client_api::AuxStore;
pub use sc_rpc::DenyUnsafe;
use sc_transaction_pool_api::TransactionPool;
+1 -1
View File
@@ -20,7 +20,7 @@ use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};
// Substrate Imports
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
// Local Runtime Types
use parachain_template_runtime::{
use generic_runtime_template::{
apis::RuntimeApi,
opaque::{Block, Hash},
};
+1 -1
View File
@@ -1,5 +1,5 @@
[package]
name = "parachain-template-runtime"
name = "generic-runtime-template"
authors = { workspace = true }
description = "A generic parachain runtime template"
edition = { workspace = true }
+1 -1
View File
@@ -1,6 +1,6 @@
// ExtBuilder impl for all runtime integration tests
use frame_support::weights::Weight;
use parachain_template_runtime::{BuildStorage, Runtime, System};
use generic_runtime_template::{BuildStorage, Runtime, System};
pub fn run_with_system_weight<F: FnMut()>(w: Weight, mut assertions: F) {
let mut t: sp_io::TestExternalities =
@@ -1,5 +1,5 @@
mod constant_tests {
use parachain_template_runtime::constants::currency::*;
use generic_runtime_template::constants::currency::*;
#[test]
fn test_constants() {
@@ -20,7 +20,7 @@ mod constant_tests {
mod runtime_tests {
use frame_support::{pallet_prelude::Weight, traits::TypedGet, PalletId};
use parachain_template_runtime::{
use generic_runtime_template::{
configs::*,
constants::{currency::*, *},
*,
@@ -39,7 +39,7 @@ mod runtime_tests {
authoring_version: 1,
spec_version: 1,
impl_version: 0,
apis: parachain_template_runtime::apis::RUNTIME_API_VERSIONS,
apis: generic_runtime_template::apis::RUNTIME_API_VERSIONS,
transaction_version: 1,
state_version: 1,
}
@@ -222,7 +222,7 @@ mod runtime_tests {
mod xcm_tests {
use frame_support::weights::Weight;
use parachain_template_runtime::configs::xcm_config::*;
use generic_runtime_template::configs::xcm_config::*;
#[test]
fn xcm_executor_constants() {
@@ -234,6 +234,9 @@ mod xcm_tests {
#[test]
fn pallet_xcm_constants() {
assert_eq!(MaxLockers::get(), 0);
assert_eq!(<parachain_template_runtime::Runtime as pallet_xcm::Config>::VERSION_DISCOVERY_QUEUE_SIZE, 100);
assert_eq!(
<generic_runtime_template::Runtime as pallet_xcm::Config>::VERSION_DISCOVERY_QUEUE_SIZE,
100
);
}
}
+1 -1
View File
@@ -2,8 +2,8 @@
mod common;
use common::*;
use frame_support::pallet_prelude::*;
use generic_runtime_template::{Runtime, RuntimeBlockWeights};
use pallet_transaction_payment::Multiplier;
use parachain_template_runtime::{Runtime, RuntimeBlockWeights};
use polkadot_runtime_common::MinimumMultiplier;
use sp_runtime::{traits::Convert, Perquintill};
+1 -1
View File
@@ -1,6 +1,6 @@
// Storage indices integration checks
use frame_support::traits::PalletInfo;
use parachain_template_runtime::{
use generic_runtime_template::{
Aura, AuraExt, Authorship, Balances, CollatorSelection, CumulusXcm, MessageQueue, Multisig,
ParachainInfo, ParachainSystem, PolkadotXcm, Proxy, Runtime, Session, Sudo, System, Timestamp,
TransactionPayment, XcmpQueue,
+3 -3
View File
@@ -18,7 +18,7 @@ workspace = true
substrate-runtime-fuzzer = { workspace = true }
ziggy = { workspace = true }
parachain-template-runtime = { path = "../runtime" }
generic-runtime-template = { path = "../runtime" }
parachains-common = { workspace = true }
parity-scale-codec = { workspace = true }
@@ -42,8 +42,8 @@ cumulus-test-relay-sproof-builder = { workspace = true }
default = [ "std", "try-runtime" ]
std = [
"frame-support/std",
"generic-runtime-template/std",
"pallet-timestamp/std",
"parachain-template-runtime/std",
"parity-scale-codec/std",
"sp-consensus-aura/std",
"sp-runtime/std",
@@ -51,8 +51,8 @@ std = [
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"generic-runtime-template/try-runtime",
"pallet-timestamp/try-runtime",
"parachain-template-runtime/try-runtime",
"sp-runtime/try-runtime",
]
+2 -2
View File
@@ -7,7 +7,7 @@ use frame_support::{
traits::{IntegrityTest, TryState, TryStateSelect},
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
};
use parachain_template_runtime::{
use generic_runtime_template::{
constants::SLOT_DURATION, AllPalletsWithSystem, Balance, Balances, BlockNumber, Executive,
Runtime, RuntimeCall, RuntimeOrigin, SudoConfig, UncheckedExtrinsic,
};
@@ -25,7 +25,7 @@ fn main() {
let endowed_accounts: Vec<AccountId> = (0..5).map(|i| [i; 32].into()).collect();
let genesis_storage: Storage = {
use parachain_template_runtime::{
use generic_runtime_template::{
BalancesConfig, CollatorSelectionConfig, RuntimeGenesisConfig, SessionConfig,
SessionKeys,
};