diff --git a/docs/conceptual/core/storage.md b/docs/conceptual/core/storage.md index 596a7df468..43be984e74 100644 --- a/docs/conceptual/core/storage.md +++ b/docs/conceptual/core/storage.md @@ -73,7 +73,7 @@ these needs automatically; thus a child trie is used instead. ## Runtime Storage API The Substrate's [Support -module](https://substrate.dev/rustdocs/master/palette_support/index.html) provides +module](https://substrate.dev/rustdocs/master/frame_support/index.html) provides utilities to generate unique, deterministic keys for your runtime module storage items. These storage items are placed in the state trie and are accessible by querying the trie by key. diff --git a/docs/conceptual/runtime/srml.md b/docs/conceptual/runtime/srml.md index 65fbcbec07..cea32d6cb2 100644 --- a/docs/conceptual/runtime/srml.md +++ b/docs/conceptual/runtime/srml.md @@ -19,7 +19,7 @@ functionality for a runtime. ### System Module -The [System module](https://substrate.dev/rustdocs/master/palette_system/index.html) provides low-level types, storage, and +The [System module](https://substrate.dev/rustdocs/master/frame_system/index.html) provides low-level types, storage, and functions for your blockchain. All other modules depend on the System module as the basis of your Substrate runtime. @@ -51,7 +51,7 @@ for the runtime. It dispatches incoming extrinsic calls to the respective module ### Support Library -The [SRML support library](https://substrate.dev/rustdocs/master/palette_support/index.html) is a collection of Rust macros, +The [SRML support library](https://substrate.dev/rustdocs/master/frame_support/index.html) is a collection of Rust macros, types, traits, and functions that simplify the development of Substrate runtime modules. The support macros expand at compile time to generate code which is used by the runtime and reduce @@ -73,14 +73,14 @@ The SRML contains a set of prebuilt runtime modules that can be used in your Sub The Assets module is a simple, secure module for dealing with fungible assets. * [Docs](https://substrate.dev/rustdocs/master/pallet_assets/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/assets/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/assets/src/lib.rs) ### Aura The Aura module extends Aura consensus by managing offline reporting. * [Docs](https://substrate.dev/rustdocs/master/pallet_aura/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/aura/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/aura/src/lib.rs) ### Authority Discovery @@ -89,14 +89,14 @@ authorities, learn its own authority id, as well as to sign and verify messages authorities. * [Docs](https://substrate.dev/rustdocs/master/pallet_authority_discovery/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/authority-discovery/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/authority-discovery/src/lib.rs) ### Authorship The Authorship module tracks the current author of the block and recent uncles. * [Docs](https://substrate.dev/rustdocs/master/pallet_authorship/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/authorship/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/authorship/src/lib.rs) ### BABE @@ -104,14 +104,14 @@ The BABE module extends BABE consensus by collecting on-chain randomness from VR managing epoch transitions. * [Docs](https://substrate.dev/rustdocs/master/pallet_babe/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/babe/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/babe/src/lib.rs) ### Balances The Balances module provides functionality for handling accounts and balances. * [Docs](https://substrate.dev/rustdocs/master/pallet_balances/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/balances/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/balances/src/lib.rs) ### Collective @@ -119,7 +119,7 @@ The Collective module allows a set of account IDs to make their collective feeli dispatched calls from specialized origins. * [Docs](https://substrate.dev/rustdocs/master/pallet_collective/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/collective/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/collective/src/lib.rs) ### Contracts @@ -127,7 +127,7 @@ The Contracts module provides functionality for the runtime to deploy and execut smart-contracts. * [Docs](https://substrate.dev/rustdocs/master/pallet_contracts/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/contracts/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/contracts/src/lib.rs) ### Democracy @@ -135,7 +135,7 @@ The Democracy module provides a democratic system that handles administration of voting. * [Docs](https://substrate.dev/rustdocs/master/pallet_democracy/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/democracy/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/democracy/src/lib.rs) ### Elections Phragmen @@ -143,14 +143,14 @@ The Phragmen Elections module is an election module based on [sequential phragmen](https://research.web3.foundation/en/latest/polkadot/NPoS/4.%20Sequential%20Phragm%C3%A9n%E2%80%99s%20method/). * [Docs](https://substrate.dev/rustdocs/master/pallet_elections_phragmen/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/elections-phragmen/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/elections-phragmen/src/lib.rs) ### Elections The Elections module is an election module for stake-weighted membership selection of a collective. * [Docs](https://substrate.dev/rustdocs/master/pallet_elections/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/elections/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/elections/src/lib.rs) ### EVM @@ -158,7 +158,7 @@ The EVM Module is an [Ethereum](https://en.wikipedia.org/wiki/Ethereum) virtual execution module for Substrate. * [Docs](https://substrate.dev/rustdocs/master/pallet_evm/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/evm/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/evm/src/lib.rs) ### Example @@ -166,21 +166,21 @@ The Example module is a simple example of a runtime module demonstrating concept structures common to most runtime modules. * [Docs](https://substrate.dev/rustdocs/master/pallet_example/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/example/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs) ### Finality Tracker The Finality Tracker module tracks the last finalized block, as perceived by block authors. * [Docs](https://substrate.dev/rustdocs/master/pallet_finality_tracker/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/finality-tracker/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/finality-tracker/src/lib.rs) ### Generic Asset The Generic Asset module provides functionality for handling accounts and asset balances. * [Docs](https://substrate.dev/rustdocs/master/pallet_generic_asset/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/generic-asset/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/generic-asset/src/lib.rs) ### GRANDPA @@ -188,7 +188,7 @@ The GRANDPA module extends GRANDPA consensus by managing the GRANDPA authority s native code. * [Docs](https://substrate.dev/rustdocs/master/pallet_grandpa/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/grandpa/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/grandpa/src/lib.rs) ### I'm Online @@ -196,7 +196,7 @@ The I'm Online module allows validators to gossip a heartbeat transaction with e signal that the node is online in the current era. * [Docs](https://substrate.dev/rustdocs/master/pallet_im_online/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/im-online/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/im-online/src/lib.rs) ### Indices @@ -204,7 +204,7 @@ The Indices module allocates indices for newly created accounts. An index is a s address. * [Docs](https://substrate.dev/rustdocs/master/pallet_indices/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/indices/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/indices/src/lib.rs) ### Membership @@ -212,14 +212,14 @@ The Membership module allows control of membership of a set of `AccountId`s, use membership of a collective. * [Docs](https://substrate.dev/rustdocs/master/pallet_membership/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/membership/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/membership/src/lib.rs) ### Offences The Offences module tracks reported offences. * [Docs](https://substrate.dev/rustdocs/master/pallet_offences/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/offences/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/offences/src/lib.rs) ### Randomness Collective Flip @@ -227,7 +227,7 @@ The Randomness Collective Flip module provides a `random` function that generate random values based on the block hashes from the previous `81` blocks. * [Docs](https://substrate.dev/rustdocs/master/pallet_randomness_collective_flip/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/randomness-collective-flip/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/randomness-collective-flip/src/lib.rs) ### Scored Pool @@ -235,7 +235,7 @@ The Scored Pool module maintains a scored membership pool where the highest scor made members. * [Docs](https://substrate.dev/rustdocs/master/pallet_scored_pool/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/scored-pool/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/scored-pool/src/lib.rs) ### Session @@ -243,14 +243,14 @@ The Session module allows validators to manage their session keys, provides a fu the session length, and handles session rotation. * [Docs](https://substrate.dev/rustdocs/master/pallet_session/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/session/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/session/src/lib.rs) ### Staking The Staking module is used to manage funds at stake by network maintainers. * [Docs](https://substrate.dev/rustdocs/master/pallet_staking/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/staking/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/staking/src/lib.rs) ### Sudo @@ -258,14 +258,14 @@ The Sudo module allows for a single account (called the "sudo key") to execute d functions that require a `Root` origin or designate a new account to replace them as the sudo key. * [Docs](https://substrate.dev/rustdocs/master/pallet_sudo/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/sudo/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/sudo/src/lib.rs) ### Timestamp The Timestamp module provides functionality to get and set the on-chain time. * [Docs](https://substrate.dev/rustdocs/master/pallet_timestamp/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/timestamp/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/timestamp/src/lib.rs) ### Transaction Payment @@ -273,7 +273,7 @@ The Transaction Payment module provides the basic logic needed to pay the absolu needed for a transaction to be included. * [Docs](https://substrate.dev/rustdocs/master/pallet_transaction_payment/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/transaction-payment/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/transaction-payment/src/lib.rs) ### Treasury @@ -281,7 +281,7 @@ The Treasury module provides a "pot" of funds that can be managed by stakeholder a structure for making spending proposals from this pot. * [Docs](https://substrate.dev/rustdocs/master/pallet_treasury/index.html) -* [Source](https://github.com/paritytech/substrate/blob/master/palette/treasury/src/lib.rs) +* [Source](https://github.com/paritytech/substrate/blob/master/frame/treasury/src/lib.rs) ## Next Steps @@ -296,9 +296,9 @@ a structure for making spending proposals from this pot. ### References -- Visit the reference docs for the [System module](https://substrate.dev/rustdocs/master/palette_system/index.html). +- Visit the reference docs for the [System module](https://substrate.dev/rustdocs/master/frame_system/index.html). - Visit the reference docs for the [Executive module](https://substrate.dev/rustdocs/master/pallet_executive/index.html). - Visit the reference docs for the [SRML support - library](https://substrate.dev/rustdocs/master/palette_support/index.html). + library](https://substrate.dev/rustdocs/master/frame_support/index.html). diff --git a/docs/conceptual/runtime/weight.md b/docs/conceptual/runtime/weight.md index 0b8bbc7d80..bc044eded5 100644 --- a/docs/conceptual/runtime/weight.md +++ b/docs/conceptual/runtime/weight.md @@ -26,7 +26,7 @@ A weight calculation should always: implementation of the dispatch should take the state of the change into account and manually take extra fees or bonds or take any other measures to make sure that the transaction is safe. -The [System module](https://substrate.dev/rustdocs/master/palette_system/struct.Module.html) is +The [System module](https://substrate.dev/rustdocs/master/frame_system/struct.Module.html) is responsible for accumulating the weight of each block as it gets executed and making sure that it does not exceed the limit. The [Transaction Payment module](https://substrate.dev/rustdocs/master/pallet_transaction_payment/index.html) is responsible @@ -40,13 +40,13 @@ filled with too many transactions. While processing transactions within a block, accumulates both the total length of the block (sum of encoded transactions in bytes) and the total weight of the block. If either of these numbers surpass the limits, no further transactions are accepted in that block. These limits are defined in -[`MaximumBlockLength`](https://substrate.dev/rustdocs/master/palette_system/trait.Trait.html#associatedtype.MaximumBlockLength) +[`MaximumBlockLength`](https://substrate.dev/rustdocs/master/frame_system/trait.Trait.html#associatedtype.MaximumBlockLength) and -[`MaximumBlockWeight`](https://substrate.dev/rustdocs/master/palette_system/trait.Trait.html#associatedtype.MaximumBlockLength). +[`MaximumBlockWeight`](https://substrate.dev/rustdocs/master/frame_system/trait.Trait.html#associatedtype.MaximumBlockLength). One important note about these limits is that a portion of them are reserved for the `Operational` dispatch class. This rule applies to both of the limits and the ratio can be found in -[`AvailableBlockRatio`](https://substrate.dev/rustdocs/master/palette_system/trait.Trait.html#associatedtype.AvailableBlockRatio). +[`AvailableBlockRatio`](https://substrate.dev/rustdocs/master/frame_system/trait.Trait.html#associatedtype.AvailableBlockRatio). For example, if the block length limit is 1 megabyte and the ratio is set to 80%, all transactions can fill the first 800 kilobytes of the block while the last 200 can only be filled by the @@ -60,7 +60,7 @@ operational class. weights](https://github.com/substrate-developer-hub/recipes/tree/master/kitchen/modules/weights) and custom [WeightToFee](https://github.com/substrate-developer-hub/recipes/tree/master/kitchen/runtimes/weight-fee-runtime). -- The [srml-example](https://github.com/paritytech/substrate/blob/master/palette/example/src/lib.rs) +- The [srml-example](https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs) module. ### Examples @@ -72,6 +72,6 @@ operational class. ### References - Take a look at the [SRML Transaction Payment - module](https://github.com/paritytech/substrate/blob/master/palette/transaction-payment/src/lib.rs). + module](https://github.com/paritytech/substrate/blob/master/frame/transaction-payment/src/lib.rs). - Find info about weights including the `SimpleDispatchInfo` enum in [weights.rs](https://github.com/paritytech/substrate/blob/master/primitives/sr-primitives/src/weights.rs). diff --git a/docs/development/module/events.md b/docs/development/module/events.md index 8a4866c534..e2987a292d 100644 --- a/docs/development/module/events.md +++ b/docs/development/module/events.md @@ -79,7 +79,7 @@ decl_module! { } ``` -The default behavior of this function is to call [`deposit_event`](https://substrate.dev/rustdocs/master/palette_system/struct.Module.html#method.deposit_event) from the SRML System module. +The default behavior of this function is to call [`deposit_event`](https://substrate.dev/rustdocs/master/frame_system/struct.Module.html#method.deposit_event) from the SRML System module. This function places the event in the System module's runtime storage for that block. At the beginning of a new block, the System module automatically removes all events that were stored from the previous block. @@ -113,8 +113,8 @@ View the following Substrate recipes to find examples of how runtime events are ### References -* Visit the reference docs for the [`decl_event!` macro](https://substrate.dev/rustdocs/master/palette_support/macro.decl_event.html). +* Visit the reference docs for the [`decl_event!` macro](https://substrate.dev/rustdocs/master/frame_support/macro.decl_event.html). -* Visit the reference docs for the [`decl_module!` macro](https://substrate.dev/rustdocs/master/palette_support/macro.decl_module.html). +* Visit the reference docs for the [`decl_module!` macro](https://substrate.dev/rustdocs/master/frame_support/macro.decl_module.html). -* Visit the reference docs for the [`construct_runtime!` macro](https://substrate.dev/rustdocs/master/palette_support/macro.construct_runtime.html). +* Visit the reference docs for the [`construct_runtime!` macro](https://substrate.dev/rustdocs/master/frame_support/macro.construct_runtime.html). diff --git a/docs/development/module/execution.md b/docs/development/module/execution.md index 8c7cb4cb25..17de7d0f14 100644 --- a/docs/development/module/execution.md +++ b/docs/development/module/execution.md @@ -54,8 +54,8 @@ TODO * Visit the reference docs for the [Executive module](https://substrate.dev/rustdocs/master/pallet_executive/index.html). -* Visit the reference docs for the [`decl_event!` macro](https://substrate.dev/rustdocs/master/palette_support/macro.decl_event.html). +* Visit the reference docs for the [`decl_event!` macro](https://substrate.dev/rustdocs/master/frame_support/macro.decl_event.html). -* Visit the reference docs for the [`decl_storage!` macro](https://substrate.dev/rustdocs/master/palette_support/macro.decl_storage.html). +* Visit the reference docs for the [`decl_storage!` macro](https://substrate.dev/rustdocs/master/frame_support/macro.decl_storage.html). -* Visit the reference docs for the [`construct_runtime!` macro](https://substrate.dev/rustdocs/master/palette_support/macro.construct_runtime.html). +* Visit the reference docs for the [`construct_runtime!` macro](https://substrate.dev/rustdocs/master/frame_support/macro.construct_runtime.html). diff --git a/docs/development/module/fees.md b/docs/development/module/fees.md index d6aad62a6a..716791c117 100644 --- a/docs/development/module/fees.md +++ b/docs/development/module/fees.md @@ -278,7 +278,7 @@ payment module drawing inspiration from Transaction Payment. ### Learn More - Dedicated [weight documentation](conceptual/runtime/weight.md) -- [Example module](https://github.com/paritytech/substrate/blob/master/palette/example/src/lib.rs) +- [Example module](https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs) - [SignedExtension](https://substrate.dev/rustdocs/master/sr_primitives/traits/trait.SignedExtension.html) ### Examples diff --git a/docs/development/module/macros.md b/docs/development/module/macros.md index 2558a98642..ed3e3ea720 100644 --- a/docs/development/module/macros.md +++ b/docs/development/module/macros.md @@ -48,10 +48,10 @@ View our most [simple Substrate runtime](development/module/index.md) to see all ### References -* Visit the reference docs for the [`decl_module!` macro](https://substrate.dev/rustdocs/master/palette_support/macro.decl_module.html). +* Visit the reference docs for the [`decl_module!` macro](https://substrate.dev/rustdocs/master/frame_support/macro.decl_module.html). -* Visit the reference docs for the [`decl_event!` macro](https://substrate.dev/rustdocs/master/palette_support/macro.decl_event.html). +* Visit the reference docs for the [`decl_event!` macro](https://substrate.dev/rustdocs/master/frame_support/macro.decl_event.html). -* Visit the reference docs for the [`decl_storage!` macro](https://substrate.dev/rustdocs/master/palette_support/macro.decl_storage.html). +* Visit the reference docs for the [`decl_storage!` macro](https://substrate.dev/rustdocs/master/frame_support/macro.decl_storage.html). -* Visit the reference docs for the [`construct_runtime!` macro](https://substrate.dev/rustdocs/master/palette_support/macro.construct_runtime.html). +* Visit the reference docs for the [`construct_runtime!` macro](https://substrate.dev/rustdocs/master/frame_support/macro.construct_runtime.html). diff --git a/docs/development/module/origin.md b/docs/development/module/origin.md index 776119e6fd..e6f241c653 100644 --- a/docs/development/module/origin.md +++ b/docs/development/module/origin.md @@ -65,4 +65,4 @@ You can look at the source code of the [Sudo module](https://substrate.dev/rustd ### References -* Visit the reference docs for the [`RawOrigin` enum](https://substrate.dev/rustdocs/master/palette_system/enum.RawOrigin.html). +* Visit the reference docs for the [`RawOrigin` enum](https://substrate.dev/rustdocs/master/frame_system/enum.RawOrigin.html). diff --git a/docs/development/module/storage.md b/docs/development/module/storage.md index 8fb1fd66cb..5007ebf586 100644 --- a/docs/development/module/storage.md +++ b/docs/development/module/storage.md @@ -8,13 +8,13 @@ Runtime storage allows you to store data in your blockchain which can be accesse Your runtime module has access to Substrate storage APIs which allows you to easily store common storage items: -* [Storage Value](https://substrate.dev/rustdocs/master/palette_support/storage/trait.StorageValue.html) - A single value. +* [Storage Value](https://substrate.dev/rustdocs/master/frame_support/storage/trait.StorageValue.html) - A single value. -* [Storage Map](https://substrate.dev/rustdocs/master/palette_support/storage/trait.StorageMap.html) - A key-value hash map. +* [Storage Map](https://substrate.dev/rustdocs/master/frame_support/storage/trait.StorageMap.html) - A key-value hash map. -* [Storage Linked Map](https://substrate.dev/rustdocs/master/palette_support/storage/trait.StorageLinkedMap.html) - Similar to a storage map, but allows enumeration of the stored elements. +* [Storage Linked Map](https://substrate.dev/rustdocs/master/frame_support/storage/trait.StorageLinkedMap.html) - Similar to a storage map, but allows enumeration of the stored elements. -* [Storage Double Map](https://substrate.dev/rustdocs/master/palette_support/storage/trait.StorageDoubleMap.html) - An implementation of a map with two keys. +* [Storage Double Map](https://substrate.dev/rustdocs/master/frame_support/storage/trait.StorageDoubleMap.html) - An implementation of a map with two keys. Any value which can be encoded by the [Parity SCALE codec](conceptual/core/codec.md) is supported by these storage APIs. @@ -71,6 +71,6 @@ TODO ### References -* Visit the reference docs for the [`decl_storage!` macro](https://substrate.dev/rustdocs/master/palette_support/macro.decl_storage.html) more details possible storage declarations. +* Visit the reference docs for the [`decl_storage!` macro](https://substrate.dev/rustdocs/master/frame_support/macro.decl_storage.html) more details possible storage declarations. -* Visit the reference docs for [StorageValue](https://substrate.dev/rustdocs/master/palette_support/storage/trait.StorageValue.html), [StorageMap](https://substrate.dev/rustdocs/master/palette_support/storage/trait.StorageMap.html), [StorageLinkedMap](https://substrate.dev/rustdocs/master/palette_support/storage/trait.StorageLinkedMap.html), and [StorageDoubleMap](https://substrate.dev/rustdocs/master/palette_support/storage/trait.StorageDoubleMap.html) to learn more about their API. +* Visit the reference docs for [StorageValue](https://substrate.dev/rustdocs/master/frame_support/storage/trait.StorageValue.html), [StorageMap](https://substrate.dev/rustdocs/master/frame_support/storage/trait.StorageMap.html), [StorageLinkedMap](https://substrate.dev/rustdocs/master/frame_support/storage/trait.StorageLinkedMap.html), and [StorageDoubleMap](https://substrate.dev/rustdocs/master/frame_support/storage/trait.StorageDoubleMap.html) to learn more about their API. diff --git a/docs/runtime/macros/construct_runtime.md b/docs/runtime/macros/construct_runtime.md index 1fb49234fc..2d98843278 100644 --- a/docs/runtime/macros/construct_runtime.md +++ b/docs/runtime/macros/construct_runtime.md @@ -26,7 +26,7 @@ construct_runtime!( ## Defining the Modules Used -In the example above, we only use modules in the SRML, but you can see that there are different syntactical ways that you can define the use of a module and its types. These different patterns are managed by the [macro definition](https://github.com/paritytech/substrate/blob/master/palette/support/src/runtime.rs). +In the example above, we only use modules in the SRML, but you can see that there are different syntactical ways that you can define the use of a module and its types. These different patterns are managed by the [macro definition](https://github.com/paritytech/substrate/blob/master/frame/support/src/runtime.rs). ### Naming Your Module @@ -81,7 +81,7 @@ As you can see, the types exposed by your various modules are what ultimately po ### Module -The `Module` type is required by all modules in your runtime. This type gets generated through the `decl_module!` macro. This is where all the public functions your module exposes are defined. For example, in the [`Sudo`](https://github.com/paritytech/substrate/blob/master/palette/sudo/src/lib.rs) module which controls the management of "admin" access to your chain: +The `Module` type is required by all modules in your runtime. This type gets generated through the `decl_module!` macro. This is where all the public functions your module exposes are defined. For example, in the [`Sudo`](https://github.com/paritytech/substrate/blob/master/frame/sudo/src/lib.rs) module which controls the management of "admin" access to your chain: ```rust decl_module! { @@ -115,7 +115,7 @@ You can learn more about `decl_module!` [here](runtime/macros/decl_module.md). ### Call -The `Call` type is an enum generated by the `decl_module!` macro which contains a list of all the callable functions and their arguments. For example, in the [`Sudo`](https://github.com/paritytech/substrate/blob/master/palette/sudo/src/lib.rs) module above, we should expect an enum similar to: +The `Call` type is an enum generated by the `decl_module!` macro which contains a list of all the callable functions and their arguments. For example, in the [`Sudo`](https://github.com/paritytech/substrate/blob/master/frame/sudo/src/lib.rs) module above, we should expect an enum similar to: ```rust enum Call { @@ -130,7 +130,7 @@ We will dig deeper into this topic [here] (Coming Soon). The `Storage` type is exposed whenever your runtime uses the `decl_storage!` macro. This macro is used to save data used by your runtime module into the chain state. -We can look at the [`Sudo`](https://github.com/paritytech/substrate/blob/master/palette/sudo/src/lib.rs) module to see an example: +We can look at the [`Sudo`](https://github.com/paritytech/substrate/blob/master/frame/sudo/src/lib.rs) module to see an example: ```rust decl_storage! { @@ -168,7 +168,7 @@ The `Origin` type is needed whenever your module declares a custom `Origin` enum Every function call to your runtime has an origin which specifies where the extrinsic was generated from. In the case of a signed extrinsic (transaction), the origin contains an identifier for the caller. The origin can be empty in the case of an inherent extrinsic. -You can see an example of a customized `Origin` in the [council motion module](https://github.com/paritytech/substrate/blob/master/palette/council/src/motions.rs): +You can see an example of a customized `Origin` in the [council motion module](https://github.com/paritytech/substrate/blob/master/frame/council/src/motions.rs): ```rust /// Origin for the council module. @@ -207,7 +207,7 @@ The `Log` type is needed if your module generates logs entries for the runtime. 2) The support of 'system' log items should never be dropped by runtime. Otherwise, native code will lose its ability to read items of this type even if they were generated by the versions which have supported these items. -The [`Consensus` module](https://github.com/paritytech/substrate/blob/master/palette/consensus/src/lib.rs) shows an example of how to implement a log: +The [`Consensus` module](https://github.com/paritytech/substrate/blob/master/frame/consensus/src/lib.rs) shows an example of how to implement a log: ```rust pub type Log = RawLog< @@ -249,7 +249,7 @@ The `Inherent` type is needed when your module defines an implementation of the This custom implementation is needed whenever your module wants to provide an inherent extrinsic and/or wants to verify an inherent extrinsic. If your module requires extra data for creating the inherent extrinsic, the data needs to be passed as `InherentData` into the runtime. -For example, in the [`Timestamp` module](https://github.com/paritytech/substrate/blob/master/palette/timestamp/src/lib.rs), an inherent data is used to set the timestamp for a given block by creating an extrinsic. As a peer authority of the block author, we confirm that the time proposed in the inherent extrinsic is within an acceptable period from our clock. +For example, in the [`Timestamp` module](https://github.com/paritytech/substrate/blob/master/frame/timestamp/src/lib.rs), an inherent data is used to set the timestamp for a given block by creating an extrinsic. As a peer authority of the block author, we confirm that the time proposed in the inherent extrinsic is within an acceptable period from our clock. ```rust impl ProvideInherent for Module { diff --git a/docs/runtime/macros/decl_module.md b/docs/runtime/macros/decl_module.md index e3f16948ab..1d06af6582 100644 --- a/docs/runtime/macros/decl_module.md +++ b/docs/runtime/macros/decl_module.md @@ -4,7 +4,7 @@ title: "Declaring a Module!" The `decl_module!` macro defines the public functions exposed by your module, which act as entry points to accessing your runtime. These functions should work together to build a *generally* independent set of features and functionality which will be included with your blockchain's final runtime. The main logic of the macro is defined [here](https://substrate.dev/rustdocs/v1.0/srml_support/macro.decl_module.html). -Each of the different components in the [Substrate Runtime Module Library](https://github.com/paritytech/substrate/tree/master/palette) (SRML) is an example of a Runtime Module. +Each of the different components in the [Substrate Runtime Module Library](https://github.com/paritytech/substrate/tree/master/frame) (SRML) is an example of a Runtime Module. We will start by looking at the `decl_module` macro in it's most simple form: @@ -169,7 +169,7 @@ You might use `on_initalise()` to help you with tasks that need to run before an ## Privileged Functions -A privileged function is one that can only be called when the origin of the call is `Root`. An example of a privileged function can be found in the [`Consensus` module](https://github.com/paritytech/substrate/blob/master/palette/consensus/src/lib.rs) for a runtime upgrade: +A privileged function is one that can only be called when the origin of the call is `Root`. An example of a privileged function can be found in the [`Consensus` module](https://github.com/paritytech/substrate/blob/master/frame/consensus/src/lib.rs) for a runtime upgrade: ```rust /// Set the new code. @@ -193,4 +193,4 @@ Where `Result` and `Ok(())` were automatically added as mentioned in [Function R Different runtimes have different reasons for allow privileged calls to be executed. Because it's privileged, we can assume it's a one-off operation and substantial processing/storage/memory can be used without worrying about gameability or attack scenarios. -Normally, functions like this would be called via the `sudo()` function in the [`Sudo` module](https://github.com/paritytech/substrate/blob/master/palette/sudo/src/lib.rs) which can construct a `Root` call based on a proposal coming from a user. \ No newline at end of file +Normally, functions like this would be called via the `sudo()` function in the [`Sudo` module](https://github.com/paritytech/substrate/blob/master/frame/sudo/src/lib.rs) which can construct a `Root` call based on a proposal coming from a user. \ No newline at end of file diff --git a/docs/tutorials/tcr/building-the-substrate-tcr-runtime.md b/docs/tutorials/tcr/building-the-substrate-tcr-runtime.md index c734e326e5..7beec5d2b0 100644 --- a/docs/tutorials/tcr/building-the-substrate-tcr-runtime.md +++ b/docs/tutorials/tcr/building-the-substrate-tcr-runtime.md @@ -15,7 +15,7 @@ Let's start with a new Substrate runtime node. We recommend going through the [S The first step towards building a Substrate runtime pallet is to define what other FRAME pallets we could use in our pallet. There are plenty of FRAME pallets that ship with the Substrate codebase and we recommend using them, when needed. To use any of the existing pallets, we need to import and specify them in the pallet trait of our custom pallet. -For example, in this runtime we need the capability to calculate and compare timestamps for the TCR parameters - apply stage length and commit stage length. We will use the [`timestamp` FRAME pallet](https://github.com/paritytech/substrate/tree/master/palette/timestamp) to achieve this functionality. +For example, in this runtime we need the capability to calculate and compare timestamps for the TCR parameters - apply stage length and commit stage length. We will use the [`timestamp` FRAME pallet](https://github.com/paritytech/substrate/tree/master/frame/timestamp) to achieve this functionality. Here's how the pallet configuration trait declaration for the TCR pallet looks like. diff --git a/website/versioned_docs/version-1.0/runtime/macros/construct_runtime.md b/website/versioned_docs/version-1.0/runtime/macros/construct_runtime.md index b97f2f9a1e..f13bacb643 100644 --- a/website/versioned_docs/version-1.0/runtime/macros/construct_runtime.md +++ b/website/versioned_docs/version-1.0/runtime/macros/construct_runtime.md @@ -28,7 +28,7 @@ construct_runtime!( ## Defining the Modules Used -In the example above, we only use modules in the SRML, but you can see that there are different syntactical ways that you can define the use of a module and its types. These different patterns are managed by the [macro definition](https://github.com/paritytech/substrate/blob/master/palette/support/src/runtime.rs). +In the example above, we only use modules in the SRML, but you can see that there are different syntactical ways that you can define the use of a module and its types. These different patterns are managed by the [macro definition](https://github.com/paritytech/substrate/blob/master/frame/support/src/runtime.rs). ### Naming Your Module @@ -83,7 +83,7 @@ As you can see, the types exposed by your various modules are what ultimately po ### Module -The `Module` type is required by all modules in your runtime. This type gets generated through the `decl_module!` macro. This is where all the public functions your module exposes are defined. For example, in the [`Sudo`](https://github.com/paritytech/substrate/blob/master/palette/sudo/src/lib.rs) module which controls the management of "admin" access to your chain: +The `Module` type is required by all modules in your runtime. This type gets generated through the `decl_module!` macro. This is where all the public functions your module exposes are defined. For example, in the [`Sudo`](https://github.com/paritytech/substrate/blob/master/frame/sudo/src/lib.rs) module which controls the management of "admin" access to your chain: ```rust decl_module! { @@ -117,7 +117,7 @@ You can learn more about `decl_module!` [here](runtime/macros/decl_module.md). ### Call -The `Call` type is an enum generated by the `decl_module!` macro which contains a list of all the callable functions and their arguments. For example, in the [`Sudo`](https://github.com/paritytech/substrate/blob/master/palette/sudo/src/lib.rs) module above, we should expect an enum similar to: +The `Call` type is an enum generated by the `decl_module!` macro which contains a list of all the callable functions and their arguments. For example, in the [`Sudo`](https://github.com/paritytech/substrate/blob/master/frame/sudo/src/lib.rs) module above, we should expect an enum similar to: ```rust enum Call { @@ -132,7 +132,7 @@ We will dig deeper into this topic [here] (Coming Soon). The `Storage` type is exposed whenever your runtime uses the `decl_storage!` macro. This macro is used to save data used by your runtime module into the chain state. -We can look at the [`Sudo`](https://github.com/paritytech/substrate/blob/master/palette/sudo/src/lib.rs) module to see an example: +We can look at the [`Sudo`](https://github.com/paritytech/substrate/blob/master/frame/sudo/src/lib.rs) module to see an example: ```rust decl_storage! { @@ -170,7 +170,7 @@ The `Origin` type is needed whenever your module declares a custom `Origin` enum Every function call to your runtime has an origin which specifies where the extrinsic was generated from. In the case of a signed extrinsic (transaction), the origin contains an identifier for the caller. The origin can be empty in the case of an inherent extrinsic. -You can see an example of a customized `Origin` in the [council motion module](https://github.com/paritytech/substrate/blob/master/palette/council/src/motions.rs): +You can see an example of a customized `Origin` in the [council motion module](https://github.com/paritytech/substrate/blob/master/frame/council/src/motions.rs): ```rust /// Origin for the council module. @@ -209,7 +209,7 @@ The `Log` type is needed if your module generates logs entries for the runtime. 2) The support of 'system' log items should never be dropped by runtime. Otherwise, native code will lose its ability to read items of this type even if they were generated by the versions which have supported these items. -The [`Consensus` module](https://github.com/paritytech/substrate/blob/master/palette/consensus/src/lib.rs) shows an example of how to implement a log: +The [`Consensus` module](https://github.com/paritytech/substrate/blob/master/frame/consensus/src/lib.rs) shows an example of how to implement a log: ```rust pub type Log = RawLog< @@ -251,7 +251,7 @@ The `Inherent` type is needed when your module defines an implementation of the This custom implementation is needed whenever your module wants to provide an inherent extrinsic and/or wants to verify an inherent extrinsic. If your module requires extra data for creating the inherent extrinsic, the data needs to be passed as `InherentData` into the runtime. -For example, in the [`Timestamp` module](https://github.com/paritytech/substrate/blob/master/palette/timestamp/src/lib.rs), an inherent data is used to set the timestamp for a given block by creating an extrinsic. As a peer authority of the block author, we confirm that the time proposed in the inherent extrinsic is within an acceptable period from our clock. +For example, in the [`Timestamp` module](https://github.com/paritytech/substrate/blob/master/frame/timestamp/src/lib.rs), an inherent data is used to set the timestamp for a given block by creating an extrinsic. As a peer authority of the block author, we confirm that the time proposed in the inherent extrinsic is within an acceptable period from our clock. ```rust impl ProvideInherent for Module { diff --git a/website/versioned_docs/version-1.0/runtime/macros/decl_module.md b/website/versioned_docs/version-1.0/runtime/macros/decl_module.md index 7a250aea36..a99f3de9e9 100644 --- a/website/versioned_docs/version-1.0/runtime/macros/decl_module.md +++ b/website/versioned_docs/version-1.0/runtime/macros/decl_module.md @@ -6,7 +6,7 @@ original_id: decl_module The `decl_module!` macro defines the public functions exposed by your module, which act as entry points to accessing your runtime. These functions should work together to build a *generally* independent set of features and functionality which will be included with your blockchain's final runtime. The main logic of the macro is defined [here](https://substrate.dev/rustdocs/v1.0/srml_support/macro.decl_module.html). -Each of the different components in the [Substrate Runtime Module Library](https://github.com/paritytech/substrate/tree/master/palette) (SRML) is an example of a Runtime Module. +Each of the different components in the [Substrate Runtime Module Library](https://github.com/paritytech/substrate/tree/master/frame) (SRML) is an example of a Runtime Module. We will start by looking at the `decl_module` macro in it's most simple form: @@ -171,7 +171,7 @@ You might use `on_initalise()` to help you with tasks that need to run before an ## Privileged Functions -A privileged function is one that can only be called when the origin of the call is `Root`. An example of a privileged function can be found in the [`Consensus` module](https://github.com/paritytech/substrate/blob/master/palette/consensus/src/lib.rs) for a runtime upgrade: +A privileged function is one that can only be called when the origin of the call is `Root`. An example of a privileged function can be found in the [`Consensus` module](https://github.com/paritytech/substrate/blob/master/frame/consensus/src/lib.rs) for a runtime upgrade: ```rust /// Set the new code. @@ -195,4 +195,4 @@ Where `Result` and `Ok(())` were automatically added as mentioned in [Function R Different runtimes have different reasons for allow privileged calls to be executed. Because it's privileged, we can assume it's a one-off operation and substantial processing/storage/memory can be used without worrying about gameability or attack scenarios. -Normally, functions like this would be called via the `sudo()` function in the [`Sudo` module](https://github.com/paritytech/substrate/blob/master/palette/sudo/src/lib.rs) which can construct a `Root` call based on a proposal coming from a user. \ No newline at end of file +Normally, functions like this would be called via the `sudo()` function in the [`Sudo` module](https://github.com/paritytech/substrate/blob/master/frame/sudo/src/lib.rs) which can construct a `Root` call based on a proposal coming from a user. \ No newline at end of file diff --git a/website/versioned_docs/version-1.0/tutorials/start-a-private-network-with-substrate.md b/website/versioned_docs/version-1.0/tutorials/start-a-private-network-with-substrate.md index ba9373f645..10b2ef6d77 100644 --- a/website/versioned_docs/version-1.0/tutorials/start-a-private-network-with-substrate.md +++ b/website/versioned_docs/version-1.0/tutorials/start-a-private-network-with-substrate.md @@ -261,7 +261,7 @@ Here are some ideas for what to learn next. You can go through a very similar process using Substrate's full node that lives in the `node` directory rather than the `node-template` that we used. The process should be familiar to you, and you'll get to explore more runtime modules that are included in the full node. ### Add Validators After Genesis -What if you want to add more validators after starting the blockchain? You can't just go back and edit the chainspec at that point. The authority set can be changed after genesis by calling the consensus module's [`set_authorities` function](https://github.com/paritytech/substrate/blob/master/palette/consensus/src/lib.rs#L356-L362). However, that function can only be called from other runtime modules. If you've built the full node, you can use the democracy module for this task. Or check out the [Substrate POA runtime](https://github.com/gautamdhameja/substrate-poa). +What if you want to add more validators after starting the blockchain? You can't just go back and edit the chainspec at that point. The authority set can be changed after genesis by calling the consensus module's [`set_authorities` function](https://github.com/paritytech/substrate/blob/master/frame/consensus/src/lib.rs#L356-L362). However, that function can only be called from other runtime modules. If you've built the full node, you can use the democracy module for this task. Or check out the [Substrate POA runtime](https://github.com/gautamdhameja/substrate-poa). ### Write a Custom Runtime Substrate is all about writing your own runtimes, and now that you've gotten your hands dirty, I encourage you to try writing one. Consider one of the [tutorials](/tutorials/). diff --git a/website/versioned_docs/version-1.0/tutorials/tcr/building-the-substrate-tcr-runtime.md b/website/versioned_docs/version-1.0/tutorials/tcr/building-the-substrate-tcr-runtime.md index 10eeb6882c..9e6a75a750 100644 --- a/website/versioned_docs/version-1.0/tutorials/tcr/building-the-substrate-tcr-runtime.md +++ b/website/versioned_docs/version-1.0/tutorials/tcr/building-the-substrate-tcr-runtime.md @@ -17,7 +17,7 @@ Let's start with a new Substrate runtime node. We recommend going through the [S The first step towards building a Substrate runtime module is to define what other SRML modules we could use in our module. There are plenty of SRML modules that ship with the Substrate codebase and we recommend using them, when needed. To use any of the existing modules, we need to import and specify them in the module trait of our custom module. -For example, in this runtime we need the capability to calculate and compare timestamps for the TCR parameters - apply stage length and commit stage length. We will use the [`timestamp` SRML module](https://github.com/paritytech/substrate/tree/master/palette/timestamp) to achieve this functionality. +For example, in this runtime we need the capability to calculate and compare timestamps for the TCR parameters - apply stage length and commit stage length. We will use the [`timestamp` SRML module](https://github.com/paritytech/substrate/tree/master/frame/timestamp) to achieve this functionality. Here's how the module configuration trait declaration for the TCR module looks like.