From 8553b97930e56667e7548d040606da562d7c520b Mon Sep 17 00:00:00 2001 From: Euraxluo Date: Mon, 11 Dec 2023 19:48:26 +0800 Subject: [PATCH 01/39] Update use-macros-in-a-custom-pallet.md (#2094) fix with https://github.com/paritytech/substrate/pull/14437 --- .../build-application-logic/use-macros-in-a-custom-pallet.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md b/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md index c6aa96a7a..b8e13dcb9 100644 --- a/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md +++ b/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md @@ -238,7 +238,9 @@ To implement storage for the proof-of-existence pallet: ```rust #[pallet::storage] - pub(super) type Claims = StorageMap<_, Blake2_128Concat, T::Hash, (T::AccountId, T::BlockNumber)>; + pub(super) type Claims = StorageMap<_, Blake2_128Concat, T::Hash, (T::AccountId, BlockNumberFor)>; + #[pallet::hooks] + impl Hooks> for Pallet {} ``` 1. Save your changes. From 4f08f21e26195a3e486599cb538d30d1d4c68236 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 21 Jan 2024 14:17:41 +0800 Subject: [PATCH 02/39] Update Proof of Existence Tutorial (#2110) * Update use-macros-in-a-custom-pallet.md * more fix --- .../use-macros-in-a-custom-pallet.md | 49 +++++++------------ 1 file changed, 17 insertions(+), 32 deletions(-) diff --git a/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md b/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md index b8e13dcb9..62b80801a 100644 --- a/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md +++ b/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md @@ -32,15 +32,11 @@ This tutorial requires compiling Rust code and takes approximately one to two ho ## Before you begin -For this tutorial, you download and use working code. Before you begin, verify the following: +Before you begin, verify the following: - You have configured your environment for Substrate development by installing [Rust and the Rust toolchain](/install/). -- You have completed [Build a local blockchain](/tutorials/build-a-blockchain/build-local-blockchain/) and have the Substrate node template installed locally. - -- You have used predefined accounts as described in [Simulate a network](/tutorials/build-a-blockchain/simulate-network/) to start nodes on a single computer. - -- You are generally familiar with software development and use command-line interfaces. +- You have cloned the [Substrate node template](https://github.com/substrate-developer-hub/substrate-node-template), which will be used as the starting point for this tutorial. ## Tutorial objectives @@ -52,11 +48,11 @@ By completing this tutorial, you will accomplish the following objectives: - Start a blockchain node that contains a custom pallet. -- Add front-end code that exposes the proof-of-existence pallet. +- Interact with a front-end that exposes the proof-of-existence pallet. -## Design the application +## Application design -The proof-of-existence application exposes the following callable functions: +The proof-of-existence application exposes two callable functions: - `create_claim()` allows a user to claim the existence of a file by uploading a hash. @@ -100,19 +96,12 @@ Therefore, the first step is to remove some files and content from the files in You won't be using the template code in this tutorial. However, you can review the template code to see what it provides before you delete it. -1. Delete all of the lines in the `lib.rs` file. - -1. Add the macro required to build both the native Rust binary (`std`) and the WebAssembly (`no_std`) binary. +1. Delete all of the lines in the `lib.rs` file, and replace it with the skeleton of a custom pallet: ```rust + // All pallets must be configured for `no_std`. #![cfg_attr(not(feature = "std"), no_std)] - ``` - - All of the pallets used in a runtime must be set to compile with the `no_std` features. -1. Add a skeleton set of pallet dependencies and [macros](/reference/frame-macros) that the custom pallet requires by copying the following code: - - ```rust // Re-export pallet items so that they can be accessed from the crate namespace. pub use pallet::*; @@ -122,7 +111,6 @@ Therefore, the first step is to remove some files and content from the files in use frame_system::pallet_prelude::*; #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); #[pallet::config] // <-- Step 2. code block will replace this. @@ -140,8 +128,8 @@ Therefore, the first step is to remove some files and content from the files in ## Configure the pallet to emit events Every pallet has a [Rust "trait"](https://doc.rust-lang.org/book/ch10-02-traits.html) called `Config`. -You use this trait to configure the settings that your specific pallet requires. -For this tutorial, the configuration setting enables the pallet to emit events. +You use this trait to expose configurable options and connect your pallet to other parts of the runtime. +For this tutorial, we need to configure out pallet to emit events. To define the `Config` trait for the proof-of-existence pallet: @@ -163,13 +151,12 @@ To define the `Config` trait for the proof-of-existence pallet: ## Implement pallet events Now that you've configured the pallet to emit events, you are ready to define those events. -As described in [Design the application](#design-the-application), the proof-of-existence pallet emits an event under the following conditions: +Based on the [application design](#application-design), we want the proof-of-existence pallet to emit an event under the following conditions: - When a new claim is added to the blockchain. - When a claim is revoked. -Each event also displays an `AccountId` to identify who triggered the -event and the proof-of-existence claim (as `Hash`) that is being stored or removed. +Each event can include an `AccountId` to identify who triggered the event and a `Hash`, representing the proof-of-existence claim that is being stored or removed. To implement the pallet events: @@ -239,8 +226,6 @@ To implement storage for the proof-of-existence pallet: ```rust #[pallet::storage] pub(super) type Claims = StorageMap<_, Blake2_128Concat, T::Hash, (T::AccountId, BlockNumberFor)>; - #[pallet::hooks] - impl Hooks> for Pallet {} ``` 1. Save your changes. @@ -270,8 +255,8 @@ To implement this logic in the proof-of-existence pallet: // Dispatchable functions must be annotated with a weight and must return a DispatchResult. #[pallet::call] impl Pallet { - #[pallet::weight(0)] - #[pallet::call_index(1)] + #[pallet::weight(Weight::default())] + #[pallet::call_index(0)] pub fn create_claim(origin: OriginFor, claim: T::Hash) -> DispatchResult { // Check that the extrinsic was signed and get the signer. // This function will return an error if the extrinsic is not signed. @@ -292,8 +277,8 @@ To implement this logic in the proof-of-existence pallet: Ok(()) } - #[pallet::weight(0)] - #[pallet::call_index(2)] + #[pallet::weight(Weight::default())] + #[pallet::call_index(1)] pub fn revoke_claim(origin: OriginFor, claim: T::Hash) -> DispatchResult { // Check that the extrinsic was signed and get the signer. // This function will return an error if the extrinsic is not signed. @@ -320,10 +305,10 @@ To implement this logic in the proof-of-existence pallet: 1. Check that your code compiles by running the following command: ```bash - cargo check -p node-template-runtime --release + cargo check -p pallet-template ``` - The `[-p](https://doc.rust-lang.org/cargo/commands/cargo-check.html#options) node-template-runtime` directive tells cargo to only check the `node_template_runtime` package. + The `-p` flag tells cargo to only check the `pallet-template` that you have been modifying and saving you some compile time. You can refer to the node template [solution](https://github.com/substrate-developer-hub/substrate-node-template/blob/tutorials/solutions/proof-of-existence/pallets/template/src/lib.rs) if you get stuck. From 5423beeb66ca2996c1373a9bc6f333d7f6d424ed Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sun, 21 Jan 2024 14:48:32 +0800 Subject: [PATCH 03/39] More Proof of Existence Fixes (#2111) * Update use-macros-in-a-custom-pallet.md * more fix * make work with runtime with weights * fix dead link --- content/md/en/docs/build/build-process.md | 2 +- .../use-macros-in-a-custom-pallet.md | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/content/md/en/docs/build/build-process.md b/content/md/en/docs/build/build-process.md index d69bd7cbe..7929a0727 100644 --- a/content/md/en/docs/build/build-process.md +++ b/content/md/en/docs/build/build-process.md @@ -138,6 +138,6 @@ This option is primarily used for faster compile time when you don't need to upd ## Where to go next -- [Wasm-builder README](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/utils/wasm-builder/README.md) +- [Wasm-builder source](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/utils/wasm-builder/src/lib.rs) - [Rust compilation options](https://doc.rust-lang.org/cargo/commands/cargo-build.html#compilation-options) - [Discussion: Removing the native runtime](https://github.com/paritytech/substrate/issues/10579) diff --git a/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md b/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md index 62b80801a..197db12f0 100644 --- a/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md +++ b/content/md/en/docs/tutorials/build-application-logic/use-macros-in-a-custom-pallet.md @@ -119,10 +119,18 @@ Therefore, the first step is to remove some files and content from the files in #[pallet::storage] // <-- Step 5. code block will replace this. #[pallet::call] // <-- Step 6. code block will replace this. } + + pub mod weights { + // Placeholder struct for the pallet weights + pub struct SubstrateWeight(core::marker::PhantomData); + } ``` You now have a framework that includes placeholders for _events_, _errors_, _storage_, and _callable functions_. + > NOTE: Pallet weights are outside the scope of this tutorial. If you want to learn more about weights, you can read our documentation [here](/reference/how-to-guides/weights/). + + 1. Save your changes. ## Configure the pallet to emit events @@ -143,6 +151,9 @@ To define the `Config` trait for the proof-of-existence pallet: pub trait Config: frame_system::Config { /// Because this pallet emits events, it depends on the runtime's definition of an event. type RuntimeEvent: From> + IsType<::RuntimeEvent>; + /// Pallets use weights to measure the complexity of the callable functions. + /// Configuring weights is outside the scope of this tutorial, so we will leave it empty for now. + type WeightInfo; } ``` @@ -302,7 +313,7 @@ To implement this logic in the proof-of-existence pallet: 1. Save your changes and close the file. -1. Check that your code compiles by running the following command: +1. Check that your pallet compiles by running the following command: ```bash cargo check -p pallet-template From d8e60b5bfe327ae1a6abf72c2cb82752cc3b0e5b Mon Sep 17 00:00:00 2001 From: dzhelezov Date: Sun, 21 Jan 2024 09:54:05 +0300 Subject: [PATCH 04/39] Add SCALE codec by subsquid (#2100) Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> --- content/md/en/docs/reference/scale-codec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/reference/scale-codec.md b/content/md/en/docs/reference/scale-codec.md index 09efa5527..4c3575025 100644 --- a/content/md/en/docs/reference/scale-codec.md +++ b/content/md/en/docs/reference/scale-codec.md @@ -74,7 +74,7 @@ SCALE Codec has been implemented in other languages, including: - C: [`MatthewDarnell/cScale`](https://github.com/MatthewDarnell/cScale) - C++: [`soramitsu/scale-codec-cpp`](https://github.com/soramitsu/scale-codec-cpp) - JavaScript: [`polkadot-js/api`](https://github.com/polkadot-js/api) -- TypeScript: [`parity-scale-codec-ts`](https://github.com/paritytech/parity-scale-codec-ts), [`scale-ts`](https://github.com/unstoppablejs/unstoppablejs/tree/main/packages/scale-ts#scale-ts), [`soramitsu/scale-codec-js-library`](https://github.com/soramitsu/scale-codec-js-library) +- TypeScript: [`parity-scale-codec-ts`](https://github.com/paritytech/parity-scale-codec-ts), [`scale-ts`](https://github.com/unstoppablejs/unstoppablejs/tree/main/packages/scale-ts#scale-ts), [`soramitsu/scale-codec-js-library`](https://github.com/soramitsu/scale-codec-js-library), [`subsquid/scale-codec`](https://github.com/subsquid/squid-sdk/tree/master/substrate/scale-codec) - AssemblyScript: [`LimeChain/as-scale-codec`](https://github.com/LimeChain/as-scale-codec) - Haskell: [`airalab/hs-web3`](https://github.com/airalab/hs-web3/tree/master/packages/scale) - Java: [`emeraldpay/polkaj`](https://github.com/emeraldpay/polkaj) From 290c33321624bfca7f8de4997dc4e5e6c132a1aa Mon Sep 17 00:00:00 2001 From: Jackliu-miaozi <71253778+Jackliu-miaozi@users.noreply.github.com> Date: Mon, 22 Jan 2024 10:13:47 +0800 Subject: [PATCH 05/39] Change "Self::BlockNumber" to "BlockNumberFor" (#2104) change ```rust Self::BlockNumber ``` ```rust BlockNumberFor ``` Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> --- .../how-to-guides/pallet-design/incorporate-randomness.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/reference/how-to-guides/pallet-design/incorporate-randomness.md b/content/md/en/docs/reference/how-to-guides/pallet-design/incorporate-randomness.md index c3d476cf1..d63ead82b 100644 --- a/content/md/en/docs/reference/how-to-guides/pallet-design/incorporate-randomness.md +++ b/content/md/en/docs/reference/how-to-guides/pallet-design/incorporate-randomness.md @@ -30,7 +30,7 @@ The guide also illustrates how to add entropy to the randomness value by assigni ```rust #[pallet::config] pub trait frame_system::Config { - type MyRandomness: Randomness; + type MyRandomness: Randomness>; } ``` From b89149a78445d1f959162549b268d287e9478226 Mon Sep 17 00:00:00 2001 From: andresvsm Date: Mon, 22 Jan 2024 03:20:10 +0100 Subject: [PATCH 06/39] Fix wrong repository (#2108) Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> --- .../tutorials/build-a-blockchain/authorize-specific-nodes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/tutorials/build-a-blockchain/authorize-specific-nodes.md b/content/md/en/docs/tutorials/build-a-blockchain/authorize-specific-nodes.md index 6e15808a8..415c63ec8 100644 --- a/content/md/en/docs/tutorials/build-a-blockchain/authorize-specific-nodes.md +++ b/content/md/en/docs/tutorials/build-a-blockchain/authorize-specific-nodes.md @@ -131,7 +131,7 @@ To add the `node-authorization` pallet to the Substrate runtime: ```toml [dependencies] - pallet-node-authorization = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk.git", branch = "polkadot-v1.0.0" } + pallet-node-authorization = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } ``` This line imports the `pallet-node-authorization` crate as a dependency and specifies the following configuration details for the crate: From 1a4c24f46e7bc1010bf2f8707d1192075b136aac Mon Sep 17 00:00:00 2001 From: Leonardo Custodio Date: Sun, 21 Jan 2024 23:24:23 -0300 Subject: [PATCH 07/39] Add dart lib (#2084) * Update scale-codec.md * Update scale-codec.md * Update --------- Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> --- content/md/en/docs/reference/scale-codec.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/content/md/en/docs/reference/scale-codec.md b/content/md/en/docs/reference/scale-codec.md index 4c3575025..f7975e97e 100644 --- a/content/md/en/docs/reference/scale-codec.md +++ b/content/md/en/docs/reference/scale-codec.md @@ -69,13 +69,21 @@ The following table shows how the Rust implementation of the Parity SCALE codec SCALE Codec has been implemented in other languages, including: -- Python: [`polkascan/py-scale-codec`](https://github.com/polkascan/py-scale-codec) -- Golang: [`itering/scale.go`](https://github.com/itering/scale.go) +- AssemblyScript: [`LimeChain/as-scale-codec`](https://github.com/LimeChain/as-scale-codec) + + - C: [`MatthewDarnell/cScale`](https://github.com/MatthewDarnell/cScale) - C++: [`soramitsu/scale-codec-cpp`](https://github.com/soramitsu/scale-codec-cpp) - JavaScript: [`polkadot-js/api`](https://github.com/polkadot-js/api) -- TypeScript: [`parity-scale-codec-ts`](https://github.com/paritytech/parity-scale-codec-ts), [`scale-ts`](https://github.com/unstoppablejs/unstoppablejs/tree/main/packages/scale-ts#scale-ts), [`soramitsu/scale-codec-js-library`](https://github.com/soramitsu/scale-codec-js-library), [`subsquid/scale-codec`](https://github.com/subsquid/squid-sdk/tree/master/substrate/scale-codec) -- AssemblyScript: [`LimeChain/as-scale-codec`](https://github.com/LimeChain/as-scale-codec) +- Dart: [`leonardocustodio/polkadart`](https://github.com/leonardocustodio/polkadart) - Haskell: [`airalab/hs-web3`](https://github.com/airalab/hs-web3/tree/master/packages/scale) +- Golang: [`itering/scale.go`](https://github.com/itering/scale.go) - Java: [`emeraldpay/polkaj`](https://github.com/emeraldpay/polkaj) +- JavaScript: [`polkadot-js/api`](https://github.com/polkadot-js/api) +- Python: [`polkascan/py-scale-codec`](https://github.com/polkascan/py-scale-codec) - Ruby: [`wuminzhe/scale_rb`](https://github.com/wuminzhe/scale_rb) +- TypeScript: [`parity-scale-codec-ts`](https://github.com/paritytech/parity-scale-codec-ts), [`scale-ts`](https://github.com/unstoppablejs/unstoppablejs/tree/main/packages/scale-ts#scale-ts), [`soramitsu/scale-codec-js-library`](https://github.com/soramitsu/scale-codec-js-library), [`subsquid/scale-codec`](https://github.com/subsquid/squid-sdk/tree/master/substrate/scale-codec) + + + + From 8844c0677e906cc70314ee5c6047a7cd0839da1d Mon Sep 17 00:00:00 2001 From: gui Date: Fri, 16 Feb 2024 23:48:55 +0900 Subject: [PATCH 08/39] Update runtime-upgrades.md (#2126) --- content/md/en/docs/maintain/runtime-upgrades.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/maintain/runtime-upgrades.md b/content/md/en/docs/maintain/runtime-upgrades.md index c66a34d00..d43bff246 100644 --- a/content/md/en/docs/maintain/runtime-upgrades.md +++ b/content/md/en/docs/maintain/runtime-upgrades.md @@ -19,7 +19,7 @@ If a runtime upgrade requires changes to the existing state, it is likely to req In [Build process](/main-docs/build/build-process/), you learned that compiling a node generated both a platform-native binary and a WebAssembly binary and that selecting which binary to use at different points in the block production process can be controlled by execution strategy command-line options. The component that selects the runtime execution environment to communicate with is called the **executor**. -Although you can override the default execution strategies for custom scenarios, in most cases, or the executor select the appropriate binary to use by evaluating the following information for both the native and WebAssembly runtime binaries: +Although you can override the default execution strategies for custom scenarios, in most cases the executor select the appropriate binary to use by evaluating the following information for both the native and WebAssembly runtime binaries: - `spec_name` - `spec_version` From 521076ccdfd54def9c204b29cf77bc712bd4c5a1 Mon Sep 17 00:00:00 2001 From: gui Date: Fri, 16 Feb 2024 23:53:20 +0900 Subject: [PATCH 09/39] Update keys-and-network-operations.md (#2125) Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> --- content/md/en/docs/deploy/keys-and-network-operations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/deploy/keys-and-network-operations.md b/content/md/en/docs/deploy/keys-and-network-operations.md index 900b333ed..d9cc0305c 100644 --- a/content/md/en/docs/deploy/keys-and-network-operations.md +++ b/content/md/en/docs/deploy/keys-and-network-operations.md @@ -41,7 +41,7 @@ To create session keys, a validator node operator must use a controller account The certificate attests that the key acts on behalf of the validator's staking account and nominators. After creating the session key, the validator node operator informs the chain that this key represents the controller key by publishing the session certificate in a transaction on the chain. -In most cases, node operators use the [Session](https://paritytech.github.io/substrate/master/pallet_session/index.html)) pallet to manage their session keys. +In most cases, node operators use the [Session](https://paritytech.github.io/substrate/master/pallet_session/index.html) pallet to manage their session keys. The [`SessionKeys`](https://paritytech.github.io/substrate/master/sp_session/index.html) trait is a generic, indexable type and you can declare any number of session keys in the runtime. From fe46d37d8ed5122ae305d9aac0c78a9ae936263f Mon Sep 17 00:00:00 2001 From: gui Date: Fri, 16 Feb 2024 23:53:34 +0900 Subject: [PATCH 10/39] Update keys-and-network-operations.md (#2123) --- content/md/en/docs/deploy/keys-and-network-operations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/deploy/keys-and-network-operations.md b/content/md/en/docs/deploy/keys-and-network-operations.md index d9cc0305c..db7fe5b9b 100644 --- a/content/md/en/docs/deploy/keys-and-network-operations.md +++ b/content/md/en/docs/deploy/keys-and-network-operations.md @@ -36,7 +36,7 @@ Session keys are private online keys that are used by validators to sign consens Session keys must be available online to enable the validator to perform certain network operations. These keys aren't used to control funds and they should only be used for their intended purpose. -They can be changed regularly +They can be changed regularly. To create session keys, a validator node operator must use a controller account too generate a certificate signed with the session's public key. The certificate attests that the key acts on behalf of the validator's staking account and nominators. After creating the session key, the validator node operator informs the chain that this key represents the controller key by From 3f3a676007e5130a92ef6f0df11e6b6404b799ec Mon Sep 17 00:00:00 2001 From: gui Date: Fri, 16 Feb 2024 23:55:06 +0900 Subject: [PATCH 11/39] Update rust-basics.md (#2118) --- content/md/en/docs/learn/rust-basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/learn/rust-basics.md b/content/md/en/docs/learn/rust-basics.md index fae3279fa..cb01e8fa1 100644 --- a/content/md/en/docs/learn/rust-basics.md +++ b/content/md/en/docs/learn/rust-basics.md @@ -40,7 +40,7 @@ These macros allow you to focus on writing idiomatic Rust and application-specif Rust macros are a powerful tool to help ensure certain requirements are met (without re-writing code) such as the logic to be formatted in a specific way, specific checks are made, or some logic consists of specific data structures. This is especially useful to help developers write code that can integrate with the complexity of a Substrate runtime. -For example, the `#[frame_system::pallet]` macro is required in all FRAME pallets to help you correctly implement certain required attributes-such as storage items or externally callable functions-and make it compatible with the build process in `construct_runtime`. +For example, the `#[frame_support::pallet]` macro is required in all FRAME pallets to help you correctly implement certain required attributes-such as storage items or externally callable functions-and make it compatible with the build process in `construct_runtime`. Developing Substrate runtimes involves heavy use of Rust's attribute macros, which come in two flavors: derive attributes and custom attributes. When you're getting started with Substrate, it isn't so important to know exactly how they work, but rather to know that they exist that they empower you to write correct runtime code. From 673afeca47eabb9e35781573405cbe1e0497bc81 Mon Sep 17 00:00:00 2001 From: gui Date: Fri, 16 Feb 2024 23:55:15 +0900 Subject: [PATCH 12/39] Improved english? (#2116) * Update transaction-lifecycle.md * Update transaction-lifecycle.md * Update transaction-lifecycle.md * Update accounts-addresses-keys.md * Update accounts-addresses-keys.md --- content/md/en/docs/learn/accounts-addresses-keys.md | 4 ++-- content/md/en/docs/learn/transaction-lifecycle.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/content/md/en/docs/learn/accounts-addresses-keys.md b/content/md/en/docs/learn/accounts-addresses-keys.md index 6e32550b1..a7c538598 100644 --- a/content/md/en/docs/learn/accounts-addresses-keys.md +++ b/content/md/en/docs/learn/accounts-addresses-keys.md @@ -20,7 +20,7 @@ The secret seed phrase is important because it can be used to recover access to For most networks, the **public key** associated with an account is how that account is identified on the network and some form of it is used as the destination address for transactions. However, Substrate-based chains use the underlying public key to derive one or more **public addresses**. -Instead of using the public key directly, Substrate allows you generate multiple addresses and address formats for an account. +Instead of using the public key directly, Substrate allows you to generate multiple addresses and address formats for an account. ## Address encoding and chain-specific addresses @@ -74,7 +74,7 @@ For more information about working with generic types, see [Rust for Substrate]( ## Specialized accounts -As a flexible and module framework for blockchain development, Substrate itself doesn't require you define or use any specific type of accounts. +As a flexible and module framework for blockchain development, Substrate itself doesn't require you to define or use any specific type of accounts. However, different chains can implement different rules for how accounts and the keys that control them are used. For example, you might implement specialized accounts if your application requires: diff --git a/content/md/en/docs/learn/transaction-lifecycle.md b/content/md/en/docs/learn/transaction-lifecycle.md index 9f85e1c1b..fdb419855 100644 --- a/content/md/en/docs/learn/transaction-lifecycle.md +++ b/content/md/en/docs/learn/transaction-lifecycle.md @@ -81,8 +81,8 @@ If a transaction is invalid—for example, because it is too large or doesn't co A transaction might be rejected for any of the following reasons: - The transaction has already been included in a block so it is dropped from the verifying queue. -- The transaction's signature is invalid, so it is immediately be rejected. -- The transaction is too large to fit in the current block, so it is be put back in a queue for a new verification round. +- The transaction's signature is invalid, so it is immediately rejected. +- The transaction is too large to fit in the current block, so it is put back in a queue for a new verification round. ## Transactions ordered by priority @@ -136,7 +136,7 @@ Before committing any state changes to storage, the runtime logic should perform Note that [events](/build/events-and-errors/) are also written to storage. Therefore, the runtime logic should not emit an event before performing the complementary actions. -If a transaction fails after an event is emitted, the event is not be reverted. +If a transaction fails after an event is emitted, the event is not reverted. ### Finalizing a block From 212b3df1e4547e2e83efdd99d44052f5c9ae3f7b Mon Sep 17 00:00:00 2001 From: gui Date: Fri, 16 Feb 2024 23:55:21 +0900 Subject: [PATCH 13/39] Update rust-basics.md (#2117) --- content/md/en/docs/learn/rust-basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/learn/rust-basics.md b/content/md/en/docs/learn/rust-basics.md index cb01e8fa1..5ac29bc48 100644 --- a/content/md/en/docs/learn/rust-basics.md +++ b/content/md/en/docs/learn/rust-basics.md @@ -17,7 +17,7 @@ Being the language of choice for Substrate, Rust is a highly performant programm ## Rust in Substrate -In the [Architecture]() section, you will learn that Substrate is made of two distinct architectural components: the outer node and the runtime. +In the [Architecture](/learn/architecture/) section, you will learn that Substrate is made of two distinct architectural components: the outer node and the runtime. While more complex features in Rust such as multithreading and asynchronous Rust are used in the outer node code, they aren't directly exposed to runtime engineers, making it easier for runtime engineers to focus on the business logic of their node. Generally, depending on their focus, developers should expect to know: From d045dba2276f56db168ff9864f2c26f383b06446 Mon Sep 17 00:00:00 2001 From: gui Date: Fri, 16 Feb 2024 23:55:51 +0900 Subject: [PATCH 14/39] Update tx-weights-fees.md (#2120) Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> --- content/md/en/docs/build/tx-weights-fees.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/build/tx-weights-fees.md b/content/md/en/docs/build/tx-weights-fees.md index 7baf13cd2..1a41272e7 100644 --- a/content/md/en/docs/build/tx-weights-fees.md +++ b/content/md/en/docs/build/tx-weights-fees.md @@ -237,12 +237,12 @@ use frame_support:: { Pays::Yes, }, weights::Weight, +}; #[pallet::weight(FunctionOf( |args: (&Vec,)| args.0.len().saturating_mul(10_000), ) ] - fn handle_users(origin, calls: Vec) { // Do something per user } From bf6e465fa98b78bbaa424882796bc4f020b40da6 Mon Sep 17 00:00:00 2001 From: gui Date: Sat, 24 Feb 2024 00:31:44 +0900 Subject: [PATCH 15/39] Update xcm-communication.md (#2132) --- content/md/en/docs/learn/xcm-communication.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/learn/xcm-communication.md b/content/md/en/docs/learn/xcm-communication.md index 3a16dff2b..31f9798c8 100644 --- a/content/md/en/docs/learn/xcm-communication.md +++ b/content/md/en/docs/learn/xcm-communication.md @@ -83,7 +83,7 @@ There are several other registers in the XCVM to handle specific tasks. For example, there's a surplus weight register to store any overestimation of fees and a refunded weight register to store the portion of surplus weight that has been refunded. In general, you can't modify the values stored in the registers directly. Instead, values are set when the XCM executor program starts and are manipulated by specific instructions, under certain circumstances, or according to certain rules. -FOr more information about what's contained in each register, see [XCM reference](/reference/xcm-reference/). +For more information about what's contained in each register, see [XCM reference](/reference/xcm-reference/). ### Configuration From 41b0147c3ced4243a99ad18141a158dc45f92837 Mon Sep 17 00:00:00 2001 From: Kakooza Vianey <35223697+kaksv@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:32:20 +0300 Subject: [PATCH 16/39] Update what-can-you-build.md (#2133) Rectification of some sentences --- content/md/en/docs/learn/what-can-you-build.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/md/en/docs/learn/what-can-you-build.md b/content/md/en/docs/learn/what-can-you-build.md index 490a6bbef..31245c79c 100644 --- a/content/md/en/docs/learn/what-can-you-build.md +++ b/content/md/en/docs/learn/what-can-you-build.md @@ -92,7 +92,7 @@ Individual pallets are typically easy to develop by using FRAME and easy for Sub ### Writing correct code -It's worth noting that pallets don't inherently provide any of type of protection or safeguards that smart contracts provide. +It's worth noting that pallets don't inherently provide any type of protection or safeguards that smart contracts provide. With pallets, you control the logic available for runtime developers to implement. You provide the methods, storage items, events, and errors that your module requires. Pallets don't inherently introduce a fee or metering system. @@ -101,7 +101,7 @@ This lack of built-in safeguards implies that you have a great deal of responsib ### Pallets outside of runtime development -Often, writing a pallet is the gateway to runtime development, giving you the opportunity to experiment with existing pallets and coding patterns without building a compete blockchain application. +Often, writing a pallet is the gateway to runtime development, giving you the opportunity to experiment with existing pallets and coding patterns without building a complete blockchain application. Individual pallets also provide an alternative way you can contribute to a project without writing your own application. Although writing and testing pallets is typically a stepping stone to building larger scale application, there are many examples of the value individual pallets can have to the ecosystem as a whole. @@ -170,7 +170,7 @@ The only requirement is that your parachain or parathread must be compatible wit ### Planning parachain resource requirements -As a parachain, your project can offer functionality to a broader community in a more secure way that a private chain or a solo chain. +As a parachain, your project can offer functionality to a broader community in a more secure way than a private chain or a solo chain. However, if you want to build a production-ready parachain, you should keep the following additional requirements in mind: - You'll need a development team with sufficient skills and experience, whether that means programming in Rust or a background in UX design. @@ -196,7 +196,7 @@ For example, building a parachain might be the best option for the following use - Digital wallets - Internet of things (IOT) applications - Gaming applications -- Web 3.0 infrastructureM +- Web 3.0 infrastructure ### Explore building a parachain From c77fabb9ada65fe93cb80c9481d3ca3d5e50ede2 Mon Sep 17 00:00:00 2001 From: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Date: Tue, 27 Feb 2024 11:42:43 +0000 Subject: [PATCH 17/39] deprecate origin page (#2131) --- content/md/en/docs/build/origins.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/md/en/docs/build/origins.md b/content/md/en/docs/build/origins.md index c0b9874c4..66d4da804 100644 --- a/content/md/en/docs/build/origins.md +++ b/content/md/en/docs/build/origins.md @@ -5,6 +5,10 @@ keywords: - origins --- +
+ ⚠️ WARNING: This page contains outdated information. Please refer to the Rust docs for the most up-to-date documentation on this topic. +
+ The runtime origin is used by dispatchable functions to check where a call has come from. ## Raw origins From 442fe1cbfe51f37107146aad6622f7f3f6dbc832 Mon Sep 17 00:00:00 2001 From: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:45:13 +0000 Subject: [PATCH 18/39] (soft) deprecate ocw related pages (#2136) * (soft) deprecate ocw-related pages * add more --- .../md/en/docs/learn/offchain-operations.md | 9 +++++ .../how-to-guides/offchain-workers/index.md | 13 ++++++- .../offchain-http-requests.md | 9 +++++ .../offchain-workers/offchain-indexing.md | 9 +++++ .../offchain-local-storage.md | 9 +++++ .../add-offchain-workers.md | 39 ++++++++++++------- 6 files changed, 71 insertions(+), 17 deletions(-) diff --git a/content/md/en/docs/learn/offchain-operations.md b/content/md/en/docs/learn/offchain-operations.md index 9fa41956f..2161626d1 100644 --- a/content/md/en/docs/learn/offchain-operations.md +++ b/content/md/en/docs/learn/offchain-operations.md @@ -4,6 +4,15 @@ description: Highlights how you can integrate data from offchain sources into th keywords: --- +
+

+ ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. +

+

+ Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. +

+
+ There are many use cases where you might want to query data from an offchain source or process data without using on-chain resources before updating the on-chain state. The conventional way of incorporating offchain data involves connecting to [oracles](/reference/glossary#oracle) to supply the data from some traditional source. Although using oracles is one approach to working with offchain data sources, there are limitations to the security, scalability, and infrastructure efficiency that oracles can provide. diff --git a/content/md/en/docs/reference/how-to-guides/offchain-workers/index.md b/content/md/en/docs/reference/how-to-guides/offchain-workers/index.md index 82725688a..5b93d9815 100644 --- a/content/md/en/docs/reference/how-to-guides/offchain-workers/index.md +++ b/content/md/en/docs/reference/how-to-guides/offchain-workers/index.md @@ -4,13 +4,22 @@ description: Quick reference guides that illustrate how to use offchain workers. keywords: --- +
+

+ ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. +

+

+ Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. +

+
+ The _How-to_ guides in the _Offchain workers_ category illustrate common use cases for offchain operations. - [Make offchain HTTP requests](/reference/how-to-guides/offchain-workers/offchain-http-requests/) - [Offchain local storage](/reference/how-to-guides/offchain-workers/offchain-local-storage/) - [Offchain indexing](/reference/how-to-guides/offchain-workers/offchain-indexing/) -It is important to note that offchain storage is separate from on-chain storage. +It is important to note that offchain storage is separate from on-chain storage. You can't send data collected or processed by an offchain worker directly to on-chain storage. To store any data collected or processed by an offchain worker—that is, to modify the state of the chain—you must enable the offchain worker to send transactions that modify the on-chain storage system. -For examples of how to prepare an offchain worker to send transactions, see [Add offchain workers](/tutorials/build-application-logic/add-offchain-workers/). \ No newline at end of file +For examples of how to prepare an offchain worker to send transactions, see [Add offchain workers](/tutorials/build-application-logic/add-offchain-workers/). diff --git a/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-http-requests.md b/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-http-requests.md index a35de4b48..d49818e6e 100644 --- a/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-http-requests.md +++ b/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-http-requests.md @@ -9,6 +9,15 @@ keywords: - requests --- +
+

+ ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. +

+

+ Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. +

+
+ Because most blockchains can't access data that's hosted on servers outside of their own network, they typically use external third-party services—**oracles**—to pull information in from or push information out to locations that are outside of the network. For Substrate-based blockchains, **offchain workers** (OCW) provide similar capabilities, but with the advantage of being able to access on-chain state. diff --git a/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-indexing.md b/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-indexing.md index 4b5ff5cf8..acfb76126 100644 --- a/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-indexing.md +++ b/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-indexing.md @@ -7,6 +7,15 @@ keywords: - indexing --- +
+

+ ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. +

+

+ Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. +

+
+ This guide will step you through how to pass data from an extrinsic to an offchain worker without writing to storage. Occasionally on-chain extrinsics need to pass data to offchain workers with predictable write behavior. diff --git a/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-local-storage.md b/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-local-storage.md index 3a5373178..b5d0ebf9f 100644 --- a/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-local-storage.md +++ b/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-local-storage.md @@ -8,6 +8,15 @@ keywords: - storage --- +
+

+ ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. +

+

+ Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. +

+
+ This guide will teach you how to use an offchain worker to save retrieved data in local storage for future access. In the last section, we mentioned that offchain workers (**OCW** for short) cannot modify the blockchain state directly, so they have to submit transactions to save their computed results back on-chain. diff --git a/content/md/en/docs/tutorials/build-application-logic/add-offchain-workers.md b/content/md/en/docs/tutorials/build-application-logic/add-offchain-workers.md index a253a3f0b..a7b1ced2c 100644 --- a/content/md/en/docs/tutorials/build-application-logic/add-offchain-workers.md +++ b/content/md/en/docs/tutorials/build-application-logic/add-offchain-workers.md @@ -11,6 +11,15 @@ keywords: - signed payload --- +
+

+ ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. +

+

+ Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. +

+
+ This tutorial illustrates how to modify a pallet to include an offchain worker and configure the pallet and runtime to enable the offchain worker to submit transactions that update the on-chain state. ## Using offchain workers @@ -39,7 +48,7 @@ It is also important to consider that even an unsigned transaction with a signed In most cases, checking whether a transaction was submitted by an offchain worker before writing to storage isn't sufficient to protect the network. Instead of assuming that the offchain worker can be trusted without safeguards, you should intentionally set restrictive permissions that limit access to the process and what it can do. -Remember that unsigned transactions are essentially an **open door** into your runtime. +Remember that unsigned transactions are essentially an **open door** into your runtime. You should only use them after careful consideration of the conditions under which they should be allowed to execute. Without safeguards, malicious actors could impersonate offchain workers and access runtime storage. @@ -80,7 +89,7 @@ To enable offchain workers to send signed transactions: 1. Open the `src/lib.rs` file for your pallet in a text editor. 2. Add the `#[pallet::hooks]` macro and the entry point for offchain workers to the code. - + For example: ```rust @@ -170,7 +179,7 @@ To enable offchain workers to send signed transactions: } ``` - This code enables you to retrieve all signers that this pallet owns. + This code enables you to retrieve all signers that this pallet owns. 8. Use `send_signed_transaction()` to create a signed transaction call: @@ -214,7 +223,7 @@ To enable offchain workers to send signed transactions: 1. Open the `runtime/src/lib.rs` file for the node template in a text editor. 1. Add the `AuthorityId` to the configuration for your pallet and make sure it uses the `TestAuthId` from the `crypto` module: - + ```rust impl pallet_your_ocw_pallet::Config for Runtime { // ... @@ -232,7 +241,7 @@ To enable offchain workers to send signed transactions: ```rust use codec::Encode; use sp_runtime::{generic::Era, SaturatedConversion}; - + // ... impl frame_system::offchain::CreateSignedTransaction for Runtime @@ -321,7 +330,7 @@ Updating the runtime involved the following steps: - Adding the `AuthorityId` to the runtime configuration for your pallet. - Implementing the `CreateSignedTransaction` trait and `create_transaction()` function. - Implementing `SigningTypes` and `SendTransactionTypes` for offchain workers from the `frame_system` pallet. - + However, before your pallet offchain workers can submit signed transactions, you must specify at least one account for the offchain worker to use. To enable the offchain worker to sign transactions, you must generate the account key for the pallet to own and add that key to the node keystore. @@ -352,7 +361,7 @@ pub fn new_partial(config: &Configuration) -> Result { This example manually adds the key for the `Alice` account to the keystore identified by the `KEY_TYPE` defined in your pallet. For a working example, see this sample [service.rs](https://github.com/jimmychu0807/substrate-offchain-worker-demo/blob/v2.0.0/node/src/service.rs#L87-L105) file. -### Using other accounts +### Using other accounts In a production environment, you can use other tools—such as `subkey`—to generate keys that are specifically for offchain workers to use. After you generate one or more keys for offchain workers to own, you can add them to the node keystore by: @@ -361,9 +370,9 @@ After you generate one or more keys for offchain workers to own, you can add the - Passing parameters using the `author_insertKey` RPC method. For example, you can use the [Polkadot/Substrate Portal](https://polkadot.js.org/apps/#/rpc), Polkadot-JS API, or a `curl` command to select the `author_insertKey` method and specify the key type, secret phrase, and public key parameters for the account to use: - + ![Use the `author_insertKey` method to insert an account](/media/images/docs/author_insertKey.png) - + Note that the keyType parameter `demo` in this example matches the `KEY_TYPE` declared in the offchain worker pallet. Now, your pallet is ready to send signed transactions on-chain from offchain workers. @@ -373,11 +382,11 @@ Now, your pallet is ready to send signed transactions on-chain from offchain wor By default, all unsigned transactions are rejected in Substrate. To enable Substrate to accept certain unsigned transactions, you must implement the `ValidateUnsigned` trait for the pallet. -Although you must implement the `ValidateUnsigned` trait to send unsigned transactions, this check doesn't guarantee that **only** offchain workers are able to send the transaction. +Although you must implement the `ValidateUnsigned` trait to send unsigned transactions, this check doesn't guarantee that **only** offchain workers are able to send the transaction. You should always consider the consequences of malicious actors sending these transactions as an attempt to tamper with the state of your chain. Unsigned transactions always represent a potential attack vector that a malicious user could exploit and offchain workers can't be assumed to be a reliable source without additional safeguards. -You should never assume that unsigned transactions can only be submitted by an offchain worker. +You should never assume that unsigned transactions can only be submitted by an offchain worker. By definition, **anyone** can submit them. ### Configure the pallet @@ -386,7 +395,7 @@ To enable offchain workers to send unsigned transactions: 1. Open the `src/lib.rs` file for your pallet in a text editor. 2. Add the [`validate_unsigned`](https://paritytech.github.io/substrate/master/frame_support/attr.pallet.html#validate-unsigned-palletvalidate_unsigned-optional) macro. - + For example: ```rust @@ -420,7 +429,7 @@ To enable offchain workers to send unsigned transactions: ``` 2. Check the calling extrinsics to determine if the call is allowed and return `ValidTransaction` if the call is allowed or `TransactionValidityError` if the call is not allowed. - + For example: ```rust @@ -598,10 +607,10 @@ To make your data structure signable: ``` This example uses [`SignedPayload`](https://paritytech.github.io/substrate/master/frame_system/offchain/trait.SignedPayload.html) to verify that the public key in the payload has the same signature as the one provided. - However, you should note that the code in the example only checks whether the provided `signature` is valid for the `public` key contained inside `payload`. + However, you should note that the code in the example only checks whether the provided `signature` is valid for the `public` key contained inside `payload`. This check doesn't validate whether the signer is an offchain worker or authorized to call the specified function. This simple check wouldn't prevent an unauthorized actor from using the signed payload to modify state. - + For working examples of this code, see the [offchain function call](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/examples/offchain-worker/src/lib.rs#L508-L536) and the implementation of [`ValidateUnsigned`](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/examples/offchain-worker/src/lib.rs#L305-L329). ## Where to go next From 426da5515c55bb12469ccad3468b834fc070577f Mon Sep 17 00:00:00 2001 From: Francisco Aguirre Date: Fri, 1 Mar 2024 12:57:00 +0100 Subject: [PATCH 19/39] Add deprecated banner to xcm reference and link to rust docs (#2137) * feat(xcm-reference): add deprecated banner and link to rust docs * small change --------- Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> --- content/md/en/docs/reference/xcm-reference.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/content/md/en/docs/reference/xcm-reference.md b/content/md/en/docs/reference/xcm-reference.md index 504dd6f01..74ba23bc0 100644 --- a/content/md/en/docs/reference/xcm-reference.md +++ b/content/md/en/docs/reference/xcm-reference.md @@ -8,6 +8,15 @@ keywords: - errors --- +
+

+ ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. +

+

+ Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. +

+
+ This section provides reference information for the cross-consensus message (XCM) format. ## Instructions From aa316cbc4fe780cd79a14da8536f9d291f105a6b Mon Sep 17 00:00:00 2001 From: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Date: Wed, 6 Mar 2024 18:26:45 +0000 Subject: [PATCH 20/39] deprecate pages related to pallet coupling (#2139) --- content/md/en/docs/build/pallet-coupling.md | 9 ++++ .../pallet-design/use-loose-coupling.md | 53 +++++++++++-------- .../pallet-design/use-tight-coupling.md | 9 ++++ 3 files changed, 49 insertions(+), 22 deletions(-) diff --git a/content/md/en/docs/build/pallet-coupling.md b/content/md/en/docs/build/pallet-coupling.md index 4a1db10c1..9e900a4bc 100644 --- a/content/md/en/docs/build/pallet-coupling.md +++ b/content/md/en/docs/build/pallet-coupling.md @@ -6,6 +6,15 @@ keywords: - pallet design --- +
+

+ ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. +

+

+ Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. +

+
+ The term **coupling** is often used to describe the degree to which two software modules depend on each other. For example, in object-oriented programming tight coupling and loose coupling are used to describe the relationship between objects classes: diff --git a/content/md/en/docs/reference/how-to-guides/pallet-design/use-loose-coupling.md b/content/md/en/docs/reference/how-to-guides/pallet-design/use-loose-coupling.md index acfbd81fd..0c9ae3286 100644 --- a/content/md/en/docs/reference/how-to-guides/pallet-design/use-loose-coupling.md +++ b/content/md/en/docs/reference/how-to-guides/pallet-design/use-loose-coupling.md @@ -4,6 +4,15 @@ description: keywords: --- +
+

+ ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. +

+

+ Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. +

+
+ This guide demonstrates how to reuse a function or type from one pallet in another pallet using a technique called **loose coupling**. Loose coupling enables you to reuse part of the logic defined in an external pallet inside your current pallet. @@ -27,28 +36,28 @@ In this example, you are reusing `Currency` trait information from the `frame-su To configure your workspace manifest: 1. Open a terminal shell on your computer and navigate to the root directory for your project. - + 2. Open the manifest `Cargo.toml` file in a text editor. - + 3. Add the you are loosely coupling with to the dependencies. - + For example: - + ```text [dependencies] frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0"} ``` - + Note that you should use the same branch and version information for all of the pallets to ensure that the imported pallets are compatible with each other. Using pallets from different branches can result in compiler errors. This example illustrates adding the `frame-support` pallet to the `Cargo.toml` file if the other pallets use `branch = "polkadot-v1.0.0"`. - + Because the build process compiles both a standard binary and the WebAssembly target, you must also include `frame-support/std` in the features for your pallet. 1. Add `frame-support/std` to the `std` features for your pallet. - + For example: - + ```text [features] default = ["std"] @@ -66,11 +75,11 @@ In this example, you want to use the [`Currency`](https://paritytech.github.io/s To import a trait from another pallet: 1. Open a terminal shell on your computer and navigate to the root directory for your project. - + 2. Open the `src/lib.rs` file for your current pallet in a text editor. - + 3. Import the `Currency` trait by adding the following line: - + ```rust use frame_support::traits::Currency; ``` @@ -84,13 +93,13 @@ The next step is to create a type that is bound by the type you want to expose i To update the configuration trait for your pallet: 1. Open a terminal shell on your computer and navigate to the root directory for your project. - + 2. Open the `src/lib.rs` file for your current pallet in a text editor. - + 3. Create a type to use in your pallet that is bound by the type you want to access in the external pallet: For example: - + ```rust pub trait Config: frame_system::Config { // --snip-- @@ -101,14 +110,14 @@ To update the configuration trait for your pallet: ``` 5. Use a method that the trait of your loosely-coupled pallet provides with the type you've created to access the method. - + For example: ```rust // Use the getter from `my-pallet` let total_balance = T::LocalCurrency::total_issuance(); ``` - + In this example, [`total_issuance`](https://paritytech.github.io/substrate/master/frame_support/traits/tokens/currency/trait.Currency.html#tymethod.total_issuance) is a method that the `Currency` trait exposes from the `frame_support` pallet. 1. Save your changes and close the `src/lib.rs` file for your project. @@ -120,11 +129,11 @@ After you have completed the updates in your project, you are ready to implement To update the runtime configuration for your pallet: 1. Open a terminal shell on your computer and navigate to the root directory for the node template. - + 2. Open the `runtime/src/lib.rs` file in a text editor. 1. Add the runtime configuration for your pallet to specify the `LocalCurrency` type to use the implementation defined for the `Balances` pallet. - + ```rust impl my_pallet::Config for Runtime { type LocalCurrency = Balances; @@ -132,7 +141,7 @@ To update the runtime configuration for your pallet: ``` 1. Check the `Balances` definition inside `construct_runtime!` macro. - + ```rust construct_runtime! ( pub enum Runtime where @@ -146,13 +155,13 @@ To update the runtime configuration for your pallet: ``` In this example, your pallet can inherit the implementation of the `Currency` trait from the [`pallet_balances`](https://paritytech.github.io/substrate/master/pallet_balances/index.html#implementations-1) pallet and access methods from the loosely-coupled `frame-support` pallet. - - By default, the `construct_runtime!` macro includes all pallet attributes for all pallets listed in the macro definition. + + By default, the `construct_runtime!` macro includes all pallet attributes for all pallets listed in the macro definition. ## Examples - [`EnsureOrigin`](https://paritytech.github.io/substrate/master/frame_support/traits/trait.EnsureOrigin.html) trait in the [Democracy pallet](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/democracy/src/lib.rs#L298-L335) -- [Weighting methods](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/identity/src/weights.rs#L46-L64) in the [Identity pallet](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/identity/src/lib.rs#L149-L151). +- [Weighting methods](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/identity/src/weights.rs#L46-L64) in the [Identity pallet](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/identity/src/lib.rs#L149-L151). -[`KeyOwnerProofSystem`](https://paritytech.github.io/substrate/master/frame_support/traits/trait.KeyOwnerProofSystem.html) in [Grandpa pallet](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/grandpa/src/lib.rs#L106). ## Resources diff --git a/content/md/en/docs/reference/how-to-guides/pallet-design/use-tight-coupling.md b/content/md/en/docs/reference/how-to-guides/pallet-design/use-tight-coupling.md index 73c55f0cc..c2031b9ac 100644 --- a/content/md/en/docs/reference/how-to-guides/pallet-design/use-tight-coupling.md +++ b/content/md/en/docs/reference/how-to-guides/pallet-design/use-tight-coupling.md @@ -4,6 +4,15 @@ description: keywords: --- +
+

+ ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. +

+

+ Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. +

+
+ Tight coupling two pallets is a technique to write pallets that re-use types and methods from an existing pallet. It is useful for breaking up some runtime logic into separate pallets that need access to common type and methods. From bac6bafd8d6bfa3b1bea2ecdef80360f73e02dbf Mon Sep 17 00:00:00 2001 From: Maksym H <1177472+mordamax@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:29:50 +0100 Subject: [PATCH 21/39] Update acquire-a-testnet-slot.md (#2141) * Update acquire-a-testnet-slot.md Suggest by default to use web version of faucet (as more easier and faster) keeping matrix as an alternative * Update acquire-a-testnet-slot.md --- .../build-a-parachain/acquire-a-testnet-slot.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/content/md/en/docs/tutorials/build-a-parachain/acquire-a-testnet-slot.md b/content/md/en/docs/tutorials/build-a-parachain/acquire-a-testnet-slot.md index 24a07707e..b4148bdc9 100644 --- a/content/md/en/docs/tutorials/build-a-parachain/acquire-a-testnet-slot.md +++ b/content/md/en/docs/tutorials/build-a-parachain/acquire-a-testnet-slot.md @@ -45,13 +45,10 @@ To prepare an account: 1. Click **Save**. -2. Join the [Rococo Element channel](https://matrix.to/#/#rococo-faucet:matrix.org) and send a message with`!drip` and the public address for your Rococo to get 100 ROC in your wallet. +2. Go to https://faucet.polkadot.io, provide your public address in the form input and submit to get 100 ROC tokens in your wallet. - For example, send a message similar to the following: - - ```text - !drip 5CVYesFxbDBU5rkZXYTAA6BnADbCoSpQkvexBQZvbtvyGTP1 - ``` + > Alternatively you can join the [Rococo Element channel](https://matrix.to/#/#rococo-faucet:matrix.org) and send a message with`!drip` and the public address for your Rococo to get 100 ROC in your wallet. + > For example, send a message similar to the following: `!drip 5CVYesFxbDBU5rkZXYTAA6BnADbCoSpQkvexBQZvbtvyGTP1` ## Reserve a parachain identifier From 2b7950b922f938f1d0107cd32d16d1cb51de88bc Mon Sep 17 00:00:00 2001 From: Pierre Besson <513471+PierreBesson@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:02:54 +0200 Subject: [PATCH 22/39] remove all links to Substrate Marketplace (#2147) --- README.md | 1 - config/menus.js | 6 +----- config/siteMetadata.js | 3 +-- config/webConsts.js | 2 -- content/locales/en/menus.json | 1 - example.env.development | 1 - example.env.production | 1 - 7 files changed, 2 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e8bcd06e2..971c4ac88 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,6 @@ Default localhost port configuration: ```env GATSBY_WEBSITE_URL=http://localhost:8100 GATSBY_DOCS_URL=http://localhost:8200 -GATSBY_MARKETPLACE_URL=http://localhost:8300 GATSBY_CAREERS_URL=https://careers.substrate.io ``` diff --git a/config/menus.js b/config/menus.js index 38f84a0a5..a7faa1384 100644 --- a/config/menus.js +++ b/config/menus.js @@ -1,4 +1,4 @@ -const { MARKETPLACE_URL, WEBSITE_URL, CAREERS_URL } = require('./webConsts.js'); +const { WEBSITE_URL, CAREERS_URL } = require('./webConsts.js'); /* the main menu, ids of items must match the submenu's key of this js object */ @@ -58,10 +58,6 @@ const developers = [ url: 'https://paritytech.github.io/substrate/master/sc_service/', id: 'developers.rustdocs', }, - { - url: MARKETPLACE_URL, - id: 'developers.marketplace', - }, { url: WEBSITE_URL + '/developers/smart-contracts/', id: 'developers.smart-contracts', diff --git a/config/siteMetadata.js b/config/siteMetadata.js index 6b2ca8a85..4a09c6e2b 100644 --- a/config/siteMetadata.js +++ b/config/siteMetadata.js @@ -1,5 +1,5 @@ const menus = require('./menus.js'); -const { WEBSITE_URL, DOCS_URL, MARKETPLACE_URL, CAREERS_URL } = require('./webConsts.js'); +const { WEBSITE_URL, DOCS_URL, CAREERS_URL } = require('./webConsts.js'); module.exports = { menus, @@ -10,7 +10,6 @@ module.exports = { siteUrl: DOCS_URL, websiteUrl: WEBSITE_URL, docsUrl: DOCS_URL, - marketplaceUrl: MARKETPLACE_URL, careersUrl: CAREERS_URL, author: 'Parity WebDev/W3F WebOps', pressEmail: 'press@parity.io', diff --git a/config/webConsts.js b/config/webConsts.js index 577ba7830..2db4ea306 100644 --- a/config/webConsts.js +++ b/config/webConsts.js @@ -1,11 +1,9 @@ const WEBSITE_URL = process.env.GATSBY_WEBSITE_URL; const DOCS_URL = process.env.GATSBY_DOCS_URL; -const MARKETPLACE_URL = process.env.GATSBY_MARKETPLACE_URL; const CAREERS_URL = process.env.GATSBY_CAREERS_URL; module.exports = { WEBSITE_URL, DOCS_URL, - MARKETPLACE_URL, CAREERS_URL, }; diff --git a/content/locales/en/menus.json b/content/locales/en/menus.json index c0997a77c..5f6748551 100644 --- a/content/locales/en/menus.json +++ b/content/locales/en/menus.json @@ -14,7 +14,6 @@ "developers.home": "Home", "developers.docs": "Docs", "developers.rustdocs": "Rust Docs", - "developers.marketplace": "Marketplace", "developers.smart-contracts": "Smart Contracts", "developers.substrate-connect": "Substrate Connect", "developers.rococo-network": "Rococo Network", diff --git a/example.env.development b/example.env.development index 92b603266..66cac48e7 100644 --- a/example.env.development +++ b/example.env.development @@ -1,4 +1,3 @@ # GATSBY_WEBSITE_URL=http://localhost:8100 # GATSBY_DOCS_URL=http://localhost:8200 -# GATSBY_MARKETPLACE_URL=http://localhost:8300 # GATSBY_CAREERS_URL=https://careers.substrate.io diff --git a/example.env.production b/example.env.production index 92b603266..66cac48e7 100644 --- a/example.env.production +++ b/example.env.production @@ -1,4 +1,3 @@ # GATSBY_WEBSITE_URL=http://localhost:8100 # GATSBY_DOCS_URL=http://localhost:8200 -# GATSBY_MARKETPLACE_URL=http://localhost:8300 # GATSBY_CAREERS_URL=https://careers.substrate.io From 62a81570d7b5bfd11ceabd530f7aaad388eb998e Mon Sep 17 00:00:00 2001 From: Carina <60577717+carinaluise@users.noreply.github.com> Date: Wed, 15 May 2024 00:01:29 +0700 Subject: [PATCH 23/39] remove careers.substrate links (#2152) * remove careers.substrate links * remove from readme --- README.md | 1 - config/menus.js | 6 +----- config/siteMetadata.js | 3 +-- config/webConsts.js | 2 -- content/locales/en/menus.json | 1 - example.env.development | 1 - example.env.production | 1 - 7 files changed, 2 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 971c4ac88..d55cbc7b1 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,6 @@ Default localhost port configuration: ```env GATSBY_WEBSITE_URL=http://localhost:8100 GATSBY_DOCS_URL=http://localhost:8200 -GATSBY_CAREERS_URL=https://careers.substrate.io ``` **Start development server** diff --git a/config/menus.js b/config/menus.js index a7faa1384..9bde95b39 100644 --- a/config/menus.js +++ b/config/menus.js @@ -1,4 +1,4 @@ -const { WEBSITE_URL, CAREERS_URL } = require('./webConsts.js'); +const { WEBSITE_URL } = require('./webConsts.js'); /* the main menu, ids of items must match the submenu's key of this js object */ @@ -124,10 +124,6 @@ const opportunities = [ url: WEBSITE_URL + '/ecosystem/opportunities/grants', id: 'ecosystem.opportunities.grants', }, - { - url: CAREERS_URL, - id: 'ecosystem.opportunities.careers', - }, ]; const resources = [ diff --git a/config/siteMetadata.js b/config/siteMetadata.js index 4a09c6e2b..9e090d5b3 100644 --- a/config/siteMetadata.js +++ b/config/siteMetadata.js @@ -1,5 +1,5 @@ const menus = require('./menus.js'); -const { WEBSITE_URL, DOCS_URL, CAREERS_URL } = require('./webConsts.js'); +const { WEBSITE_URL, DOCS_URL } = require('./webConsts.js'); module.exports = { menus, @@ -10,7 +10,6 @@ module.exports = { siteUrl: DOCS_URL, websiteUrl: WEBSITE_URL, docsUrl: DOCS_URL, - careersUrl: CAREERS_URL, author: 'Parity WebDev/W3F WebOps', pressEmail: 'press@parity.io', email: 'info@parity.io', diff --git a/config/webConsts.js b/config/webConsts.js index 2db4ea306..014af96c5 100644 --- a/config/webConsts.js +++ b/config/webConsts.js @@ -1,9 +1,7 @@ const WEBSITE_URL = process.env.GATSBY_WEBSITE_URL; const DOCS_URL = process.env.GATSBY_DOCS_URL; -const CAREERS_URL = process.env.GATSBY_CAREERS_URL; module.exports = { WEBSITE_URL, DOCS_URL, - CAREERS_URL, }; diff --git a/content/locales/en/menus.json b/content/locales/en/menus.json index 5f6748551..2e668276f 100644 --- a/content/locales/en/menus.json +++ b/content/locales/en/menus.json @@ -30,7 +30,6 @@ "ecosystem.opportunities.hackathons": "Hackathons", "ecosystem.opportunities.grants": "Grants", - "ecosystem.opportunities.careers": "Careers", "ecosystem.resources.seminar": "Substrate Seminar", "ecosystem.resources.past-seminars": "Past Seminars", diff --git a/example.env.development b/example.env.development index 66cac48e7..ee31fa503 100644 --- a/example.env.development +++ b/example.env.development @@ -1,3 +1,2 @@ # GATSBY_WEBSITE_URL=http://localhost:8100 # GATSBY_DOCS_URL=http://localhost:8200 -# GATSBY_CAREERS_URL=https://careers.substrate.io diff --git a/example.env.production b/example.env.production index 66cac48e7..ee31fa503 100644 --- a/example.env.production +++ b/example.env.production @@ -1,3 +1,2 @@ # GATSBY_WEBSITE_URL=http://localhost:8100 # GATSBY_DOCS_URL=http://localhost:8200 -# GATSBY_CAREERS_URL=https://careers.substrate.io From 5416c44427d4e60563b796ae332a36f405c1d26c Mon Sep 17 00:00:00 2001 From: Javier Viola <363911+pepoviola@users.noreply.github.com> Date: Wed, 5 Jun 2024 20:10:13 +0200 Subject: [PATCH 24/39] Update set-up-a-test-network.md (#2156) Add cmd to copy the workers --- content/md/en/docs/test/set-up-a-test-network.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/md/en/docs/test/set-up-a-test-network.md b/content/md/en/docs/test/set-up-a-test-network.md index 301a37003..7f6c2013c 100644 --- a/content/md/en/docs/test/set-up-a-test-network.md +++ b/content/md/en/docs/test/set-up-a-test-network.md @@ -53,7 +53,7 @@ To prepare a working folder with the binaries for the test network: Release branches use the naming convention `release-v`. For example, the release branch used in this tutorial is `release-v1.0.0`. You can check out a more recent release branch instead of using `release-v1.0.0`. - You can find information about recent releases and what's included in each release on the [Releases](https://github.com/paritytech/polkadot/releases) tab. + You can find information about recent releases and what's included in each release on the [Releases](https://github.com/paritytech/polkadot-sdk/releases) tab. 1. Change to the root of the `polkadot` directory by running the following command: @@ -69,10 +69,11 @@ To prepare a working folder with the binaries for the test network: Compiling the node can take 15 to 60 minuets to complete. -1. Copy the Polkadot binary into your working `bin` folder by running a command similar to the following: +1. Copy the Polkadot binary and workers into your working `bin` folder by running a command similar to the following: ```bash cp ./target/release/polkadot ../bin/polkadot-v1.0.0 + cp ./target/release/polkadot-*-worker ../bin/ ``` As this example illustrates, it's generally a good practice to append the version of `polkadot` to the binary name to keep the files in the `bin` folder organized. From 96feb8d0b8bae50b940c90a0dee9cd0e14f46430 Mon Sep 17 00:00:00 2001 From: Dominique Date: Wed, 24 Jul 2024 11:17:05 +0200 Subject: [PATCH 25/39] Update Postman docs link in explore-sidecar-endpoints.md (#2155) Update Postman Collection link so that it includes the full docs (path params, query params, etc) in all the endpoints --- .../tutorials/integrate-with-tools/explore-sidecar-endpoints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/tutorials/integrate-with-tools/explore-sidecar-endpoints.md b/content/md/en/docs/tutorials/integrate-with-tools/explore-sidecar-endpoints.md index 2b8305804..0d62e67d5 100644 --- a/content/md/en/docs/tutorials/integrate-with-tools/explore-sidecar-endpoints.md +++ b/content/md/en/docs/tutorials/integrate-with-tools/explore-sidecar-endpoints.md @@ -94,7 +94,7 @@ To download and install `sidecar`: To use the predefined API collection for `sidecar`: -1. Open the predefined [Substrate API Sidecar](https://documenter.getpostman.com/view/24602305/2s8YsqWaj8#intro) API collection in a browser. +1. Open the predefined [Substrate API Sidecar](https://documenter.getpostman.com/view/21393319/2sA3Qs9C9M#intro) API collection in a browser. 2. Click **Run in Postman** in the top-right corner of the page. 3. Select to run the collection either using Postman for Web or in the Postman for Mac desktop client. From 47aa6d8addc4d94890d58a63553243274b5c2093 Mon Sep 17 00:00:00 2001 From: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Date: Thu, 25 Jul 2024 11:03:43 +0100 Subject: [PATCH 26/39] RPC deprecation --- content/md/en/docs/build/remote-procedure-calls.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/md/en/docs/build/remote-procedure-calls.md b/content/md/en/docs/build/remote-procedure-calls.md index 32027e13e..ec2e49c23 100644 --- a/content/md/en/docs/build/remote-procedure-calls.md +++ b/content/md/en/docs/build/remote-procedure-calls.md @@ -6,6 +6,10 @@ keywords: - frontend --- +
+ ⚠️ WARNING: This page may contain outdated information. Please refer to the Rust docs for the most up-to-date documentation on this topic. +
+ Remote procedure calls, or RPC methods, are a way for an external program—for example, a browser or front-end application—to communicate with a Substrate node. In general, these methods enable an RPC client to connect to an RPC server endpoint to request some type of service. For example, you might use an RPC method to read a stored value, submit a transaction, or request information about the chain a node is connected to. From 1c9dc8758bc45a7c1ea1429f5ecd339c5cbd3556 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Mon, 29 Jul 2024 16:25:37 +0200 Subject: [PATCH 27/39] Minimal changes to fix pallet tutorial (#2169) Signed-off-by: Oliver Tale-Yazdi --- content/md/en/docs/learn/runtime-development.md | 1 - content/md/en/docs/reference/frame-macros.md | 10 ---------- .../collectibles-workshop/03-create-pallet.md | 9 +++++---- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/content/md/en/docs/learn/runtime-development.md b/content/md/en/docs/learn/runtime-development.md index 67b66c68a..a86ad8b89 100644 --- a/content/md/en/docs/learn/runtime-development.md +++ b/content/md/en/docs/learn/runtime-development.md @@ -139,7 +139,6 @@ pub mod pallet { // Declare the pallet type // This is a placeholder to implement traits and methods. #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); // Add the runtime configuration trait diff --git a/content/md/en/docs/reference/frame-macros.md b/content/md/en/docs/reference/frame-macros.md index 6f5d3c864..800ebd726 100644 --- a/content/md/en/docs/reference/frame-macros.md +++ b/content/md/en/docs/reference/frame-macros.md @@ -256,15 +256,6 @@ For example: pub struct Pallet(_); ``` -This macro can generate the `Store` trait to contain an associated type for each storage item if you provide the `#[pallet::generate_store($vis trait Store)]` attribute macro. - -For example: - -```rust -#[pallet::pallet] -pub struct Pallet(_); -``` - For more information about working with storage and this macro, see the [macro expansion](https://paritytech.github.io/substrate/master/frame_support/attr.pallet.html#macro-expansion-1) added to the `struct Pallet` definition. ### #[pallet::without\_storage\_info] @@ -279,7 +270,6 @@ To use it, add the `#[pallet::without_storage_info]` attribute to the pallet str ```rust #[pallet::pallet] -#[pallet::generate_store(pub(super) trait Store)] #[pallet::without_storage_info] pub struct Pallet(_); ``` diff --git a/content/md/en/docs/tutorials/collectibles-workshop/03-create-pallet.md b/content/md/en/docs/tutorials/collectibles-workshop/03-create-pallet.md index 9ac715ec1..d853ccac7 100644 --- a/content/md/en/docs/tutorials/collectibles-workshop/03-create-pallet.md +++ b/content/md/en/docs/tutorials/collectibles-workshop/03-create-pallet.md @@ -3,6 +3,8 @@ title: Create a new pallet tutorial: 1 --- +> ⚠️ This tutorial is out-of-date any may not work as intended. Please refer to [`Polkadot SDK Docs`](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html) for up-to-date information. + In this workshop, you'll learn how to create a custom Substrate module-called a pallet-that's going to contain the code for your application-specific blockchain. Pallets are built using FRAME libraries and the Rust programming language. FRAME includes a lot of specialized macros that make it easy to compose the application logic in a reusable container. @@ -104,14 +106,14 @@ To update the manifest for the collectibles project: ```toml [dependencies] - frame-support = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk.git", branch = "polkadot-v1.0.0"} - frame-system = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk.git", branch = "polkadot-v1.0.0" } + frame-support = { default-features = false, version = "36.0.0" } + frame-system = { default-features = false, version = "36.0.0" } ``` 3. Add `codec` and `scale-info` to the dependencies. ```toml - codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive",] } + codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } ``` @@ -152,7 +154,6 @@ The next step is to prepare a set of common macros to serve as scaffolding for y use frame_system::pallet_prelude::*; #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet(_); #[pallet::config] From c73411202b5695e4ad7af51449fd8ab5b8831905 Mon Sep 17 00:00:00 2001 From: Dominique Date: Mon, 26 Aug 2024 19:35:09 +0200 Subject: [PATCH 28/39] Deprecation banner in Sidecar tutorial page (#2166) * add deprecation banner in Sidecar tutorial * add links to README & guides folder --------- Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> --- .../integrate-with-tools/explore-sidecar-endpoints.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/content/md/en/docs/tutorials/integrate-with-tools/explore-sidecar-endpoints.md b/content/md/en/docs/tutorials/integrate-with-tools/explore-sidecar-endpoints.md index 0d62e67d5..83aa665f9 100644 --- a/content/md/en/docs/tutorials/integrate-with-tools/explore-sidecar-endpoints.md +++ b/content/md/en/docs/tutorials/integrate-with-tools/explore-sidecar-endpoints.md @@ -4,6 +4,15 @@ description: Demonstrates how you can explore the Substrate REST service (sideca keywords: --- +
+

+ ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. +

+

+ Please refer to the Sidecar docs, the README and the guides folder for the most up-to-date documentation on this topic. +

+
+ The Substrate [sidecar](https://github.com/paritytech/substrate-api-sidecar) service provides a REST API for interacting with Substrate blockchain nodes built using FRAME. The sidecar REST service exposes an extensive set of endpoints that enable you to interact with nodes, accounts, transactions, parachains, and many other components of a Substrate-based blockchain. From e85992db5fecb46aa3998a738bc2109afb12bf11 Mon Sep 17 00:00:00 2001 From: Juan De Souza Date: Tue, 27 Aug 2024 16:56:09 -0300 Subject: [PATCH 29/39] Fix typo 03-create-pallet.md (#2067) Fix typo: "marco" to "macro" Co-authored-by: Shawn Tabrizi --- .../en/docs/tutorials/collectibles-workshop/03-create-pallet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/tutorials/collectibles-workshop/03-create-pallet.md b/content/md/en/docs/tutorials/collectibles-workshop/03-create-pallet.md index d853ccac7..7b03d9271 100644 --- a/content/md/en/docs/tutorials/collectibles-workshop/03-create-pallet.md +++ b/content/md/en/docs/tutorials/collectibles-workshop/03-create-pallet.md @@ -141,7 +141,7 @@ The next step is to prepare a set of common macros to serve as scaffolding for y You now have a clean slate for creating the Substrate collectibles pallet. -2. Prepare the scaffolding for the Substrate collectibles pallet by adding the following common set of marco declarations to the `src/lib.rs` file: +2. Prepare the scaffolding for the Substrate collectibles pallet by adding the following common set of macro declarations to the `src/lib.rs` file: ```rust #![cfg_attr(not(feature = "std"), no_std)] From 6e53d1007a051fa8778f1fb962f37cd606738d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vinh=20Qu=E1=BB=91c=20Nguy=E1=BB=85n?= Date: Tue, 27 Aug 2024 13:01:24 -0700 Subject: [PATCH 30/39] correct websocket rpc port parameter (#2042) Co-authored-by: Shawn Tabrizi --- .../md/en/docs/reference/command-line-tools/node-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/reference/command-line-tools/node-template.md b/content/md/en/docs/reference/command-line-tools/node-template.md index b04f14119..f0da04d0d 100644 --- a/content/md/en/docs/reference/command-line-tools/node-template.md +++ b/content/md/en/docs/reference/command-line-tools/node-template.md @@ -120,7 +120,7 @@ You can use the following options with the `node-template` command. | `--wasm-execution ` | Specifies the method for executing Wasm runtime code. Valid values are `interpreted`, or `compiled`. The default is `Compiled`. | `--wasm-runtime-overrides ` | Specifies the path where local WASM runtimes are stored. These runtimes override on-chain runtimes when the version matches. | `--ws-max-connections ` | Specifies the maximum number of WS RPC server connections. -| `--rpc-port ` | Specifies the TCP port to use for the WebSockets RPC server. +| `--ws-port ` | Specifies the TCP port to use for the WebSockets RPC server. ### Subcommands From 24a2d0fa9e4a46cab3603852b02d06dba5041c04 Mon Sep 17 00:00:00 2001 From: behkod Date: Tue, 27 Aug 2024 23:32:36 +0330 Subject: [PATCH 31/39] change append to prepend state-transitions-and-storage.md (#2039) Co-authored-by: Shawn Tabrizi --- content/md/en/docs/learn/state-transitions-and-storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/learn/state-transitions-and-storage.md b/content/md/en/docs/learn/state-transitions-and-storage.md index 503820285..6f2619947 100644 --- a/content/md/en/docs/learn/state-transitions-and-storage.md +++ b/content/md/en/docs/learn/state-transitions-and-storage.md @@ -57,7 +57,7 @@ Substrate's [runtime storage APIs](/build/runtime-storage) expose a number of st ### Storage value keys -To calculate the key for a simple [Storage Value](/build/runtime-storage#storage-value), take the [TwoX 128 hash](https://github.com/Cyan4973/xxHash) of the name of the pallet that contains the Storage Value and append to it the TwoX 128 hash of the name of the Storage Value itself. +To calculate the key for a simple [Storage Value](/build/runtime-storage#storage-value), take the [TwoX 128 hash](https://github.com/Cyan4973/xxHash) of the name of the pallet that contains the Storage Value and prepend to it the TwoX 128 hash of the name of the Storage Value itself. For example, the [Sudo](https://paritytech.github.io/substrate/master/pallet_sudo/index.html) pallet exposes a Storage Value item named `Key`: ```rust From c75cc23cf62f2a6fc3d8d9d75e8231cc7a84c232 Mon Sep 17 00:00:00 2001 From: Weiliang Li Date: Wed, 28 Aug 2024 05:05:29 +0900 Subject: [PATCH 32/39] Update randomness.md (#2030) Fix a bullet list typo Co-authored-by: Shawn Tabrizi --- content/md/en/docs/build/randomness.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/build/randomness.md b/content/md/en/docs/build/randomness.md index c5250357c..78669809d 100644 --- a/content/md/en/docs/build/randomness.md +++ b/content/md/en/docs/build/randomness.md @@ -41,7 +41,7 @@ Substrate includes two examples of how to implement the `Randomness` trait in pa You should only use this pallet in applications with low security requirements or when testing randomness-consuming applications. You shouldn't use this pallet in a production environment. -= The [BABE pallet](https://paritytech.github.io/substrate/master/pallet_babe/index.html) provides randomness by using verifiable random functions. +- The [BABE pallet](https://paritytech.github.io/substrate/master/pallet_babe/index.html) provides randomness by using verifiable random functions. This pallet provides production-grade randomness, and is used in Polkadot. If you select this pallet as the source of randomness your blockchain must use the blind assignment of blockchain extension ([BABE](/reference/glossary/#blind-assignment-of-blockchain-extension-babe)) slot-based consensus for producing blocks. From d40fcba59d5bae5c3eb55a0d096a84db9c52ca37 Mon Sep 17 00:00:00 2001 From: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:35:50 +0100 Subject: [PATCH 33/39] Meta Depreaction (#2172) * bold steps towards deprecation * update * remoe unused * Apply suggestions from code review Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * nits * Update content/md/en/docs/polkadot-sdk/index.md Co-authored-by: bader y * Update content/md/en/docs/polkadot-sdk/index.md Co-authored-by: bader y * remove deprecated word --------- Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> Co-authored-by: bader y --- .netlify/_redirects | 2 +- content/config/nav.yaml | 9 +- .../md/en/docs/build/genesis-configuration.md | 21 ++- content/md/en/docs/build/origins.md | 2 +- content/md/en/docs/build/pallet-coupling.md | 7 +- .../en/docs/build/remote-procedure-calls.md | 2 +- .../md/en/docs/examples/quickstart/index.html | 18 +-- .../md/en/docs/learn/offchain-operations.md | 7 +- content/md/en/docs/polkadot-sdk/index.md | 39 +++++ content/md/en/docs/reference/frame-macros.md | 2 +- .../how-to-guides/offchain-workers/index.md | 7 +- .../offchain-http-requests.md | 7 +- .../offchain-workers/offchain-indexing.md | 7 +- .../offchain-local-storage.md | 7 +- .../pallet-design/use-loose-coupling.md | 7 +- .../pallet-design/use-tight-coupling.md | 7 +- content/md/en/docs/reference/xcm-reference.md | 7 +- .../add-offchain-workers.md | 7 +- .../explore-sidecar-endpoints.md | 5 - .../md/en/homepage/get-started-homepage.md | 2 + .../md/en/homepage/get-technical-homepage.md | 2 + content/md/en/homepage/hands-on-homepage.md | 2 + src/pages/index.js | 45 ++++-- src/styles/scss/_home.scss | 146 +++++++++++++++++- src/templates/single.js | 14 ++ static/assets/quickstart/index.html | 18 +-- 26 files changed, 288 insertions(+), 111 deletions(-) create mode 100644 content/md/en/docs/polkadot-sdk/index.md diff --git a/.netlify/_redirects b/.netlify/_redirects index afda3f68c..3aee51a1c 100644 --- a/.netlify/_redirects +++ b/.netlify/_redirects @@ -1,6 +1,6 @@ # Redirects from what the browser requests to what we serve -/rustdocs https://paritytech.github.io/substrate/master/sc_service/ 301! +/rustdocs https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/index.html 301! /how-to-guides /reference/ 301! diff --git a/content/config/nav.yaml b/content/config/nav.yaml index 699a0cb11..27dfe9277 100644 --- a/content/config/nav.yaml +++ b/content/config/nav.yaml @@ -1,4 +1,5 @@ menu: + - polkadot-sdk - quick-start - learn - install @@ -10,6 +11,10 @@ menu: - reference - community +polkadot-sdk: + title: Substrate to Polkadot SDK + url: /polkadot-sdk/ + quick-start: title: Quick start url: /quick-start/ @@ -84,7 +89,7 @@ install: url: /install/developer-tools/ - title: Troubleshoot Rust issues url: /install/troubleshoot-rust-issues/ - + #design: # title: Design # url: /design/ @@ -156,7 +161,7 @@ test: url: /test/simulate-parachains/ - title: Check runtime url: /test/check-runtime/ - + deploy: title: Deploy url: /deploy/ diff --git a/content/md/en/docs/build/genesis-configuration.md b/content/md/en/docs/build/genesis-configuration.md index f398bcb92..7375600d9 100644 --- a/content/md/en/docs/build/genesis-configuration.md +++ b/content/md/en/docs/build/genesis-configuration.md @@ -5,7 +5,7 @@ keywords: ---
- ⚠️ WARNING: This page contains outdated information. Please refer to the Rust docs for the most up-to-date documentation on this topic. + Please refer to the Rust docs for the most up-to-date documentation on this topic.
@@ -19,7 +19,7 @@ As you learned in [Chain specification](/build/chain-spec/), the chain specifica However, the chain specification doesn't create the storage items that get initialized when you start a node. Instead, the storage items are defined in the pallets included in the runtime as described in [Runtime storage](/build/runtime-storage/). -After you create storage items for the runtime, you can choose whether they should be set to some initial value as part of the genesis configuration and included in the genesis block. +After you create storage items for the runtime, you can choose whether they should be set to some initial value as part of the genesis configuration and included in the genesis block. To specify the storage items that you want to set an initial state for, Substrate provides two specialized FRAME attribute macros. The macros you can use to initialize storage items as part of the genesis configuration for a chain are: @@ -120,12 +120,17 @@ All of the `GenesisConfig` types for the pallets that included in the constructi The aggregated `RuntimeGenesisConfig` implements the [`BuildStorage`](https://paritytech.github.io/substrate/master/sp_runtime/trait.BuildStorage.html) trait to build all of the initial storage items for the runtime. For example, the node template runtime builds storage items for the following pallets that have a `RuntimeGenesisConfig` specified by default: -- [System pallet](#system-pallet) -- [Aura pallet](#aura-pallet) -- [Grandpa pallet](#grandpa-pallet) -- [Balances pallet](#balances-pallet) -- [TransactionPayment pallet](#transactionpayment-pallet) -- [Sudo pallet](#sudo-pallet) +- [Configure a simple storage value](#configure-a-simple-storage-value) + - [Configure macros in the pallet](#configure-macros-in-the-pallet) + - [Configure the chain specification](#configure-the-chain-specification) +- [Adding genesis configuration to the runtime](#adding-genesis-configuration-to-the-runtime) + - [System pallet](#system-pallet) + - [Aura pallet](#aura-pallet) + - [Grandpa pallet](#grandpa-pallet) + - [Balances pallet](#balances-pallet) + - [TransactionPayment pallet](#transactionpayment-pallet) + - [Sudo pallet](#sudo-pallet) +- [Initialize storage items within a pallet](#initialize-storage-items-within-a-pallet) ### System pallet diff --git a/content/md/en/docs/build/origins.md b/content/md/en/docs/build/origins.md index 66d4da804..428755e91 100644 --- a/content/md/en/docs/build/origins.md +++ b/content/md/en/docs/build/origins.md @@ -6,7 +6,7 @@ keywords: ---
- ⚠️ WARNING: This page contains outdated information. Please refer to the Rust docs for the most up-to-date documentation on this topic. + Please refer to the Rust docs for the most up-to-date documentation on this topic.
The runtime origin is used by dispatchable functions to check where a call has come from. diff --git a/content/md/en/docs/build/pallet-coupling.md b/content/md/en/docs/build/pallet-coupling.md index 9e900a4bc..7e0d17672 100644 --- a/content/md/en/docs/build/pallet-coupling.md +++ b/content/md/en/docs/build/pallet-coupling.md @@ -7,12 +7,7 @@ keywords: ---
-

- ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. -

-

- Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. -

+ Please refer to the Rust Docs for the most up-to-date documentation on this topic.
The term **coupling** is often used to describe the degree to which two software modules depend on each other. diff --git a/content/md/en/docs/build/remote-procedure-calls.md b/content/md/en/docs/build/remote-procedure-calls.md index ec2e49c23..896c954ae 100644 --- a/content/md/en/docs/build/remote-procedure-calls.md +++ b/content/md/en/docs/build/remote-procedure-calls.md @@ -7,7 +7,7 @@ keywords: ---
- ⚠️ WARNING: This page may contain outdated information. Please refer to the Rust docs for the most up-to-date documentation on this topic. + Please refer to the Rust docs for the most up-to-date documentation on this topic.
Remote procedure calls, or RPC methods, are a way for an external program—for example, a browser or front-end application—to communicate with a Substrate node. diff --git a/content/md/en/docs/examples/quickstart/index.html b/content/md/en/docs/examples/quickstart/index.html index 26839f0df..013743a9c 100644 --- a/content/md/en/docs/examples/quickstart/index.html +++ b/content/md/en/docs/examples/quickstart/index.html @@ -20,36 +20,36 @@ } - +

Display an account balance

Enter a development account address, then click Get Balance.

- +

Balance: Not Connected

- + - + - \ No newline at end of file + diff --git a/content/md/en/docs/learn/offchain-operations.md b/content/md/en/docs/learn/offchain-operations.md index 2161626d1..b34213aff 100644 --- a/content/md/en/docs/learn/offchain-operations.md +++ b/content/md/en/docs/learn/offchain-operations.md @@ -5,12 +5,7 @@ keywords: ---
-

- ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. -

-

- Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. -

+ Please refer to the Rust Docs for the most up-to-date documentation on this topic.
There are many use cases where you might want to query data from an offchain source or process data without using on-chain resources before updating the on-chain state. diff --git a/content/md/en/docs/polkadot-sdk/index.md b/content/md/en/docs/polkadot-sdk/index.md new file mode 100644 index 000000000..7d763f6e5 --- /dev/null +++ b/content/md/en/docs/polkadot-sdk/index.md @@ -0,0 +1,39 @@ +--- +title: Polkadot SDK +description: +keywords: + - polkadot-sdk +--- + + +## Substrate to Polkadot SDK + +In [May +2023](https://forum.polkadot.network/t/psa-parity-is-currently-working-on-merging-the-polkadot-stack-repositories-into-one-single-repository/2883), +Parity Technologies started moving the three repositories that contained +[`substrate`](https://github.com/paritytech/substrate), +[`polkadot`](https://github.com/paritytech/polkadot), and +[`cumulus`](https://github.com/paritytech/cumulus), formerly independent in development and +branding, under one new mono-repo called +[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk). Consequently, the [runtimes of the +Polkadot and Kusama relay chains, and their system chains](https://github.com/polkadot-fellows/runtimes) were moved to be maintained by the [Polkadot fellowship](polkadot-fellows.github.io/dashboard/). + +This transition gave birth to a new vision in which these tools are seen from the lens of being part of `polkadot-sdk` while still being independently useful. + +Most impacted in this transition is **Substrate**, and part of this impact is the gradual deprecation of +this website. The content on this website is no longer maintained and will be gradually moved to a +new home. Consider the [resources below](#alternative-resources) as primary sources of information. + +> You may still access the old content of this website in the navbar, but be aware of the fact that some content might not be up to date. + +Note that **this does not impact the development of Substrate as a framework**. Substrate, as a framework, is still being maintained with full steam as a part of `polkadot-sdk`, and retains its full ability to be used to build both [standalone blockchains](https://github.com/paritytech/polkadot-sdk-solochain-template), or [Polkadot powered parachains](https://github.com/paritytech/polkadot-sdk-parachain-template). + +## Alternative Resources + +Below, you can find a number of replacement resources to learn more about Polkadot SDK: + +- [Polkadot Wiki](https://wiki.polkadot.network/docs/build-guide) +- [Polkadot Developers](https://github.com/polkadot-developers/) +- [Polkadot Blockchain Academy](https://polkadot.com/blockchain-academy) +- [Polkadot SDK Rust Docs](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/index.html) +- Polkadot Ecosystem Documentation by Papermoon (Work in progress, see progress [here](https://forum.polkadot.network/t/decentralized-futures-papermoon-first-updates/9265)) diff --git a/content/md/en/docs/reference/frame-macros.md b/content/md/en/docs/reference/frame-macros.md index 800ebd726..07e37923f 100644 --- a/content/md/en/docs/reference/frame-macros.md +++ b/content/md/en/docs/reference/frame-macros.md @@ -4,7 +4,7 @@ description: keywords: ---
- ⚠️ WARNING: This section contains outdated information. Please refer to the Rust docs for the most up-to-date documentation on this topic. + Please refer to the Rust docs for the most up-to-date documentation on this topic.
Substrate uses customized [Rust macros](https://doc.rust-lang.org/book/ch19-06-macros.html) to generate code and aggregate the logic from the pallets you implement for a runtime. diff --git a/content/md/en/docs/reference/how-to-guides/offchain-workers/index.md b/content/md/en/docs/reference/how-to-guides/offchain-workers/index.md index 5b93d9815..d064aa973 100644 --- a/content/md/en/docs/reference/how-to-guides/offchain-workers/index.md +++ b/content/md/en/docs/reference/how-to-guides/offchain-workers/index.md @@ -5,12 +5,7 @@ keywords: ---
-

- ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. -

-

- Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. -

+ Please refer to the Rust Docs for the most up-to-date documentation on this topic.
The _How-to_ guides in the _Offchain workers_ category illustrate common use cases for offchain operations. diff --git a/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-http-requests.md b/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-http-requests.md index d49818e6e..1e396ae32 100644 --- a/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-http-requests.md +++ b/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-http-requests.md @@ -10,12 +10,7 @@ keywords: ---
-

- ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. -

-

- Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. -

+ Please refer to the Rust Docs for the most up-to-date documentation on this topic.
Because most blockchains can't access data that's hosted on servers outside of their own network, they typically use external third-party services—**oracles**—to pull information in from or push information out to locations that are outside of the network. diff --git a/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-indexing.md b/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-indexing.md index acfb76126..abe0f791e 100644 --- a/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-indexing.md +++ b/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-indexing.md @@ -8,12 +8,7 @@ keywords: ---
-

- ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. -

-

- Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. -

+ Please refer to the Rust Docs for the most up-to-date documentation on this topic.
This guide will step you through how to pass data from an extrinsic to an offchain worker without writing to storage. diff --git a/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-local-storage.md b/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-local-storage.md index b5d0ebf9f..ba6290b77 100644 --- a/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-local-storage.md +++ b/content/md/en/docs/reference/how-to-guides/offchain-workers/offchain-local-storage.md @@ -9,12 +9,7 @@ keywords: ---
-

- ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. -

-

- Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. -

+ Please refer to the Rust Docs for the most up-to-date documentation on this topic.
This guide will teach you how to use an offchain worker to save retrieved data in local storage for future access. diff --git a/content/md/en/docs/reference/how-to-guides/pallet-design/use-loose-coupling.md b/content/md/en/docs/reference/how-to-guides/pallet-design/use-loose-coupling.md index 0c9ae3286..15ab0f4f8 100644 --- a/content/md/en/docs/reference/how-to-guides/pallet-design/use-loose-coupling.md +++ b/content/md/en/docs/reference/how-to-guides/pallet-design/use-loose-coupling.md @@ -5,12 +5,7 @@ keywords: ---
-

- ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. -

-

- Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. -

+ Please refer to the Rust Docs for the most up-to-date documentation on this topic.
This guide demonstrates how to reuse a function or type from one pallet in another pallet using a technique called **loose coupling**. diff --git a/content/md/en/docs/reference/how-to-guides/pallet-design/use-tight-coupling.md b/content/md/en/docs/reference/how-to-guides/pallet-design/use-tight-coupling.md index c2031b9ac..2889fb20d 100644 --- a/content/md/en/docs/reference/how-to-guides/pallet-design/use-tight-coupling.md +++ b/content/md/en/docs/reference/how-to-guides/pallet-design/use-tight-coupling.md @@ -5,12 +5,7 @@ keywords: ---
-

- ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. -

-

- Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. -

+ Please refer to the Rust Docs for the most up-to-date documentation on this topic.
Tight coupling two pallets is a technique to write pallets that re-use types and methods from an existing pallet. diff --git a/content/md/en/docs/reference/xcm-reference.md b/content/md/en/docs/reference/xcm-reference.md index 74ba23bc0..839bc338f 100644 --- a/content/md/en/docs/reference/xcm-reference.md +++ b/content/md/en/docs/reference/xcm-reference.md @@ -9,12 +9,7 @@ keywords: ---
-

- ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. -

-

- Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. -

+ Please refer to the Rust Docs for the most up-to-date documentation on this topic.
This section provides reference information for the cross-consensus message (XCM) format. diff --git a/content/md/en/docs/tutorials/build-application-logic/add-offchain-workers.md b/content/md/en/docs/tutorials/build-application-logic/add-offchain-workers.md index a7b1ced2c..68aec308e 100644 --- a/content/md/en/docs/tutorials/build-application-logic/add-offchain-workers.md +++ b/content/md/en/docs/tutorials/build-application-logic/add-offchain-workers.md @@ -12,12 +12,7 @@ keywords: ---
-

- ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. -

-

- Please refer to the `polkadot-sdk-docs` crate for the most up-to-date documentation on this topic. -

+ Please refer to the Rust Docs for the most up-to-date documentation on this topic.
This tutorial illustrates how to modify a pallet to include an offchain worker and configure the pallet and runtime to enable the offchain worker to submit transactions that update the on-chain state. diff --git a/content/md/en/docs/tutorials/integrate-with-tools/explore-sidecar-endpoints.md b/content/md/en/docs/tutorials/integrate-with-tools/explore-sidecar-endpoints.md index 83aa665f9..0153ad29a 100644 --- a/content/md/en/docs/tutorials/integrate-with-tools/explore-sidecar-endpoints.md +++ b/content/md/en/docs/tutorials/integrate-with-tools/explore-sidecar-endpoints.md @@ -5,12 +5,7 @@ keywords: ---
-

- ⚠️ WARNING: This page contains potentially outdated information. Reading it might still be useful, yet we suggest taking it with a grain of salt. -

-

Please refer to the Sidecar docs, the README and the guides folder for the most up-to-date documentation on this topic. -

The Substrate [sidecar](https://github.com/paritytech/substrate-api-sidecar) service provides a REST API for interacting with Substrate blockchain nodes built using FRAME. diff --git a/content/md/en/homepage/get-started-homepage.md b/content/md/en/homepage/get-started-homepage.md index 056789623..061195f07 100644 --- a/content/md/en/homepage/get-started-homepage.md +++ b/content/md/en/homepage/get-started-homepage.md @@ -10,4 +10,6 @@ bodyLinkTwoTitle: Blockchain basics bodyLinkTwoURL: /learn/blockchain-basics/ bodyLinkThreeTitle: Architecture and Rust libraries bodyLinkThreeURL: /learn/architecture/ +bodyLinkFourTitle: +bodyLinkFourURL: --- diff --git a/content/md/en/homepage/get-technical-homepage.md b/content/md/en/homepage/get-technical-homepage.md index f4af3a8a3..fe24257bf 100644 --- a/content/md/en/homepage/get-technical-homepage.md +++ b/content/md/en/homepage/get-technical-homepage.md @@ -10,4 +10,6 @@ bodyLinkTwoTitle: Rust for Substrate bodyLinkTwoURL: /learn/rust-basics/ bodyLinkThreeTitle: Command-line tools bodyLinkThreeURL: /reference/command-line-tools/ +bodyLinkFourTitle: +bodyLinkFourURL: --- diff --git a/content/md/en/homepage/hands-on-homepage.md b/content/md/en/homepage/hands-on-homepage.md index 09051ed12..459a9a75a 100644 --- a/content/md/en/homepage/hands-on-homepage.md +++ b/content/md/en/homepage/hands-on-homepage.md @@ -10,4 +10,6 @@ bodyLinkTwoTitle: Simulate a network bodyLinkTwoURL: /tutorials/build-a-blockchain/simulate-network/ bodyLinkThreeTitle: Add a pallet bodyLinkThreeURL: /tutorials/build-application-logic/add-a-pallet/ +bodyLinkFourTitle: +bodyLinkFourURL: --- diff --git a/src/pages/index.js b/src/pages/index.js index 0336af5aa..33154b4f1 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -2,26 +2,45 @@ import { graphql } from 'gatsby'; import { Layout, Section, SEO } from 'gatsby-plugin-substrate'; import React from 'react'; -import CardsList from '../components/layout/Documentation/CardList'; -import SearchDocumentation from '../components/ui/SearchDocumentation'; +import Card from '../components/layout/Documentation/Card'; +// import CardsList from '../components/layout/Documentation/CardList'; +// import SearchDocumentation from '../components/ui/SearchDocumentation'; export default function Home({ data }) { - const { content } = data; + // eslint-disable-next-line no-empty-pattern + const {} = data; return ( -
-

Substrate Documentation

-
-

- Substrate documentation includes conceptual, procedural, and reference information for blockchain builders - and parachain project teams. -

-
- +
+

Substrate

+

Is now part of

+

+ Polkadot SDK +

- +
); diff --git a/src/styles/scss/_home.scss b/src/styles/scss/_home.scss index 4f63d0944..7951a236c 100644 --- a/src/styles/scss/_home.scss +++ b/src/styles/scss/_home.scss @@ -135,6 +135,150 @@ transition: 0.33s; } +@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@200..900&display=swap'); + +@keyframes wobbleFade { + 0% { + transform: translate(0, 0) rotate(0deg); + opacity: 1; + text-shadow: 0px 5px 30px #24CC85; + } + 5% { + transform: translate(-3px, -3px) rotate(-1deg); + opacity: 0.95; + text-shadow: 0px 5px 33px #24CC85; + } + 10% { + transform: translate(3px, -3px) rotate(1deg); + opacity: 0.9; + text-shadow: 0px 5px 36px #24CC85; + } + 15% { + transform: translate(-3px, 3px) rotate(-1deg); + opacity: 0.85; + text-shadow: 0px 5px 39px #24CC85; + } + 20% { + transform: translate(3px, 3px) rotate(1deg); + opacity: 0.8; + text-shadow: 0px 5px 42px #24CC85; + } + 25% { + transform: translate(-3px, -3px) rotate(-1deg); + opacity: 0.75; + text-shadow: 0px 5px 45px #24CC85; + } + 30% { + transform: translate(3px, -3px) rotate(1deg); + opacity: 0.7; + text-shadow: 0px 5px 48px #24CC85; + } + 35% { + transform: translate(-3px, 3px) rotate(-1deg); + opacity: 0.65; + text-shadow: 0px 5px 51px #24CC85; + } + 40% { + transform: translate(3px, 3px) rotate(1deg); + opacity: 0.6; + text-shadow: 0px 5px 54px #24CC85; + } + 45% { + transform: translate(-3px, -3px) rotate(-1deg); + opacity: 0.55; + text-shadow: 0px 5px 57px #24CC85; + } + 50% { + transform: translate(3px, -3px) rotate(1deg); + opacity: 0.5; + text-shadow: 0px 5px 60px #24CC85; + } + 55% { + transform: translate(-3px, 3px) rotate(-1deg); + opacity: 0.45; + text-shadow: 0px 5px 60px #24CC85; + } + 60% { + transform: translate(3px, 3px) rotate(1deg); + opacity: 0.4; + text-shadow: 0px 5px 60px #24CC85; + } + 65% { + transform: translate(-3px, -3px) rotate(-1deg); + opacity: 0.35; + text-shadow: 0px 5px 60px #24CC85; + } + 70% { + transform: translate(3px, -3px) rotate(1deg); + opacity: 0.3; + text-shadow: 0px 5px 60px #24CC85; + } + 75% { + transform: translate(-3px, 3px) rotate(-1deg); + opacity: 0.3; + text-shadow: 0px 5px 60px #24CC85; + } + 80% { + transform: translate(3px, 3px) rotate(1deg); + opacity: 0.3; + text-shadow: 0px 5px 60px #24CC85; + } + 85% { + transform: translate(-3px, -3px) rotate(-1deg); + opacity: 0.3; + text-shadow: 0px 5px 60px #24CC85; + } + 90% { + transform: translate(3px, -3px) rotate(1deg); + opacity: 0.3; + text-shadow: 0px 5px 60px #24CC85; + } + 95% { + transform: translate(-3px, 3px) rotate(-1deg); + opacity: 0.3; + text-shadow: 0px 5px 60px #24CC85; + } + 100% { + transform: translate(0, 0) rotate(0deg); + opacity: 0.3; /* End at 0.3 opacity */ + text-shadow: 0px 5px 60px #24CC85; /* End at 60px spread */ + } +} + +.substrate { + animation: wobbleFade 10s forwards; /* Use forwards to retain the final state */ + text-shadow: 0px 5px 30px #24CC85; +} + +.polkadot-sdk { + font-family: "Unbounded"; +} + +.underline-effect { + position: relative; + display: inline-block; + color: white; /* Base text color */ +} + +.underline-effect::after { + content: ''; + position: absolute; + width: 100%; + height: 5px; /* Thickness of the underline */ + top: 60px; + bottom: 0; + left: 0; + background-color: #e6007a; /* Color of the underline */ + transform: scaleX(0); + transform-origin: bottom right; + transition: transform 0.3s ease-out; +} + +.underline-effect:hover::after { + transform: scaleX(1); + transform-origin: bottom left; +} + /* Hide scrollbar on windows */ .nav-sidebar { @@ -181,7 +325,7 @@ pre { margin: 1rem 0 2rem 0; } -/* Code View */ +/* Code View */ .markdown-body a.anchor { display:none; } diff --git a/src/templates/single.js b/src/templates/single.js index e6d3fc49d..658150963 100644 --- a/src/templates/single.js +++ b/src/templates/single.js @@ -1,3 +1,4 @@ +import { useLocation } from '@reach/router'; import { graphql } from 'gatsby'; import { Layout, Link, SEO } from 'gatsby-plugin-substrate'; import React from 'react'; @@ -20,6 +21,8 @@ export default function DocsSinglePage({ data, pageContext }) { const { gitLogLatestDate } = data.markdownRemark.parent.fields != null ? data.markdownRemark.parent.fields : ''; //const pagePathNoSlash = pagePath.endsWith('/') ? pagePath.slice(0, -1) : pagePath; const relativeFilePath = data.markdownRemark.parent.relativePath; + const location = useLocation(); // Get the current location + function titleize(slug) { let words = slug.toLowerCase().replace(/-/g, ' '); words = words[0].toUpperCase() + words.substring(1); @@ -102,6 +105,17 @@ export default function DocsSinglePage({ data, pageContext }) {

{title}

+ {location.pathname !== '/polkadot-sdk' && ( +
+ ⚠️ Update Notice: +

+ + Please read Substrate to Polkadot SDK page first. + +

+
+
+ )}
diff --git a/static/assets/quickstart/index.html b/static/assets/quickstart/index.html index 26839f0df..013743a9c 100644 --- a/static/assets/quickstart/index.html +++ b/static/assets/quickstart/index.html @@ -20,36 +20,36 @@ } - +

Display an account balance

Enter a development account address, then click Get Balance.

- +

Balance: Not Connected

- + - + - \ No newline at end of file + From 406d3b62e8d9c1e4a676bc2ecc318f0345772415 Mon Sep 17 00:00:00 2001 From: "forestkeeperio.eth" <87507039+ForestKeeperIO@users.noreply.github.com> Date: Wed, 28 Aug 2024 10:09:40 -0600 Subject: [PATCH 34/39] Update troubleshoot-rust-issues.md (#2145) * Update troubleshoot-rust-issues.md Updated for readability and M1 is not the latest so M-series processors should be better * Update content/md/en/docs/install/troubleshoot-rust-issues.md --------- Co-authored-by: Shawn Tabrizi --- .../md/en/docs/install/troubleshoot-rust-issues.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/content/md/en/docs/install/troubleshoot-rust-issues.md b/content/md/en/docs/install/troubleshoot-rust-issues.md index c7eef194a..764544cf8 100644 --- a/content/md/en/docs/install/troubleshoot-rust-issues.md +++ b/content/md/en/docs/install/troubleshoot-rust-issues.md @@ -114,11 +114,11 @@ WASM_BUILD_TOOLCHAIN=nightly- cargo build --release ``` This command builds the _runtime_ using the specified nightly toolchain. -The rest of project is compiled using the _default_ toolchain, that is, the latest version of the `stable` toolchain that you have installed. +The rest of the project is compiled using the _default_ toolchain, that is, the latest version of the `stable` toolchain that you have installed. ### Downgrade the nightly toolchain -If your computer is configured to use the latest Rust `nightly` toolchain and you want to downgrade to a specific nightly version,you must first uninstall the latest `nightly` toolchain. +If your computer is configured to use the latest Rust `nightly` toolchain and you want to downgrade to a specific nightly version, you must first uninstall the latest `nightly` toolchain. For example, you can remove the latest `nightly` toolchain, then use a specific version of the `nightly` toolchain by running commands similar to the following: ```sh @@ -129,17 +129,17 @@ rustup target add wasm32-unknown-unknown --toolchain nightly- ## Ensure PATH is set correctly -If after installing Rust the commands don't seem to work, showing errors such as `command not found: rustup`, make sure it your PATH is configured correctly. +If after installing Rust the commands don't seem to work, showing errors such as `command not found: rustup`, make sure that your PATH is configured correctly. -Currently, the `rustup` installer installs by default to the bash profile (on mac). If you are using another shell, make sure to add this line to your profile (e.g. `.zshrc`): +Currently, the `rustup` installer installs by default to the bash profile (on Mac). If you are using another shell, make sure to add this line to your profile (e.g. `.zshrc`): ```bash source "$HOME/.cargo/env" ``` -## Installing cmake or protobuf for M1 macOS users +## Installing cmake or protobuf for Apple Silicon (M-series) macOS users -Currently, there are issues compiling the Substrate node when using the packages that are pre-installed on macOS computers with the M1 chip. +Currently, there are issues when compiling the Substrate node while using the packages that are pre-installed on macOS computers with the M-series chip. ```sh error: failed to run custom build command for prost-build v0.10.4 From 6b148e0de47a25d8bda43969806ccb714c2b1d8a Mon Sep 17 00:00:00 2001 From: "forestkeeperio.eth" <87507039+ForestKeeperIO@users.noreply.github.com> Date: Wed, 28 Aug 2024 10:11:28 -0600 Subject: [PATCH 35/39] Update macos.md (#2144) * Update macos.md Updated for readability and M1 is not the latest so M-series processors should be better * Update content/md/en/docs/install/macos.md * Update content/md/en/docs/install/macos.md --------- Co-authored-by: Shawn Tabrizi --- content/md/en/docs/install/macos.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/md/en/docs/install/macos.md b/content/md/en/docs/install/macos.md index 5393956c8..2f0b0c0f1 100644 --- a/content/md/en/docs/install/macos.md +++ b/content/md/en/docs/install/macos.md @@ -4,7 +4,7 @@ description: Set up a local development environment for Substrate on macOS. keywords: --- -You can install Rust and set up a Substrate development environment on Apple macOS computers with either Intel or an Apple M1 processors. +You can install Rust and set up a Substrate development environment on Apple macOS computers with either Intel or Apple Silicon (M-series) processors. ## Before you begin @@ -13,7 +13,7 @@ Before you install Rust and set up your development environment on macOS, verify - Operating system version is 10.7 Lion, or later. - Processor speed of at least 2Ghz, 3Ghz recommended. - Memory of at least 8 GB RAM, 16 GB recommended. -- Storage of at 10 GB available space. +- Storage of 10 GB available. - Broadband Internet connection. ### Support for Apple Silicon @@ -144,7 +144,7 @@ To install `openssl` and the Rust toolchain on macOS: Now that you have Rust installed and the Rust toolchains configured for Substrate development, you are ready to finish setting up your development environment by cloning the Substrate **node template** files and compiling a Substrate node. The node template provides a working environment that includes all of the most common features you need to build a blockchain without any extraneous modules or tools. -To ensure that the node template offers a relatively stable working environment for you to experiment with, the recommended best practice is to clone Substrate node template from the Substrate Developer Hub repository, rather than from the core Substrate repository. +To ensure that the node template offers a relatively stable working environment for you to experiment with, the recommended best practice is to clone the Substrate node template from the Substrate Developer Hub repository, rather than from the core Substrate repository. To compile the Substrate node template: @@ -178,7 +178,7 @@ To compile the Substrate node template: Because of the number of packages required, compiling the node can take several minutes. -After the build completes successfully, your local computer is ready for Substrate development activity. +After the build is completed successfully, your local computer is ready for Substrate development activity. ## Where to go next From 3b17469b0756a7683b255f3b64f18061f346634c Mon Sep 17 00:00:00 2001 From: Guillaume Thiolliere Date: Thu, 29 Aug 2024 01:12:26 +0900 Subject: [PATCH 36/39] Fix format typo (#2142) Co-authored-by: Shawn Tabrizi --- .../tutorials/build-a-parachain/connect-a-local-parachain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/tutorials/build-a-parachain/connect-a-local-parachain.md b/content/md/en/docs/tutorials/build-a-parachain/connect-a-local-parachain.md index d777a0d5d..4f4715de8 100644 --- a/content/md/en/docs/tutorials/build-a-parachain/connect-a-local-parachain.md +++ b/content/md/en/docs/tutorials/build-a-parachain/connect-a-local-parachain.md @@ -380,7 +380,7 @@ To connect to the parachain and submit transactions: 3. Change the custom endpoint to connect to the WebSocket port for the parachain. - If you followed the settings in this tutorial, connect to port `8844``. + If you followed the settings in this tutorial, connect to port `8844`. 4. Click **Account** and select **Transfer** to send funds from Alice to another account. From bb65e871e8e576e094d858a4de6a7a954b9ec360 Mon Sep 17 00:00:00 2001 From: Juan De Souza Date: Wed, 28 Aug 2024 13:20:56 -0300 Subject: [PATCH 37/39] Update 03-create-pallet.md (#2066) fixed worspace to workshop typo Co-authored-by: Shawn Tabrizi --- .../en/docs/tutorials/collectibles-workshop/03-create-pallet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/tutorials/collectibles-workshop/03-create-pallet.md b/content/md/en/docs/tutorials/collectibles-workshop/03-create-pallet.md index 7b03d9271..3c964611e 100644 --- a/content/md/en/docs/tutorials/collectibles-workshop/03-create-pallet.md +++ b/content/md/en/docs/tutorials/collectibles-workshop/03-create-pallet.md @@ -45,7 +45,7 @@ To create a project: ``` In Rust, the `Cargo.toml` file for each package is called the package manifest and it defines configuration settings and dependencies that the package requires. - The `Cargo.toml` file in the `workspace-node-template/pallets/collectibles` folder defines the dependencies for the `collectibles` package you are building. + The `Cargo.toml` file in the `workshop-node-template/pallets/collectibles` folder defines the dependencies for the `collectibles` package you are building. By convention, the source code for Rust projects in Substrate—including pallet modules—is typically in the `src/lib.rs` file. By default, Cargo creates a template `src/main.rs` file for new projects. From 2765a2896cd65b937ad9177117c60fd620134415 Mon Sep 17 00:00:00 2001 From: Guillaume Thiolliere Date: Thu, 29 Aug 2024 01:25:49 +0900 Subject: [PATCH 38/39] Update keys-and-network-operations.md (#2124) Co-authored-by: Shawn Tabrizi --- content/md/en/docs/deploy/keys-and-network-operations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/deploy/keys-and-network-operations.md b/content/md/en/docs/deploy/keys-and-network-operations.md index db7fe5b9b..5f3968051 100644 --- a/content/md/en/docs/deploy/keys-and-network-operations.md +++ b/content/md/en/docs/deploy/keys-and-network-operations.md @@ -37,7 +37,7 @@ Session keys must be available online to enable the validator to perform certain These keys aren't used to control funds and they should only be used for their intended purpose. They can be changed regularly. -To create session keys, a validator node operator must use a controller account too generate a certificate signed with the session's public key. +To create session keys, a validator node operator must use a controller account to generate a certificate signed with the session's public key. The certificate attests that the key acts on behalf of the validator's staking account and nominators. After creating the session key, the validator node operator informs the chain that this key represents the controller key by publishing the session certificate in a transaction on the chain. From cfbd28e9daab42c7893183da087834b685232ba7 Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Wed, 28 Aug 2024 12:28:49 -0400 Subject: [PATCH 39/39] Update subkey.md cd to new directory (#2077) this wasn't changed to cd to the new git repository before running the build command Co-authored-by: Shawn Tabrizi --- content/md/en/docs/reference/command-line-tools/subkey.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/md/en/docs/reference/command-line-tools/subkey.md b/content/md/en/docs/reference/command-line-tools/subkey.md index 4a087b49c..fc4b9ee0b 100644 --- a/content/md/en/docs/reference/command-line-tools/subkey.md +++ b/content/md/en/docs/reference/command-line-tools/subkey.md @@ -44,7 +44,7 @@ To install and compile the `subkey` program: 1. Change to the root directory of the Substrate repository by running the following command: ```bash - cd substrate + cd polkadot-sdk ``` 1. Compile the `subkey` program using the `nightly` toolchain by running the following command: