mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 04:27:56 +00:00
fix(docs): support multiple SDK paths for local and CI environments
This commit is contained in:
@@ -3,7 +3,12 @@ const path = require('path');
|
||||
const { spawnSync } = require('child_process');
|
||||
|
||||
// --- Configuration ---
|
||||
const pezkuwiSdkRoot = path.join(__dirname, '..', '..', 'Pezkuwi-SDK');
|
||||
// Try multiple possible locations for Pezkuwi-SDK (local dev vs CI)
|
||||
const possibleSdkPaths = [
|
||||
path.join(__dirname, '..', '..', 'Pezkuwi-SDK'), // Local: /home/user/Pezkuwi-SDK
|
||||
path.join(__dirname, '..', 'Pezkuwi-SDK'), // CI: /home/runner/work/pwap/pwap/Pezkuwi-SDK
|
||||
];
|
||||
const pezkuwiSdkRoot = possibleSdkPaths.find(p => fs.existsSync(p)) || possibleSdkPaths[0];
|
||||
const sdkDocsSourcePath = path.join(pezkuwiSdkRoot, 'docs', 'sdk');
|
||||
const mainDocsSourcePath = path.join(pezkuwiSdkRoot, 'docs'); // This is where whitepaper.md etc. are
|
||||
const publicPath = path.join(__dirname, 'public');
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
window.ALL_CRATES = ["pezkuwi_sdk_docs"];
|
||||
//{"start":21,"fragment_lengths":[18]}
|
||||
@@ -1 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Documentation for Rustdoc"><title>Help</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="./static.files/${f}">`).join(""))</script><link rel="stylesheet" href="./static.files/normalize-9960930a.css"><link rel="stylesheet" href="./static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="./" data-static-root-path="./static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="./static.files/storage-e2aeef58.js"></script><script defer src="./static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="./static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod sys"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">All</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="./index.html">Rustdoc</a><span class="version">1.91.1</span></h2></div><div class="version">(ed61e7d7e 2025-11-07)</div><h2 class="location">Help</h2><div class="sidebar-elems"></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>Rustdoc help</h1><span class="out-of-band"><a id="back" href="javascript:void(0)" onclick="history.back();">Back</a></span></div><noscript><section><p>You need to enable JavaScript to use keyboard commands or search.</p><p>For more information, browse the <a href="https://doc.rust-lang.org/1.91.1/rustdoc/">rustdoc handbook</a>.</p></section></noscript></section></div></main></body></html>
|
||||
File diff suppressed because one or more lines are too long
@@ -1,15 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A list of external resources and learning material about Pezkuwi SDK."><title>pezkuwi_sdk_docs::external_resources - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module external_resources</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module external_<wbr>resources</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#external-resources" title="External Resources">External Resources</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate pezkuwi_<wbr>sdk_<wbr>docs</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">pezkuwi_sdk_docs</a></div><h1>Module <span>external_<wbr>resources</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/pezkuwi_sdk_docs/external_resources.rs.html#1-14">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A list of external resources and learning material about Pezkuwi SDK.</p>
|
||||
<h2 id="external-resources"><a class="doc-anchor" href="#external-resources">§</a>External Resources</h2>
|
||||
<p>A non-exhaustive, un-opinionated list of external resources about Pezkuwi SDK.</p>
|
||||
<p>Unlike <a href="../guides/index.html" title="mod pezkuwi_sdk_docs::guides"><code>crate::guides</code></a>, or <a href="../pezkuwi_sdk/templates/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::templates"><code>crate::pezkuwi_sdk::templates</code></a> that contain material directly
|
||||
maintained in the <code>pezkuwi-sdk</code> repository, the list of resources here are maintained by
|
||||
third-parties, and are therefore subject to more variability. Any further resources may be added
|
||||
by opening a pull request to the <code>pezkuwi-sdk</code> repository.</p>
|
||||
<ul>
|
||||
<li><a href="https://www.shawntabrizi.com/substrate-collectables-workshop/">Pezkuwi NFT Marketplace Tutorial by Pezkuwi Fellow Shawn Tabrizi</a></li>
|
||||
<li><a href="https://dotcodeschool.com/">HEZ Code School</a></li>
|
||||
<li><a href="https://github.com/pezkuwi-developers/">Pezkuwi Developers Github Organization</a></li>
|
||||
<li><a href="https://github.com/pezkuwichain/kurdistan_blockchain-akademy">Pezkuwi Blockchain Academy</a></li>
|
||||
<li><a href="https://wiki.network.pezkuwichain.io/">Pezkuwi Wiki</a></li>
|
||||
</ul>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {};
|
||||
@@ -1,310 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="How to enable Async Backing on teyrchain projects that started in 2023 or before."><title>pezkuwi_sdk_docs::guides::async_backing_guide - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module async_backing_guide</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module async_<wbr>backing_<wbr>guide</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#upgrade-teyrchain-for-asynchronous-backing-compatibility" title="Upgrade Teyrchain for Asynchronous Backing Compatibility">Upgrade Teyrchain for Asynchronous Backing Compatibility</a><ul><li><a href="#prerequisite" title="Prerequisite">Prerequisite</a></li><li><a href="#phase-1---update-teyrchain-runtime" title="Phase 1 - Update Teyrchain Runtime">Phase 1 - Update Teyrchain Runtime</a></li><li><a href="#phase-2---update-teyrchain-nodes" title="Phase 2 - Update Teyrchain Nodes">Phase 2 - Update Teyrchain Nodes</a></li><li><a href="#phase-3---activate-async-backing" title="Phase 3 - Activate Async Backing">Phase 3 - Activate Async Backing</a></li><li><a href="#timing-by-block-number" title="Timing by Block Number">Timing by Block Number</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../index.html">guides</a></div><h1>Module <span>async_<wbr>backing_<wbr>guide</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/pezkuwi_sdk_docs/guides/async_backing_guide.rs.html#1-254">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>How to enable Async Backing on teyrchain projects that started in 2023 or before.</p>
|
||||
<h2 id="upgrade-teyrchain-for-asynchronous-backing-compatibility"><a class="doc-anchor" href="#upgrade-teyrchain-for-asynchronous-backing-compatibility">§</a>Upgrade Teyrchain for Asynchronous Backing Compatibility</h2>
|
||||
<p>This guide is relevant for cumulus based teyrchain projects started in 2023 or before, whose
|
||||
backing process is synchronous where parablocks can only be built on the latest Relay Chain
|
||||
block. Async Backing allows collators to build parablocks on older Relay Chain blocks and create
|
||||
pipelines of multiple pending parablocks. This parallel block generation increases efficiency
|
||||
and throughput. For more information on Async backing and its terminology, refer to the document
|
||||
on <a href="https://docs.pezkuwichain.io/sdk/master/pezkuwi_sdk_docs/guides/async_backing_guide/index.html">the Pezkuwi SDK docs.</a></p>
|
||||
<blockquote>
|
||||
<p>If starting a new teyrchain project, please use an async backing compatible template such as
|
||||
the
|
||||
<a href="https://github.com/pezkuwichain/pezkuwi-sdk/tree/master/templates/teyrchain">teyrchain template</a>.
|
||||
The rollout process for Async Backing has three phases. Phases 1 and 2 below put new
|
||||
infrastructure in place. Then we can simply turn on async backing in phase 3.</p>
|
||||
</blockquote>
|
||||
<h3 id="prerequisite"><a class="doc-anchor" href="#prerequisite">§</a>Prerequisite</h3>
|
||||
<p>The relay chain needs to have async backing enabled so double-check that the relay-chain
|
||||
configuration contains the following three parameters (especially when testing locally e.g. with
|
||||
zombienet):</p>
|
||||
<div class="example-wrap"><pre class="language-json"><code>"async_backing_params": {
|
||||
"max_candidate_depth": 3,
|
||||
"allowed_ancestry_len": 2
|
||||
},
|
||||
"scheduling_lookahead": 2</code></pre></div><div class="warning"><code>scheduling_lookahead</code> must be set to 2, otherwise teyrchain
|
||||
block times will degrade to worse than with sync backing!</div>
|
||||
<h3 id="phase-1---update-teyrchain-runtime"><a class="doc-anchor" href="#phase-1---update-teyrchain-runtime">§</a>Phase 1 - Update Teyrchain Runtime</h3>
|
||||
<p>This phase involves configuring your teyrchain’s runtime <code>/runtime/src/lib.rs</code> to make use of
|
||||
async backing system.</p>
|
||||
<ol>
|
||||
<li>Establish and ensure constants for <code>capacity</code> and <code>velocity</code> are both set to 1 in the
|
||||
runtime.</li>
|
||||
<li>Establish and ensure the constant relay chain slot duration measured in milliseconds equal to
|
||||
<code>6000</code> in the runtime.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// Maximum number of blocks simultaneously accepted by the Runtime, not yet included into the
|
||||
// relay chain.
|
||||
</span><span class="kw">pub const </span>UNINCLUDED_SEGMENT_CAPACITY: u32 = <span class="number">1</span>;
|
||||
<span class="comment">// How many teyrchain blocks are processed by the relay chain per parent. Limits the number of
|
||||
// blocks authored per slot.
|
||||
</span><span class="kw">pub const </span>BLOCK_PROCESSING_VELOCITY: u32 = <span class="number">1</span>;
|
||||
<span class="comment">// Relay chain slot duration, in milliseconds.
|
||||
</span><span class="kw">pub const </span>RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = <span class="number">6000</span>;</code></pre></div>
|
||||
<ol start="3">
|
||||
<li>Establish constants <code>MILLISECS_PER_BLOCK</code> and <code>SLOT_DURATION</code> if not already present in the
|
||||
runtime.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="comment">// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked
|
||||
// up by `pallet_aura` to implement `fn slot_duration()`.
|
||||
//
|
||||
// Change this to adjust the block time.
|
||||
</span><span class="kw">pub const </span>MILLISECS_PER_BLOCK: u64 = <span class="number">12000</span>;
|
||||
<span class="kw">pub const </span>SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;</code></pre></div>
|
||||
<ol start="4">
|
||||
<li>Configure <code>cumulus_pallet_teyrchain_system</code> in the runtime.</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>Define a <code>FixedVelocityConsensusHook</code> using our capacity, velocity, and relay slot duration
|
||||
constants. Use this to set the teyrchain system <code>ConsensusHook</code> property.</li>
|
||||
</ul>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">type </span>ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<
|
||||
Runtime,
|
||||
RELAY_CHAIN_SLOT_DURATION_MILLIS,
|
||||
BLOCK_PROCESSING_VELOCITY,
|
||||
UNINCLUDED_SEGMENT_CAPACITY,
|
||||
>;</code></pre></div>
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>cumulus_pallet_teyrchain_system::Config <span class="kw">for </span>Runtime {
|
||||
..
|
||||
<span class="kw">type </span>ConsensusHook = ConsensusHook;
|
||||
..
|
||||
}</code></pre></div>
|
||||
<ul>
|
||||
<li>Set the teyrchain system property <code>CheckAssociatedRelayNumber</code> to
|
||||
<code>RelayNumberMonotonicallyIncreases</code></li>
|
||||
</ul>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>cumulus_pallet_teyrchain_system::Config <span class="kw">for </span>Runtime {
|
||||
..
|
||||
<span class="kw">type </span>CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases;
|
||||
..
|
||||
}</code></pre></div>
|
||||
<ol start="5">
|
||||
<li>Configure <code>pallet_aura</code> in the runtime.</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>
|
||||
<p>Set <code>AllowMultipleBlocksPerSlot</code> to <code>false</code> (don’t worry, we will set it to <code>true</code> when we
|
||||
activate async backing in phase 3).</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Define <code>pallet_aura::SlotDuration</code> using our constant <code>SLOT_DURATION</code></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>pallet_aura::Config <span class="kw">for </span>Runtime {
|
||||
..
|
||||
<span class="kw">type </span>AllowMultipleBlocksPerSlot = ConstBool<<span class="bool-val">false</span>>;
|
||||
<span class="attr">#[cfg(feature = <span class="string">"experimental"</span>)]
|
||||
</span><span class="kw">type </span>SlotDuration = ConstU64<SLOT_DURATION>;
|
||||
..
|
||||
}</code></pre></div>
|
||||
<ol start="6">
|
||||
<li>Update <code>sp_consensus_aura::AuraApi::slot_duration</code> in <code>sp_api::impl_runtime_apis</code> to match
|
||||
the constant <code>SLOT_DURATION</code></li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>impl_slot_duration() -> sp_consensus_aura::SlotDuration {
|
||||
sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION)
|
||||
}</code></pre></div>
|
||||
<ol start="7">
|
||||
<li>
|
||||
<p>Implement the <code>AuraUnincludedSegmentApi</code>, which allows the collator client to query its
|
||||
runtime to determine whether it should author a block.</p>
|
||||
<ul>
|
||||
<li>Add the dependency <code>cumulus-primitives-aura</code> to the <code>runtime/Cargo.toml</code> file for your
|
||||
runtime</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code>..
|
||||
cumulus-primitives-aura = { path = <span class="string">"../../../../primitives/aura"</span>, default-features = <span class="bool-val">false </span>}
|
||||
..</code></pre></div>
|
||||
<ul>
|
||||
<li>
|
||||
<p>In the same file, add <code>"cumulus-primitives-aura/std",</code> to the <code>std</code> feature.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Inside the <code>impl_runtime_apis!</code> block for your runtime, implement the
|
||||
<code>cumulus_primitives_aura::AuraUnincludedSegmentApi</code> as shown below.</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>impl_can_build_upon(
|
||||
included_hash: <Block <span class="kw">as </span>BlockT>::Hash,
|
||||
slot: cumulus_primitives_aura::Slot,
|
||||
) -> bool {
|
||||
ConsensusHook::can_build_upon(included_hash, slot)
|
||||
}</code></pre></div>
|
||||
<p><strong>Note:</strong> With a capacity of 1 we have an effective velocity of ½ even when velocity is
|
||||
configured to some larger value. This is because capacity will be filled after a single block is
|
||||
produced and will only be freed up after that block is included on the relay chain, which takes
|
||||
2 relay blocks to accomplish. Thus with capacity 1 and velocity 1 we get the customary 12 second
|
||||
teyrchain block time.</p>
|
||||
<ol start="8">
|
||||
<li>If your <code>runtime/src/lib.rs</code> provides a <code>CheckInherents</code> type to <code>register_validate_block</code>,
|
||||
remove it. <code>FixedVelocityConsensusHook</code> makes it unnecessary. The following example shows how
|
||||
<code>register_validate_block</code> should look after removing <code>CheckInherents</code>.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="macro">cumulus_pallet_teyrchain_system::register_validate_block!</span> {
|
||||
Runtime = Runtime,
|
||||
BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,
|
||||
}</code></pre></div><h3 id="phase-2---update-teyrchain-nodes"><a class="doc-anchor" href="#phase-2---update-teyrchain-nodes">§</a>Phase 2 - Update Teyrchain Nodes</h3>
|
||||
<p>This phase consists of plugging in the new lookahead collator node.</p>
|
||||
<ol>
|
||||
<li>Import <code>cumulus_primitives_core::ValidationCode</code> to <code>node/src/service.rs</code>.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">use </span>cumulus_primitives_core::{
|
||||
relay_chain::{CollatorPair, ValidationCode},
|
||||
GetTeyrchainInfo, ParaId,
|
||||
};</code></pre></div>
|
||||
<ol start="2">
|
||||
<li>In <code>node/src/service.rs</code>, modify <code>sc_service::spawn_tasks</code> to use a clone of <code>Backend</code> rather
|
||||
than the original</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code>sc_service::spawn_tasks(sc_service::SpawnTasksParams {
|
||||
..
|
||||
backend: backend.clone(),
|
||||
..
|
||||
})<span class="question-mark">?</span>;</code></pre></div>
|
||||
<ol start="3">
|
||||
<li>Add <code>backend</code> as a parameter to <code>start_consensus()</code> in <code>node/src/service.rs</code></li>
|
||||
</ol>
|
||||
<div class="example-wrap"><pre class="language-text"><code>fn start_consensus(
|
||||
..
|
||||
backend: Arc<TeyrchainBackend>,
|
||||
..</code></pre></div>
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">if </span>validator {
|
||||
start_consensus(
|
||||
..
|
||||
backend.clone(),
|
||||
..
|
||||
)<span class="question-mark">?</span>;
|
||||
}</code></pre></div>
|
||||
<ol start="4">
|
||||
<li>In <code>node/src/service.rs</code> import the lookahead collator rather than the basic collator</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">use </span>cumulus_client_consensus_aura::collators::lookahead::{<span class="self">self </span><span class="kw">as </span>aura, Params <span class="kw">as </span>AuraParams};</code></pre></div>
|
||||
<ol start="5">
|
||||
<li>In <code>start_consensus()</code> replace the <code>BasicAuraParams</code> struct with <code>AuraParams</code>
|
||||
<ul>
|
||||
<li>Change the struct type from <code>BasicAuraParams</code> to <code>AuraParams</code></li>
|
||||
<li>In the <code>para_client</code> field, pass in a cloned para client rather than the original</li>
|
||||
<li>Add a <code>para_backend</code> parameter after <code>para_client</code>, passing in our para backend</li>
|
||||
<li>Provide a <code>code_hash_provider</code> closure like that shown below</li>
|
||||
<li>Increase <code>authoring_duration</code> from 500 milliseconds to 2000</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">let </span>params = AuraParams {
|
||||
..
|
||||
para_client: client.clone(),
|
||||
para_backend: backend.clone(),
|
||||
..
|
||||
code_hash_provider: <span class="kw">move </span>|block_hash| {
|
||||
client.code_at(block_hash).ok().map(|c| ValidationCode::from(c).hash())
|
||||
},
|
||||
..
|
||||
authoring_duration: Duration::from_millis(<span class="number">2000</span>),
|
||||
..
|
||||
};</code></pre></div>
|
||||
<p><strong>Note:</strong> Set <code>authoring_duration</code> to whatever you want, taking your own hardware into account.
|
||||
But if the backer who should be slower than you due to reading from disk, times out at two
|
||||
seconds your candidates will be rejected.</p>
|
||||
<ol start="6">
|
||||
<li>In <code>start_consensus()</code> replace <code>basic_aura::run</code> with <code>aura::run</code></li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">let </span>fut =
|
||||
aura::run::<Block, sp_consensus_aura::sr25519::AuthorityPair, <span class="kw">_</span>, <span class="kw">_</span>, <span class="kw">_</span>, <span class="kw">_</span>, <span class="kw">_</span>, <span class="kw">_</span>, <span class="kw">_</span>, <span class="kw">_</span>, <span class="kw">_</span>>(
|
||||
params,
|
||||
);
|
||||
task_manager.spawn_essential_handle().spawn(<span class="string">"aura"</span>, <span class="prelude-val">None</span>, fut);</code></pre></div><h3 id="phase-3---activate-async-backing"><a class="doc-anchor" href="#phase-3---activate-async-backing">§</a>Phase 3 - Activate Async Backing</h3>
|
||||
<p>This phase consists of changes to your teyrchain’s runtime that activate async backing feature.</p>
|
||||
<ol>
|
||||
<li>Configure <code>pallet_aura</code>, setting <code>AllowMultipleBlocksPerSlot</code> to true in
|
||||
<code>runtime/src/lib.rs</code>.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>pallet_aura::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>AuthorityId = AuraId;
|
||||
<span class="kw">type </span>DisabledValidators = ();
|
||||
<span class="kw">type </span>MaxAuthorities = ConstU32<<span class="number">100_000</span>>;
|
||||
<span class="kw">type </span>AllowMultipleBlocksPerSlot = ConstBool<<span class="bool-val">true</span>>;
|
||||
<span class="kw">type </span>SlotDuration = ConstU64<SLOT_DURATION>;
|
||||
}</code></pre></div>
|
||||
<ol start="2">
|
||||
<li>Increase the maximum <code>UNINCLUDED_SEGMENT_CAPACITY</code> in <code>runtime/src/lib.rs</code>.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">mod </span>async_backing_params {
|
||||
<span class="doccomment">/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included
|
||||
/// into the relay chain.
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const </span>UNINCLUDED_SEGMENT_CAPACITY: u32 = <span class="number">3</span>;
|
||||
<span class="doccomment">/// How many teyrchain blocks are processed by the relay chain per parent. Limits the
|
||||
/// number of blocks authored per slot.
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const </span>BLOCK_PROCESSING_VELOCITY: u32 = <span class="number">1</span>;
|
||||
<span class="doccomment">/// Relay chain slot duration, in milliseconds.
|
||||
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">const </span>RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = <span class="number">6000</span>;
|
||||
}</code></pre></div>
|
||||
<ol start="3">
|
||||
<li>Decrease <code>MILLISECS_PER_BLOCK</code> to 6000.</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>Note: For a teyrchain which measures time in terms of its own block number rather than by
|
||||
relay block number it may be preferable to increase velocity. Changing block time may cause
|
||||
complications, requiring additional changes. See the section “Timing by Block Number”.</li>
|
||||
</ul>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">mod </span>block_times {
|
||||
<span class="doccomment">/// This determines the average expected block time that we are targeting. Blocks will be
|
||||
/// produced at a minimum duration defined by `SLOT_DURATION`. `SLOT_DURATION` is picked up by
|
||||
/// `pallet_timestamp` which is in turn picked up by `pallet_aura` to implement `fn
|
||||
/// slot_duration()`.
|
||||
///
|
||||
/// Change this to adjust the block time.
|
||||
</span><span class="kw">pub const </span>MILLI_SECS_PER_BLOCK: u64 = <span class="number">6000</span>;
|
||||
|
||||
<span class="comment">// NOTE: Currently it is not possible to change the slot duration after the chain has started.
|
||||
// Attempting to do so will brick block production.
|
||||
</span><span class="kw">pub const </span>SLOT_DURATION: u64 = MILLI_SECS_PER_BLOCK;
|
||||
}</code></pre></div>
|
||||
<ol start="4">
|
||||
<li>Update <code>MAXIMUM_BLOCK_WEIGHT</code> to reflect the increased time available for block production.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">const </span>MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
|
||||
WEIGHT_REF_TIME_PER_SECOND.saturating_mul(<span class="number">2</span>),
|
||||
cumulus_primitives_core::relay_chain::MAX_POV_SIZE <span class="kw">as </span>u64,
|
||||
);</code></pre></div>
|
||||
<ol start="5">
|
||||
<li>Add a feature flagged alternative for <code>MinimumPeriod</code> in <code>pallet_timestamp</code>. The type should
|
||||
be <code>ConstU64<0></code> with the feature flag experimental, and <code>ConstU64<{SLOT_DURATION / 2}></code>
|
||||
without.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>pallet_timestamp::Config <span class="kw">for </span>Runtime {
|
||||
..
|
||||
<span class="attr">#[cfg(feature = <span class="string">"experimental"</span>)]
|
||||
</span><span class="kw">type </span>MinimumPeriod = ConstU64<<span class="number">0</span>>;
|
||||
<span class="attr">#[cfg(not(feature = <span class="string">"experimental"</span>))]
|
||||
</span><span class="kw">type </span>MinimumPeriod = ConstU64<{ SLOT_DURATION / <span class="number">2 </span>}>;
|
||||
..
|
||||
}</code></pre></div><h3 id="timing-by-block-number"><a class="doc-anchor" href="#timing-by-block-number">§</a>Timing by Block Number</h3>
|
||||
<p>With asynchronous backing it will be possible for teyrchains to opt for a block time of 6
|
||||
seconds rather than 12 seconds. But modifying block duration isn’t so simple for a teyrchain
|
||||
which was measuring time in terms of its own block number. It could result in expected and
|
||||
actual time not matching up, stalling the teyrchain.</p>
|
||||
<p>One strategy to deal with this issue is to instead rely on relay chain block numbers for timing.
|
||||
Relay block number is kept track of by each teyrchain in <code>pallet-teyrchain-system</code> with the
|
||||
storage value <code>LastRelayChainBlockNumber</code>. This value can be obtained and used wherever timing
|
||||
based on block number is needed.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {};
|
||||
@@ -1,141 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="How to enable elastic scaling on a teyrchain."><title>pezkuwi_sdk_docs::guides::enable_elastic_scaling - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module enable_elastic_scaling</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module enable_<wbr>elastic_<wbr>scaling</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#enable-elastic-scaling-for-a-teyrchain" title="Enable elastic scaling for a teyrchain">Enable elastic scaling for a teyrchain</a><ul><li><a href="#quick-introduction-to-elastic-scaling" title="Quick introduction to Elastic Scaling">Quick introduction to Elastic Scaling</a></li><li><a href="#dependencies" title="Dependencies">Dependencies</a></li><li><a href="#current-limitations" title="Current limitations">Current limitations</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../index.html">guides</a></div><h1>Module <span>enable_<wbr>elastic_<wbr>scaling</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/pezkuwi_sdk_docs/guides/enable_elastic_scaling.rs.html#1-182">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>How to enable elastic scaling on a teyrchain.</p>
|
||||
<h2 id="enable-elastic-scaling-for-a-teyrchain"><a class="doc-anchor" href="#enable-elastic-scaling-for-a-teyrchain">§</a>Enable elastic scaling for a teyrchain</h2><div class="warning">This guide assumes full familiarity with Asynchronous Backing and its
|
||||
terminology, as defined in <a href="https://docs.pezkuwichain.io/sdk/master/pezkuwi_sdk_docs/guides/async_backing_guide/index.html">the Pezkuwi SDK Docs</a>.
|
||||
</div>
|
||||
<h3 id="quick-introduction-to-elastic-scaling"><a class="doc-anchor" href="#quick-introduction-to-elastic-scaling">§</a>Quick introduction to Elastic Scaling</h3>
|
||||
<p><a href="https://www.parity.io/blog/pezkuwi-web3-cloud">Elastic scaling</a> is a feature that enables teyrchains (rollups) to use multiple cores.
|
||||
Teyrchains can adjust their usage of core resources on the fly to increase TPS and decrease
|
||||
latency.</p>
|
||||
<h4 id="when-do-you-need-elastic-scaling"><a class="doc-anchor" href="#when-do-you-need-elastic-scaling">§</a>When do you need Elastic Scaling?</h4>
|
||||
<p>Depending on their use case, applications might have an increased need for the following:</p>
|
||||
<ul>
|
||||
<li>compute (CPU weight)</li>
|
||||
<li>bandwidth (proof size)</li>
|
||||
<li>lower latency (block time)</li>
|
||||
</ul>
|
||||
<h4 id="high-throughput-tps-and-lower-latency"><a class="doc-anchor" href="#high-throughput-tps-and-lower-latency">§</a>High throughput (TPS) and lower latency</h4>
|
||||
<p>If the main bottleneck is the CPU, then your teyrchain needs to maximize the compute usage of
|
||||
each core while also achieving a lower latency.
|
||||
3 cores provide the best balance between CPU, bandwidth and latency: up to 6s of execution,
|
||||
5MB/s of DA bandwidth and fast block time of just 2 seconds.</p>
|
||||
<h4 id="high-bandwidth"><a class="doc-anchor" href="#high-bandwidth">§</a>High bandwidth</h4>
|
||||
<p>Useful for applications that are bottlenecked by bandwidth.
|
||||
By using 6 cores, applications can make use of up to 6s of compute, 10MB/s of bandwidth
|
||||
while also achieving 1 second block times.</p>
|
||||
<h4 id="ultra-low-latency"><a class="doc-anchor" href="#ultra-low-latency">§</a>Ultra low latency</h4>
|
||||
<p>When latency is the primary requirement, Elastic scaling is currently the only solution. The
|
||||
caveat is the efficiency of core time usage decreases as more cores are used.</p>
|
||||
<p>For example, using 12 cores enables fast transaction confirmations with 500ms blocks and up to
|
||||
20 MB/s of DA bandwidth.</p>
|
||||
<h3 id="dependencies"><a class="doc-anchor" href="#dependencies">§</a>Dependencies</h3>
|
||||
<p>Prerequisites: Pezkuwi-SDK <code>2509</code> or newer.</p>
|
||||
<p>To ensure the security and reliability of your chain when using this feature you need the
|
||||
following:</p>
|
||||
<ul>
|
||||
<li>An omni-node based collator. This has already become the default choice for collators.</li>
|
||||
<li>UMP signal support.
|
||||
<a href="https://github.com/pezkuwichain/pezkuwi-fellows/RFCs/blob/main/text/0103-introduce-core-index-commitment.md">RFC103</a>.
|
||||
This is mandatory protection against PoV replay attacks.</li>
|
||||
<li>Enabling the relay parent offset feature. This is required to ensure the teyrchain block times
|
||||
and transaction in-block confidence are not negatively affected by relay chain forks. Read
|
||||
<a href="../handling_teyrchain_forks/index.html" title="mod pezkuwi_sdk_docs::guides::handling_teyrchain_forks"><code>crate::guides::handling_teyrchain_forks</code></a> for more information.</li>
|
||||
<li>Block production configuration adjustments.</li>
|
||||
</ul>
|
||||
<h4 id="upgrade-to-pezkuwi-omni-node"><a class="doc-anchor" href="#upgrade-to-pezkuwi-omni-node">§</a>Upgrade to Pezkuwi Omni node</h4>
|
||||
<p>Your collators need to run <code>pezkuwi-teyrchain</code> or <code>pezkuwi-omni-node</code> with the <code>--authoring slot-based</code> CLI argument.
|
||||
To avoid potential issues and get best performance it is recommeneded to always run the<br />
|
||||
latest release on all of the collators.</p>
|
||||
<p>Further information about omni-node and how to upgrade is available:</p>
|
||||
<ul>
|
||||
<li><a href="https://docs.pezkuwichain.io/develop/toolkit/teyrchains/pezkuwi-omni-node/">high level docs</a></li>
|
||||
<li><a href="../../reference_docs/omni_node/index.html" title="mod pezkuwi_sdk_docs::reference_docs::omni_node"><code>crate::reference_docs::omni_node</code></a></li>
|
||||
</ul>
|
||||
<h4 id="ump-signals"><a class="doc-anchor" href="#ump-signals">§</a>UMP signals</h4>
|
||||
<p>UMP signals are now enabled by default in the <code>teyrchain-system</code> pallet and are used for
|
||||
elastic scaling. You can find more technical details about UMP signals and their usage for
|
||||
elastic scaling
|
||||
<a href="https://github.com/pezkuwichain/pezkuwi-fellows/RFCs/blob/main/text/0103-introduce-core-index-commitment.md">here</a>.</p>
|
||||
<h4 id="enable-the-relay-parent-offset-feature"><a class="doc-anchor" href="#enable-the-relay-parent-offset-feature">§</a>Enable the relay parent offset feature</h4>
|
||||
<p>It is recommended to use an offset of <code>1</code>, which is sufficient to eliminate any issues
|
||||
with relay chain forks.</p>
|
||||
<p>Configure the relay parent offset like this:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code> <span class="doccomment">/// Build with an offset of 1 behind the relay chain best block.
|
||||
</span><span class="kw">const </span>RELAY_PARENT_OFFSET: u32 = <span class="number">1</span>;
|
||||
|
||||
<span class="kw">impl </span>cumulus_pallet_teyrchain_system::Config <span class="kw">for </span>Runtime {
|
||||
<span class="comment">// ...
|
||||
</span><span class="kw">type </span>RelayParentOffset = ConstU32<RELAY_PARENT_OFFSET>;
|
||||
}</code></pre></div>
|
||||
<p>Implement the runtime API to retrieve the offset on the client side.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code> <span class="kw">impl </span>cumulus_primitives_core::RelayParentOffsetApi<Block> <span class="kw">for </span>Runtime {
|
||||
<span class="kw">fn </span>relay_parent_offset() -> u32 {
|
||||
RELAY_PARENT_OFFSET
|
||||
}
|
||||
}</code></pre></div><h4 id="block-production-configuration"><a class="doc-anchor" href="#block-production-configuration">§</a>Block production configuration</h4>
|
||||
<p>This configuration directly controls the minimum block time and maximum number of cores
|
||||
the teyrchain can use.</p>
|
||||
<p>Example configuration for a 3 core teyrchain:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code> <span class="doccomment">/// The upper limit of how many teyrchain blocks are processed by the relay chain per
|
||||
/// parent. Limits the number of blocks authored per slot. This determines the minimum
|
||||
/// block time of the teyrchain:
|
||||
/// `RELAY_CHAIN_SLOT_DURATION_MILLIS/BLOCK_PROCESSING_VELOCITY`
|
||||
</span><span class="kw">const </span>BLOCK_PROCESSING_VELOCITY: u32 = <span class="number">3</span>;
|
||||
|
||||
<span class="doccomment">/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included
|
||||
/// into the relay chain.
|
||||
</span><span class="kw">const </span>UNINCLUDED_SEGMENT_CAPACITY: u32 = (<span class="number">2 </span>+ RELAY_PARENT_OFFSET) *
|
||||
BLOCK_PROCESSING_VELOCITY + <span class="number">1</span>;
|
||||
|
||||
<span class="doccomment">/// Relay chain slot duration, in milliseconds.
|
||||
</span><span class="kw">const </span>RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = <span class="number">6000</span>;
|
||||
|
||||
<span class="kw">type </span>ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<
|
||||
Runtime,
|
||||
RELAY_CHAIN_SLOT_DURATION_MILLIS,
|
||||
BLOCK_PROCESSING_VELOCITY,
|
||||
UNINCLUDED_SEGMENT_CAPACITY,
|
||||
>;
|
||||
</code></pre></div><h4 id="teyrchain-slot-duration"><a class="doc-anchor" href="#teyrchain-slot-duration">§</a>Teyrchain Slot Duration</h4>
|
||||
<p>A common source of confusion is the correct configuration of the <code>SlotDuration</code> that is passed
|
||||
to <code>pallet-aura</code>.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>pallet_aura::Config <span class="kw">for </span>Runtime {
|
||||
<span class="comment">// ...
|
||||
</span><span class="kw">type </span>SlotDuration = ConstU64<SLOT_DURATION>;
|
||||
}</code></pre></div>
|
||||
<p>The slot duration determines the length of each author’s turn and is decoupled from the block
|
||||
production interval. During their slot, authors are allowed to produce multiple blocks. <strong>The
|
||||
slot duration is required to be at least 6s (same as on the relay chain).</strong></p>
|
||||
<p><strong>Configuration recommendations:</strong></p>
|
||||
<ul>
|
||||
<li>For new teyrchains starting from genesis: use a slot duration of 24 seconds</li>
|
||||
<li>For existing live teyrchains: leave the slot duration unchanged</li>
|
||||
</ul>
|
||||
<h3 id="current-limitations"><a class="doc-anchor" href="#current-limitations">§</a>Current limitations</h3><h4 id="maximum-execution-time-per-relay-chain-block"><a class="doc-anchor" href="#maximum-execution-time-per-relay-chain-block">§</a>Maximum execution time per relay chain block.</h4>
|
||||
<p>Since teyrchain block authoring is sequential, the next block can only be built after
|
||||
the previous one has been imported.
|
||||
At present, a core allows up to 2 seconds of execution per relay chain block.</p>
|
||||
<p>If we assume a 6s teyrchain slot, and each block takes the full 2 seconds to execute,
|
||||
the teyrchain will not be able to fully utilize the compute resources of all 3 cores.</p>
|
||||
<p>If the collator hardware is faster, it can author and import full blocks more quickly,
|
||||
making it possible to utilize even more than 3 cores efficiently.</p>
|
||||
<h5 id="why"><a class="doc-anchor" href="#why">§</a>Why?</h5>
|
||||
<p>Within a 6-second teyrchain slot, collators can author multiple teyrchain blocks.
|
||||
Before building the first block in a slot, the new block author must import the last
|
||||
block produced by the previous author.
|
||||
If the import of the last block is not completed before the next relay chain slot starts,
|
||||
the new author will build on its parent (assuming it was imported). This will create a fork
|
||||
which degrades the teyrchain block confidence and block times.</p>
|
||||
<p>This means that, on reference hardware, a teyrchain with a slot time of 6s can
|
||||
effectively utilize up to 4 seconds of execution per relay chain block, because it needs to
|
||||
ensure the next block author has enough time to import the last block.
|
||||
Hardware with higher single-core performance can enable a teyrchain to fully utilize more
|
||||
cores.</p>
|
||||
<h4 id="fixed-factor-scaling"><a class="doc-anchor" href="#fixed-factor-scaling">§</a>Fixed factor scaling.</h4>
|
||||
<p>For true elasticity, a teyrchain needs to acquire more cores when needed in an automated
|
||||
manner. This functionality is not yet available in the SDK, thus acquiring additional
|
||||
on-demand or bulk cores has to be managed externally.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {};
|
||||
@@ -1,96 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="How to enable metadata hash verification in the runtime."><title>pezkuwi_sdk_docs::guides::enable_metadata_hash - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module enable_metadata_hash</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module enable_<wbr>metadata_<wbr>hash</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#enable-metadata-hash-verification" title="Enable metadata hash verification">Enable metadata hash verification</a><ul><li><a href="#what-is-metadata-hash-verification" title="What is metadata hash verification?">What is metadata hash verification?</a></li><li><a href="#integrating-metadata-hash-verification-into-your-runtime" title="Integrating metadata hash verification into your runtime">Integrating metadata hash verification into your runtime</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../index.html">guides</a></div><h1>Module <span>enable_<wbr>metadata_<wbr>hash</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/pezkuwi_sdk_docs/guides/enable_metadata_hash.rs.html#1-88">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>How to enable metadata hash verification in the runtime.</p>
|
||||
<h2 id="enable-metadata-hash-verification"><a class="doc-anchor" href="#enable-metadata-hash-verification">§</a>Enable metadata hash verification</h2>
|
||||
<p>This guide will teach you how to enable the metadata hash verification in your runtime.</p>
|
||||
<h3 id="what-is-metadata-hash-verification"><a class="doc-anchor" href="#what-is-metadata-hash-verification">§</a>What is metadata hash verification?</h3>
|
||||
<p>Each FRAME based runtime exposes metadata about itself. This metadata is used by consumers of
|
||||
the runtime to interpret the state, to construct transactions etc. Part of this metadata are the
|
||||
type information. These type information can be used to e.g. decode storage entries or to decode
|
||||
a transaction. So, the metadata is quite useful for wallets to interact with a FRAME based
|
||||
chain. Online wallets can fetch the metadata directly from any node of the chain they are
|
||||
connected to, but offline wallets can not do this. So, for the offline wallet to have access to
|
||||
the metadata it needs to be transferred and stored on the device. The problem is that the
|
||||
metadata has a size of several hundreds of kilobytes, which takes quite a while to transfer to
|
||||
these offline wallets and the internal storage of these devices is also not big enough to store
|
||||
the metadata for one or more networks. The next problem is that the offline wallet/user can not
|
||||
trust the metadata to be correct. It is very important for the metadata to be correct or
|
||||
otherwise an attacker could change them in a way that the offline wallet decodes a transaction
|
||||
in a different way than what it will be decoded to on chain. So, the user may sign an incorrect
|
||||
transaction leading to unexpected behavior.</p>
|
||||
<p>The metadata hash verification circumvents the issues of the huge metadata and the need to trust
|
||||
some metadata blob to be correct. To generate a hash for the metadata, the metadata is chunked,
|
||||
these chunks are put into a merkle tree and then the root of this merkle tree is the “metadata
|
||||
hash”. For a more technical explanation on how it works, see
|
||||
<a href="https://pezkuwi-fellows.github.io/RFCs/approved/0078-merkleized-metadata.html">RFC78</a>. At compile
|
||||
time the metadata hash is generated and “baked” into the runtime. This makes it extremely cheap
|
||||
for the runtime to verify on chain that the metadata hash is correct. By having the runtime
|
||||
verify the hash on chain, the user also doesn’t need to trust the offchain metadata. If the
|
||||
metadata hash doesn’t match the on chain metadata hash the transaction will be rejected. The
|
||||
metadata hash itself is added to the data of the transaction that is signed, this means the
|
||||
actual hash does not appear in the transaction. On chain the same procedure is repeated with the
|
||||
metadata hash that is known by the runtime and if the metadata hash doesn’t match the signature
|
||||
verification will fail. As the metadata hash is actually the root of a merkle tree, the offline
|
||||
wallet can get proofs of individual types to decode a transaction. This means that the offline
|
||||
wallet does not require the entire metadata to be present on the device.</p>
|
||||
<h3 id="integrating-metadata-hash-verification-into-your-runtime"><a class="doc-anchor" href="#integrating-metadata-hash-verification-into-your-runtime">§</a>Integrating metadata hash verification into your runtime</h3>
|
||||
<p>The integration of the metadata hash verification is split into two parts, first the actual
|
||||
integration into the runtime and secondly the enabling of the metadata hash generation at
|
||||
compile time.</p>
|
||||
<h4 id="runtime-integration"><a class="doc-anchor" href="#runtime-integration">§</a>Runtime integration</h4>
|
||||
<p>From the runtime side only the
|
||||
<a href="frame_metadata_hash_extension::CheckMetadataHash"><code>CheckMetadataHash</code></a> needs to be added to the
|
||||
list of signed extension:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub type </span>TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim<
|
||||
Runtime,
|
||||
(
|
||||
frame_system::AuthorizeCall<Runtime>,
|
||||
frame_system::CheckNonZeroSender<Runtime>,
|
||||
frame_system::CheckSpecVersion<Runtime>,
|
||||
frame_system::CheckTxVersion<Runtime>,
|
||||
frame_system::CheckGenesis<Runtime>,
|
||||
frame_system::CheckEra<Runtime>,
|
||||
frame_system::CheckNonce<Runtime>,
|
||||
frame_system::CheckWeight<Runtime>,
|
||||
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
|
||||
),
|
||||
>;</code></pre></div>
|
||||
<blockquote>
|
||||
<p><strong>Note:</strong></p>
|
||||
<p>Adding the signed extension changes the encoding of the transaction and adds one extra byte
|
||||
per transaction!</p>
|
||||
</blockquote>
|
||||
<p>This signed extension will make sure to decode the requested <code>mode</code> and will add the metadata
|
||||
hash to the signed data depending on the requested <code>mode</code>. The <code>mode</code> gives the user/wallet
|
||||
control over deciding if the metadata hash should be verified or not. The metadata hash itself
|
||||
is drawn from the <code>RUNTIME_METADATA_HASH</code> environment variable. If the environment variable is
|
||||
not set, any transaction that requires the metadata hash is rejected with the error
|
||||
<code>CannotLookup</code>. This is a security measurement to prevent including invalid transactions.</p>
|
||||
<div class="warning">
|
||||
<p>The extension does not work with the native runtime, because the
|
||||
<code>RUNTIME_METADATA_HASH</code> environment variable is not set when building the
|
||||
<code>frame-metadata-hash-extension</code> crate.</p>
|
||||
</div>
|
||||
<h4 id="enable-metadata-hash-generation"><a class="doc-anchor" href="#enable-metadata-hash-generation">§</a>Enable metadata hash generation</h4>
|
||||
<p>The metadata hash generation needs to be enabled when building the wasm binary. The
|
||||
<code>substrate-wasm-builder</code> supports this out of the box:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[cfg(all(feature = <span class="string">"std"</span>, feature = <span class="string">"metadata-hash"</span>))]
|
||||
</span><span class="kw">fn </span>main() {
|
||||
substrate_wasm_builder::WasmBuilder::init_with_defaults()
|
||||
.enable_metadata_hash(<span class="string">"UNIT"</span>, <span class="number">12</span>)
|
||||
.build();
|
||||
}</code></pre></div>
|
||||
<blockquote>
|
||||
<p><strong>Note:</strong></p>
|
||||
<p>The <code>metadata-hash</code> feature needs to be enabled for the <code>substrate-wasm-builder</code> to enable the
|
||||
code for being able to generate the metadata hash. It is also recommended to put the metadata
|
||||
hash generation behind a feature in the runtime as shown above. The reason behind is that it
|
||||
adds a lot of code which increases the compile time and the generation itself also increases
|
||||
the compile time. Thus, it is recommended to enable the feature only when the metadata hash is
|
||||
required (e.g. for an on-chain build).</p>
|
||||
</blockquote>
|
||||
<p>The two parameters to <code>enable_metadata_hash</code> are the token symbol and the number of decimals of
|
||||
the primary token of the chain. These information are included for the wallets to show token
|
||||
related operations in a more user friendly way.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {};
|
||||
@@ -1,161 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="How to enhance a given runtime and node to be cumulus-enabled, run it as a teyrchain and connect it to a relay-chain. How to enable storage weight reclaiming in a teyrchain node and runtime."><title>pezkuwi_sdk_docs::guides::enable_pov_reclaim - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module enable_pov_reclaim</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module enable_<wbr>pov_<wbr>reclaim</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#enable-storage-weight-reclaiming" title="Enable storage weight reclaiming">Enable storage weight reclaiming</a></li><li><a href="#what-is-pov-reclaim" title="What is PoV reclaim?">What is PoV reclaim?</a></li><li><a href="#how-to-enable-pov-reclaim" title="How to enable PoV reclaim">How to enable PoV reclaim</a><ul><li><a href="#1-add-the-host-function-to-your-node" title="1. Add the host function to your node">1. Add the host function to your node</a></li><li><a href="#2-enable-storage-proof-recording-during-import" title="2. Enable storage proof recording during import">2. Enable storage proof recording during import</a></li><li><a href="#3-add-the-transactionextension-to-your-runtime" title="3. Add the TransactionExtension to your runtime">3. Add the TransactionExtension to your runtime</a></li><li><a href="#optional-verify-that-reclaim-works" title="Optional: Verify that reclaim works">Optional: Verify that reclaim works</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../index.html">guides</a></div><h1>Module <span>enable_<wbr>pov_<wbr>reclaim</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/pezkuwi_sdk_docs/guides/enable_pov_reclaim.rs.html#1-88">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>How to enhance a given runtime and node to be cumulus-enabled, run it as a teyrchain
|
||||
and connect it to a relay-chain.
|
||||
How to enable storage weight reclaiming in a teyrchain node and runtime.</p>
|
||||
<h2 id="enable-storage-weight-reclaiming"><a class="doc-anchor" href="#enable-storage-weight-reclaiming">§</a>Enable storage weight reclaiming</h2>
|
||||
<p>This guide will teach you how to enable storage weight reclaiming for a teyrchain. The
|
||||
explanations in this guide assume a project structure similar to the one detailed in
|
||||
the <a href="../../pezkuwi_sdk/substrate/index.html#anatomy-of-a-binary-crate" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::substrate">substrate documentation</a>. Full
|
||||
technical details are available in the original <a href="https://github.com/pezkuwichain/pezkuwi-sdk/pull/3002">pull request</a>.</p>
|
||||
<h2 id="what-is-pov-reclaim"><a class="doc-anchor" href="#what-is-pov-reclaim">§</a>What is PoV reclaim?</h2>
|
||||
<p>When a teyrchain submits a block to a relay chain like Pezkuwi or Kusama, it sends the block
|
||||
itself and a storage proof. Together they form the Proof-of-Validity (PoV). The PoV allows the
|
||||
relay chain to validate the teyrchain block by re-executing it. Relay chain
|
||||
validators distribute this PoV among themselves over the network. This distribution is costly
|
||||
and limits the size of the storage proof. The storage weight dimension of FRAME weights reflects
|
||||
this cost and limits the size of the storage proof. However, the storage weight determined
|
||||
during <a href="../../reference_docs/frame_benchmarking_weight/index.html" title="mod pezkuwi_sdk_docs::reference_docs::frame_benchmarking_weight">benchmarking</a> represents the worst
|
||||
case. In reality, runtime operations often consume less space in the storage proof. PoV reclaim
|
||||
offers a mechanism to reclaim the difference between the benchmarked worst-case and the real
|
||||
proof-size consumption.</p>
|
||||
<h2 id="how-to-enable-pov-reclaim"><a class="doc-anchor" href="#how-to-enable-pov-reclaim">§</a>How to enable PoV reclaim</h2><h3 id="1-add-the-host-function-to-your-node"><a class="doc-anchor" href="#1-add-the-host-function-to-your-node">§</a>1. Add the host function to your node</h3>
|
||||
<p>To reclaim excess storage weight, a teyrchain runtime needs the
|
||||
ability to fetch the size of the storage proof from the node. The reclaim
|
||||
mechanism uses the
|
||||
<a href="cumulus_primitives_proof_size_hostfunction::storage_proof_size"><code>storage_proof_size</code></a>
|
||||
host function for this purpose. For convenience, cumulus provides
|
||||
<a href="cumulus_client_service::TeyrchainHostFunctions"><code>TeyrchainHostFunctions</code></a>, a set of
|
||||
host functions typically used by cumulus-based teyrchains. In the binary crate of your
|
||||
teyrchain, find the instantiation of the <a href="sc_executor::WasmExecutor"><code>WasmExecutor</code></a> and set the
|
||||
correct generic type.</p>
|
||||
<p>This example from the teyrchain-template shows a type definition that includes the correct
|
||||
host functions.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">type </span>TeyrchainExecutor = WasmExecutor<TeyrchainHostFunctions>;</code></pre></div>
|
||||
<blockquote>
|
||||
<p><strong>Note:</strong></p>
|
||||
<p>If you see error <code>runtime requires function imports which are not present on the host: 'env:ext_storage_proof_size_storage_proof_size_version_1'</code>, it is likely
|
||||
that this step in the guide was not set up correctly.</p>
|
||||
</blockquote>
|
||||
<h3 id="2-enable-storage-proof-recording-during-import"><a class="doc-anchor" href="#2-enable-storage-proof-recording-during-import">§</a>2. Enable storage proof recording during import</h3>
|
||||
<p>The reclaim mechanism reads the size of the currently recorded storage proof multiple times
|
||||
during block authoring and block import. Proof recording during authoring is already enabled on
|
||||
teyrchains. You must also ensure that storage proof recording is enabled during block import.
|
||||
Find where your node builds the fundamental substrate components by calling
|
||||
<a href="sc_service::new_full_parts"><code>new_full_parts</code></a>. Replace this
|
||||
with <a href="sc_service::new_full_parts_record_import"><code>new_full_parts_record_import</code></a> and
|
||||
pass <code>true</code> as the last parameter to enable import recording.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub fn </span>new_partial(config: <span class="kw-2">&</span>Configuration) -> <span class="prelude-ty">Result</span><Service, sc_service::Error> {
|
||||
<span class="kw">let </span>telemetry = config
|
||||
.telemetry_endpoints
|
||||
.clone()
|
||||
.filter(|x| !x.is_empty())
|
||||
.map(|endpoints| -> <span class="prelude-ty">Result</span><<span class="kw">_</span>, sc_telemetry::Error> {
|
||||
<span class="kw">let </span>worker = TelemetryWorker::new(<span class="number">16</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>telemetry = worker.handle().new_telemetry(endpoints);
|
||||
<span class="prelude-val">Ok</span>((worker, telemetry))
|
||||
})
|
||||
.transpose()<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">let </span>heap_pages = config
|
||||
.executor
|
||||
.default_heap_pages
|
||||
.map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h <span class="kw">as _ </span>});
|
||||
|
||||
<span class="kw">let </span>executor = TeyrchainExecutor::builder()
|
||||
.with_execution_method(config.executor.wasm_method)
|
||||
.with_onchain_heap_alloc_strategy(heap_pages)
|
||||
.with_offchain_heap_alloc_strategy(heap_pages)
|
||||
.with_max_runtime_instances(config.executor.max_runtime_instances)
|
||||
.with_runtime_cache_size(config.executor.runtime_cache_size)
|
||||
.build();
|
||||
|
||||
<span class="kw">let </span>(client, backend, keystore_container, task_manager) =
|
||||
sc_service::new_full_parts_record_import::<Block, RuntimeApi, <span class="kw">_</span>>(
|
||||
config,
|
||||
telemetry.as_ref().map(|(<span class="kw">_</span>, telemetry)| telemetry.handle()),
|
||||
executor,
|
||||
<span class="bool-val">true</span>,
|
||||
)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>client = Arc::new(client);
|
||||
|
||||
<span class="kw">let </span>telemetry_worker_handle = telemetry.as_ref().map(|(worker, <span class="kw">_</span>)| worker.handle());
|
||||
|
||||
<span class="kw">let </span>telemetry = telemetry.map(|(worker, telemetry)| {
|
||||
task_manager.spawn_handle().spawn(<span class="string">"telemetry"</span>, <span class="prelude-val">None</span>, worker.run());
|
||||
telemetry
|
||||
});
|
||||
|
||||
<span class="kw">let </span>transaction_pool = Arc::from(
|
||||
sc_transaction_pool::Builder::new(
|
||||
task_manager.spawn_essential_handle(),
|
||||
client.clone(),
|
||||
config.role.is_authority().into(),
|
||||
)
|
||||
.with_options(config.transaction_pool.clone())
|
||||
.with_prometheus(config.prometheus_registry())
|
||||
.build(),
|
||||
);
|
||||
|
||||
<span class="kw">let </span>block_import = TeyrchainBlockImport::new(client.clone(), backend.clone());
|
||||
|
||||
<span class="kw">let </span>import_queue = build_import_queue(
|
||||
client.clone(),
|
||||
block_import.clone(),
|
||||
config,
|
||||
telemetry.as_ref().map(|telemetry| telemetry.handle()),
|
||||
<span class="kw-2">&</span>task_manager,
|
||||
);
|
||||
|
||||
<span class="prelude-val">Ok</span>(PartialComponents {
|
||||
backend,
|
||||
client,
|
||||
import_queue,
|
||||
keystore_container,
|
||||
task_manager,
|
||||
transaction_pool,
|
||||
select_chain: (),
|
||||
other: (block_import, telemetry, telemetry_worker_handle),
|
||||
})
|
||||
}</code></pre></div>
|
||||
<blockquote>
|
||||
<p><strong>Note:</strong></p>
|
||||
<p>If you see error <code>Storage root must match that calculated.</code> during block import, it is likely
|
||||
that this step in the guide was not
|
||||
set up correctly.</p>
|
||||
</blockquote>
|
||||
<h3 id="3-add-the-transactionextension-to-your-runtime"><a class="doc-anchor" href="#3-add-the-transactionextension-to-your-runtime">§</a>3. Add the TransactionExtension to your runtime</h3>
|
||||
<p>In your runtime, you will find a list of TransactionExtensions.
|
||||
To enable the reclaiming,
|
||||
set <a href="cumulus_pallet_weight_reclaim::StorageWeightReclaim"><code>StorageWeightReclaim</code></a>
|
||||
as a warpper of that list.
|
||||
It is necessary that this extension wraps all the other transaction extensions in order to catch
|
||||
the whole PoV size of the transactions.
|
||||
The extension will check the size of the storage proof before and after an extrinsic execution.
|
||||
It reclaims the difference between the calculated size and the benchmarked size.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub type </span>TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim<
|
||||
Runtime,
|
||||
(
|
||||
frame_system::AuthorizeCall<Runtime>,
|
||||
frame_system::CheckNonZeroSender<Runtime>,
|
||||
frame_system::CheckSpecVersion<Runtime>,
|
||||
frame_system::CheckTxVersion<Runtime>,
|
||||
frame_system::CheckGenesis<Runtime>,
|
||||
frame_system::CheckEra<Runtime>,
|
||||
frame_system::CheckNonce<Runtime>,
|
||||
frame_system::CheckWeight<Runtime>,
|
||||
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
|
||||
),
|
||||
>;</code></pre></div><h3 id="optional-verify-that-reclaim-works"><a class="doc-anchor" href="#optional-verify-that-reclaim-works">§</a>Optional: Verify that reclaim works</h3>
|
||||
<p>Start your node with the log target <code>runtime::storage_reclaim</code> set to <code>trace</code> to enable full
|
||||
logging for <code>StorageWeightReclaim</code>. The following log is an example from a local testnet. To
|
||||
trigger the log, execute any extrinsic on the network.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code>...
|
||||
<span class="number">2024</span>-<span class="number">04</span>-<span class="number">22 17</span>:<span class="number">31</span>:<span class="number">48.014 </span>TRACE runtime::storage_reclaim: [ferdie] Reclaiming storage weight. benchmarked: <span class="number">3593</span>, consumed: <span class="number">265 </span>unspent: <span class="number">0
|
||||
</span>...</code></pre></div>
|
||||
<p>In the above example we see a benchmarked size of 3593 bytes, while the extrinsic only consumed
|
||||
265 bytes of proof size. This results in 3328 bytes of reclaim.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {};
|
||||
@@ -1,86 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="How to parameterize teyrchain forking in relation to relay chain forking."><title>pezkuwi_sdk_docs::guides::handling_teyrchain_forks - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module handling_teyrchain_forks</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module handling_<wbr>teyrchain_<wbr>forks</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#teyrchain-forks" title="Teyrchain forks">Teyrchain forks</a><ul><li><a href="#background" title="Background">Background</a></li><li><a href="#impact-of-forks" title="Impact of Forks">Impact of Forks</a></li></ul></li><li><a href="#building-on-older-pelay-parents" title="Building on Older Pelay Parents">Building on Older Pelay Parents</a><ul><li><a href="#tradeoffs" title="Tradeoffs">Tradeoffs</a></li><li><a href="#enabling-guide" title="Enabling Guide">Enabling Guide</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../index.html">guides</a></div><h1>Module <span>handling_<wbr>teyrchain_<wbr>forks</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/pezkuwi_sdk_docs/guides/handling_teyrchain_forks.rs.html#1-90">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>How to parameterize teyrchain forking in relation to relay chain forking.</p>
|
||||
<h2 id="teyrchain-forks"><a class="doc-anchor" href="#teyrchain-forks">§</a>Teyrchain forks</h2>
|
||||
<p>In this guide, we will examine how AURA-based teyrchains handle forks. AURA (Authority Round) is
|
||||
a consensus mechanism where block authors rotate at fixed time intervals. Each author gets a
|
||||
predetermined time slice during which they are allowed to author a block. On its own, this
|
||||
mechanism is fork-free.</p>
|
||||
<p>However, since the relay chain provides security and serves as the source of truth for
|
||||
teyrchains, the teyrchain is dependent on it. This relationship can introduce complexities that
|
||||
lead to forking scenarios.</p>
|
||||
<h3 id="background"><a class="doc-anchor" href="#background">§</a>Background</h3>
|
||||
<p>Each teyrchain block has a relay parent, which is a relay chain block that provides context to
|
||||
our teyrchain block. The constraints the relay chain imposes on our teyrchain can cause forks
|
||||
under certain conditions. With asynchronous-backing enabled chains, the node side is building
|
||||
blocks on all relay chain forks. This means that no matter which fork of the relay chain
|
||||
ultimately progressed, the teyrchain would have a block ready for that fork. The situation
|
||||
changes when teyrchains want to produce blocks at a faster cadence. In a scenario where a
|
||||
teyrchain might author on 3 cores with elastic scaling, it is not possible to author on all
|
||||
relay chain forks. The time constraints do not allow it. Building on two forks would result in 6
|
||||
blocks. The authoring of these blocks would consume more time than we have available before the
|
||||
next relay chain block arrives. This limitation requires a more fork-resistant approach to
|
||||
block-building.</p>
|
||||
<h3 id="impact-of-forks"><a class="doc-anchor" href="#impact-of-forks">§</a>Impact of Forks</h3>
|
||||
<p>When a relay chain fork occurs and the teyrchain builds on a fork that will not be extended in
|
||||
the future, the blocks built on that fork are lost and need to be rebuilt. This increases
|
||||
latency and reduces throughput, affecting the overall performance of the teyrchain.</p>
|
||||
<h2 id="building-on-older-pelay-parents"><a class="doc-anchor" href="#building-on-older-pelay-parents">§</a>Building on Older Pelay Parents</h2>
|
||||
<p>Cumulus offers a way to mitigate the occurence of forks. Instead of picking a block at the tip
|
||||
of the relay chain to build blocks, the node side can pick a relay chain block that is older. By
|
||||
building on 12s old relay chain blocks, forks will already have settled and the teyrchain can
|
||||
build fork-free.</p>
|
||||
<div class="example-wrap"><pre class="language-text"><code>Without offset:
|
||||
Relay Chain: A --- B --- C --- D --- E
|
||||
\
|
||||
--- D' --- E'
|
||||
Teyrchain: X --- Y --- ? (builds on both D and D', wasting resources)
|
||||
|
||||
With offset (2 blocks):
|
||||
Relay Chain: A --- B --- C --- D --- E
|
||||
\
|
||||
--- D' --- E'
|
||||
Teyrchain: X(A) - Y (B) - Z (on C, fork already resolved)</code></pre></div>
|
||||
<p><strong>Note:</strong> It is possible that relay chain forks extend over more than 1-2 blocks. However, it is
|
||||
unlikely.</p>
|
||||
<h3 id="tradeoffs"><a class="doc-anchor" href="#tradeoffs">§</a>Tradeoffs</h3>
|
||||
<p>Fork-free teyrchains come with a few tradeoffs:</p>
|
||||
<ul>
|
||||
<li>The latency of incoming XCM messages will be delayed by <code>N * 6s</code>, where <code>N</code> is the number of
|
||||
relay chain blocks we want to offset by. For example, by building 2 relay chain blocks behind
|
||||
the tip, the XCM latency will be increased by 12 seconds.</li>
|
||||
<li>The available PoV space will be slightly reduced. Assuming a 10mb PoV, teyrchains need to be
|
||||
ready to sacrifice around 0.5% of PoV space.</li>
|
||||
</ul>
|
||||
<h3 id="enabling-guide"><a class="doc-anchor" href="#enabling-guide">§</a>Enabling Guide</h3>
|
||||
<p>The decision whether the teyrchain should build on older relay parents is embedded into the
|
||||
runtime. After the changes are implemented, the runtime will enforce that no author can build
|
||||
with an offset smaller than the desired offset. If you wish to keep your current teyrchain
|
||||
behaviour and do not want aforementioned tradeoffs, set the offset to 0.</p>
|
||||
<p><strong>Note:</strong> The APIs mentioned here are available in <code>pezkuwi-sdk</code> versions after <code>stable-2506</code>.</p>
|
||||
<ol>
|
||||
<li>Define the relay parent offset your teyrchain should respect in the runtime.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">const </span>RELAY_PARENT_OFFSET = <span class="number">2</span>;</code></pre></div>
|
||||
<ol start="2">
|
||||
<li>Pass this constant to the <code>teyrchain-system</code> pallet.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>cumulus_pallet_teyrchain_system::Config <span class="kw">for </span>Runtime {
|
||||
<span class="comment">// Other config items here
|
||||
</span>...
|
||||
<span class="kw">type </span>RelayParentOffset = ConstU32<RELAY_PARENT_OFFSET>;
|
||||
}</code></pre></div>
|
||||
<ol start="3">
|
||||
<li>Implement the <code>RelayParentOffsetApi</code> runtime API for your runtime.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>cumulus_primitives_core::RelayParentOffsetApi<Block> <span class="kw">for </span>Runtime {
|
||||
<span class="kw">fn </span>relay_parent_offset() -> u32 {
|
||||
RELAY_PARENT_OFFSET
|
||||
}
|
||||
}</code></pre></div>
|
||||
<ol start="4">
|
||||
<li>Increase the <code>UNINCLUDED_SEGMENT_CAPICITY</code> for your runtime. It needs to be increased by
|
||||
<code>RELAY_PARENT_OFFSET * BLOCK_PROCESSING_VELOCITY</code>.</li>
|
||||
</ol>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {};
|
||||
@@ -1,21 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="In-depth guides about the most common components of the Pezkuwi SDK. They are slightly more high level and broad than `reference_docs`."><title>pezkuwi_sdk_docs::guides - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module guides</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module guides</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#pezkuwi-sdk-docs-guides" title="Pezkuwi SDK Docs Guides">Pezkuwi SDK Docs Guides</a></li></ul><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate pezkuwi_<wbr>sdk_<wbr>docs</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">pezkuwi_sdk_docs</a></div><h1>Module <span>guides</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/pezkuwi_sdk_docs/guides/mod.rs.html#1-50">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>In-depth guides about the most common components of the Pezkuwi SDK. They are slightly more
|
||||
high level and broad than <a href="../reference_docs/index.html" title="mod pezkuwi_sdk_docs::reference_docs"><code>reference_docs</code></a>.</p>
|
||||
<h2 id="pezkuwi-sdk-docs-guides"><a class="doc-anchor" href="#pezkuwi-sdk-docs-guides">§</a>Pezkuwi SDK Docs Guides</h2>
|
||||
<p>This crate contains a collection of guides that are foundational to the developers of
|
||||
Pezkuwi SDK. They are common user-journeys that are traversed in the Pezkuwi ecosystem.</p>
|
||||
<p>The main user-journey covered by these guides is:</p>
|
||||
<ul>
|
||||
<li><a href="your_first_pallet/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet"><code>your_first_pallet</code></a>, where you learn what a FRAME pallet is, and write your first
|
||||
application logic.</li>
|
||||
<li><a href="your_first_runtime/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_runtime"><code>your_first_runtime</code></a>, where you learn how to compile your pallets into a WASM runtime.</li>
|
||||
<li><a href="your_first_node/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_node"><code>your_first_node</code></a>, where you learn how to run the said runtime in a node.</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>By this step, you have already launched a full Pezkuwi-SDK-based blockchain!</p>
|
||||
</blockquote>
|
||||
<p>Once done, feel free to step up into one of our templates: <a href="../pezkuwi_sdk/templates/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::templates"><code>crate::pezkuwi_sdk::templates</code></a>.</p>
|
||||
<p>Other guides are related to other miscellaneous topics and are listed as modules below.</p>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="async_backing_guide/index.html" title="mod pezkuwi_sdk_docs::guides::async_backing_guide">async_<wbr>backing_<wbr>guide</a></dt><dd>How to enable Async Backing on teyrchain projects that started in 2023 or before.</dd><dt><a class="mod" href="enable_elastic_scaling/index.html" title="mod pezkuwi_sdk_docs::guides::enable_elastic_scaling">enable_<wbr>elastic_<wbr>scaling</a></dt><dd>How to enable elastic scaling on a teyrchain.</dd><dt><a class="mod" href="enable_metadata_hash/index.html" title="mod pezkuwi_sdk_docs::guides::enable_metadata_hash">enable_<wbr>metadata_<wbr>hash</a></dt><dd>How to enable metadata hash verification in the runtime.</dd><dt><a class="mod" href="enable_pov_reclaim/index.html" title="mod pezkuwi_sdk_docs::guides::enable_pov_reclaim">enable_<wbr>pov_<wbr>reclaim</a></dt><dd>How to enhance a given runtime and node to be cumulus-enabled, run it as a teyrchain
|
||||
and connect it to a relay-chain.
|
||||
How to enable storage weight reclaiming in a teyrchain node and runtime.</dd><dt><a class="mod" href="handling_teyrchain_forks/index.html" title="mod pezkuwi_sdk_docs::guides::handling_teyrchain_forks">handling_<wbr>teyrchain_<wbr>forks</a></dt><dd>How to parameterize teyrchain forking in relation to relay chain forking.</dd><dt><a class="mod" href="your_first_node/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_node">your_<wbr>first_<wbr>node</a></dt><dd>Running the given runtime with a node. No specific consensus mechanism is used at this stage.</dd><dt><a class="mod" href="your_first_pallet/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet">your_<wbr>first_<wbr>pallet</a></dt><dd>Write your first simple pallet, learning the most most basic features of FRAME along the way.</dd><dt><a class="mod" href="your_first_runtime/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_runtime">your_<wbr>first_<wbr>runtime</a></dt><dd>Write your first real <a href="../reference_docs/wasm_meta_protocol/index.html" title="mod pezkuwi_sdk_docs::reference_docs::wasm_meta_protocol">runtime</a>,
|
||||
compiling it to <a href="../pezkuwi_sdk/substrate/index.html#wasm-build" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::substrate">WASM</a>.</dd></dl></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {"mod":["async_backing_guide","enable_elastic_scaling","enable_metadata_hash","enable_pov_reclaim","handling_teyrchain_forks","your_first_node","your_first_pallet","your_first_runtime"]};
|
||||
@@ -1,77 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Running the given runtime with a node. No specific consensus mechanism is used at this stage."><title>pezkuwi_sdk_docs::guides::your_first_node - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module your_first_node</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module your_<wbr>first_<wbr>node</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#your-first-node" title="Your first Node">Your first Node</a><ul><li><a href="#running-the-omni-node" title="Running The Omni Node">Running The Omni Node</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../index.html">guides</a></div><h1>Module <span>your_<wbr>first_<wbr>node</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/pezkuwi_sdk_docs/guides/your_first_node.rs.html#1-342">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Running the given runtime with a node. No specific consensus mechanism is used at this stage.</p>
|
||||
<h2 id="your-first-node"><a class="doc-anchor" href="#your-first-node">§</a>Your first Node</h2>
|
||||
<p>In this guide, you will learn how to run a runtime, such as the one created in
|
||||
<a href="../your_first_runtime/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_runtime"><code>your_first_runtime</code></a>, in a node. Within the context of this guide, we will focus on running
|
||||
the runtime with an <a href="../../reference_docs/omni_node/index.html" title="mod pezkuwi_sdk_docs::reference_docs::omni_node"><code>omni-node</code></a>. Please first read this page to learn about the OmniNode, and
|
||||
other options when it comes to running a node.</p>
|
||||
<p><a href="../your_first_runtime/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_runtime"><code>your_first_runtime</code></a> is a runtime with no consensus related code, and therefore can only be
|
||||
executed with a node that also expects no consensus ([<code>sc_consensus_manual_seal</code>]).
|
||||
<code>pezkuwi-omni-node</code>’s <a href="(pezkuwi_omni_node_lib::cli::Cli::dev_block_time)"><code>--dev-block-time</code></a> precisely does this.</p>
|
||||
<blockquote>
|
||||
<p>All of the following steps are coded as unit tests of this module. Please see <code>Source</code> of the
|
||||
page for more information.</p>
|
||||
</blockquote>
|
||||
<h3 id="running-the-omni-node"><a class="doc-anchor" href="#running-the-omni-node">§</a>Running The Omni Node</h3><h4 id="installs"><a class="doc-anchor" href="#installs">§</a>Installs</h4>
|
||||
<p>The <code>pezkuwi-omni-node</code> can either be downloaded from the latest <a href="https://github.com/pezkuwichain/pezkuwi-sdk/releases/">Release</a> of <code>pezkuwi-sdk</code>,
|
||||
or installed using <code>cargo</code>:</p>
|
||||
<div class="example-wrap"><pre class="language-text"><code>cargo install pezkuwi-omni-node</code></pre></div>
|
||||
<p>Next, we need to install the <code>chain-spec-builder</code>. This is the tool that allows us to build
|
||||
chain-specifications, through interacting with the genesis related APIs of the runtime, as
|
||||
described in <a href="../your_first_runtime/index.html#genesis-configuration" title="mod pezkuwi_sdk_docs::guides::your_first_runtime"><code>crate::guides::your_first_runtime</code></a>.</p>
|
||||
<div class="example-wrap"><pre class="language-text"><code>cargo install staging-chain-spec-builder</code></pre></div>
|
||||
<blockquote>
|
||||
<p>The name of the crate is prefixed with <code>staging</code> as the crate name <code>chain-spec-builder</code> on
|
||||
crates.io is already taken and is not controlled by <code>pezkuwi-sdk</code> developers.</p>
|
||||
</blockquote>
|
||||
<h4 id="building-runtime"><a class="doc-anchor" href="#building-runtime">§</a>Building Runtime</h4>
|
||||
<p>Next, we need to build the corresponding runtime that we wish to interact with.</p>
|
||||
<div class="example-wrap"><pre class="language-text"><code>cargo build --release -p path-to-runtime</code></pre></div>
|
||||
<p>Equivalent code in tests:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="macro">run_cmd!</span>(
|
||||
cargo build --release -p <span class="macro-nonterminal">$FIRST_RUNTIME
|
||||
</span>)
|
||||
.expect(<span class="string">"Failed to run command"</span>);</code></pre></div>
|
||||
<p>This creates the wasm file under <code>./target/{release}/wbuild/release</code> directory.</p>
|
||||
<h4 id="building-chain-spec"><a class="doc-anchor" href="#building-chain-spec">§</a>Building Chain Spec</h4>
|
||||
<p>Next, we can generate the corresponding chain-spec file. For this example, we will use the
|
||||
<code>development</code> (<code>sp_genesis_config::DEVELOPMENT</code>) preset.</p>
|
||||
<p>Note that we intend to run this chain-spec with <code>pezkuwi-omni-node</code>, which is tailored for
|
||||
running teyrchains. This requires the chain-spec to always contain the <code>para_id</code> and a
|
||||
<code>relay_chain</code> fields, which are provided below as CLI arguments.</p>
|
||||
<div class="example-wrap"><pre class="language-text"><code>chain-spec-builder \
|
||||
-c <path-to-output> \
|
||||
create \
|
||||
--relay-chain dontcare \
|
||||
--runtime pezkuwi_sdk_docs_first_runtime.wasm \
|
||||
named-preset development</code></pre></div>
|
||||
<p>Equivalent code in tests:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">let </span>chain_spec_builder = find_release_binary(<span class="kw-2">&</span>CHAIN_SPEC_BUILDER).unwrap();
|
||||
<span class="kw">let </span>runtime_path = find_wasm(PARA_RUNTIME).unwrap();
|
||||
<span class="kw">let </span>output = <span class="string">"/tmp/demo-chain-spec.json"</span>;
|
||||
<span class="kw">let </span>runtime_str = runtime_path.to_str().unwrap();
|
||||
<span class="macro">run_cmd!</span>(
|
||||
<span class="macro-nonterminal">$chain_spec_builder </span>-c <span class="macro-nonterminal">$output </span>create --relay-chain dontcare -r <span class="macro-nonterminal">$runtime_str </span>named-preset development
|
||||
).expect(<span class="string">"Failed to run command"</span>);
|
||||
std::fs::remove_file(output).unwrap();</code></pre></div><h4 id="running-pezkuwi-omni-node"><a class="doc-anchor" href="#running-pezkuwi-omni-node">§</a>Running <code>pezkuwi-omni-node</code></h4>
|
||||
<p>Finally, we can run the node with the generated chain-spec file. We can also specify the block
|
||||
time using the <code>--dev-block-time</code> flag.</p>
|
||||
<div class="example-wrap"><pre class="language-text"><code>pezkuwi-omni-node \
|
||||
--tmp \
|
||||
--dev-block-time 1000 \
|
||||
--chain <chain_spec_file>.json</code></pre></div>
|
||||
<blockquote>
|
||||
<p>Note that we always prefer to use <code>--tmp</code> for testing, as it will save the chain state to a
|
||||
temporary folder, allowing the chain-to be easily restarted without <code>purge-chain</code>. See
|
||||
[<code>sc_cli::commands::PurgeChainCmd</code>] and [<code>sc_cli::commands::RunCmd::tmp</code>] for more info.</p>
|
||||
</blockquote>
|
||||
<p>This will start the node and import the blocks. Note while using <code>--dev-block-time</code>, the node
|
||||
will use the testing-specific manual-seal consensus. This is an efficient way to test the
|
||||
application logic of your runtime, without needing to yet care about consensus, block
|
||||
production, relay-chain and so on.</p>
|
||||
<h4 id="next-steps"><a class="doc-anchor" href="#next-steps">§</a>Next Steps</h4>
|
||||
<ul>
|
||||
<li>See the rest of the steps in <a href="../../reference_docs/omni_node/index.html#user-journey" title="mod pezkuwi_sdk_docs::reference_docs::omni_node"><code>crate::reference_docs::omni_node</code></a>.</li>
|
||||
</ul>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {};
|
||||
@@ -1,596 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Write your first simple pallet, learning the most most basic features of FRAME along the way."><title>pezkuwi_sdk_docs::guides::your_first_pallet - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module your_first_pallet</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module your_<wbr>first_<wbr>pallet</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#currency-pallet" title="Currency Pallet">Currency Pallet</a><ul><li><a href="#writing-your-first-pallet" title="Writing Your First Pallet">Writing Your First Pallet</a></li><li><a href="#topics-covered" title="Topics Covered">Topics Covered</a></li><li><a href="#improving-the-currency-pallet" title="Improving the Currency Pallet">Improving the Currency Pallet</a></li><li><a href="#what-next" title="What Next?">What Next?</a></li></ul></li></ul><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../index.html">guides</a></div><h1>Module <span>your_<wbr>first_<wbr>pallet</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#1-789">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Write your first simple pallet, learning the most most basic features of FRAME along the way.</p>
|
||||
<h2 id="currency-pallet"><a class="doc-anchor" href="#currency-pallet">§</a>Currency Pallet</h2>
|
||||
<p>By the end of this guide, you will have written a small FRAME pallet (see
|
||||
<a href="../../pezkuwi_sdk/frame_runtime/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime"><code>crate::pezkuwi_sdk::frame_runtime</code></a>) that is capable of handling a simple crypto-currency.
|
||||
This pallet will:</p>
|
||||
<ol>
|
||||
<li>Allow anyone to mint new tokens into accounts (which is obviously not a great idea for a real
|
||||
system).</li>
|
||||
<li>Allow any user that owns tokens to transfer them to others.</li>
|
||||
<li>Track the total issuance of all tokens at all times.</li>
|
||||
</ol>
|
||||
<blockquote>
|
||||
<p>This guide will build a currency pallet from scratch using only the lowest primitives of
|
||||
FRAME, and is mainly intended for education, not <em>applicability</em>. For example, almost all
|
||||
FRAME-based runtimes use various techniques to re-use a currency pallet instead of writing
|
||||
one. Further advanced FRAME related topics are discussed in <a href="../../reference_docs/index.html" title="mod pezkuwi_sdk_docs::reference_docs"><code>crate::reference_docs</code></a>.</p>
|
||||
</blockquote>
|
||||
<h3 id="writing-your-first-pallet"><a class="doc-anchor" href="#writing-your-first-pallet">§</a>Writing Your First Pallet</h3>
|
||||
<p>To get started, clone one of the templates mentioned in <a href="../../pezkuwi_sdk/templates/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::templates"><code>crate::pezkuwi_sdk::templates</code></a>. We
|
||||
recommend using the <code>pezkuwi-sdk-minimal-template</code>. You might need to change small parts of
|
||||
this guide, namely the crate/package names, based on which template you use.</p>
|
||||
<blockquote>
|
||||
<p>Be aware that you can read the entire source code backing this tutorial by clicking on the
|
||||
<code>source</code> button at the top right of the page.</p>
|
||||
</blockquote>
|
||||
<p>You should have studied the following modules as a prelude to this guide:</p>
|
||||
<ul>
|
||||
<li><a href="../../reference_docs/blockchain_state_machines/index.html" title="mod pezkuwi_sdk_docs::reference_docs::blockchain_state_machines"><code>crate::reference_docs::blockchain_state_machines</code></a></li>
|
||||
<li><a href="../../reference_docs/trait_based_programming/index.html" title="mod pezkuwi_sdk_docs::reference_docs::trait_based_programming"><code>crate::reference_docs::trait_based_programming</code></a></li>
|
||||
<li><a href="../../pezkuwi_sdk/frame_runtime/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime"><code>crate::pezkuwi_sdk::frame_runtime</code></a></li>
|
||||
</ul>
|
||||
<h3 id="topics-covered"><a class="doc-anchor" href="#topics-covered">§</a>Topics Covered</h3>
|
||||
<p>The following FRAME topics are covered in this guide:</p>
|
||||
<ul>
|
||||
<li><a href="frame_support::pallet_macros::storage"><code>pallet::storage</code></a></li>
|
||||
<li><a href="frame_support::pallet_macros::call"><code>pallet::call</code></a></li>
|
||||
<li><a href="frame_support::pallet_macros::event"><code>pallet::event</code></a></li>
|
||||
<li><a href="frame_support::pallet_macros::error"><code>pallet::error</code></a></li>
|
||||
<li>Basics of testing a pallet</li>
|
||||
<li><a href="frame::runtime::prelude::construct_runtime">Constructing a runtime</a></li>
|
||||
</ul>
|
||||
<h4 id="shell-pallet"><a class="doc-anchor" href="#shell-pallet">§</a>Shell Pallet</h4>
|
||||
<p>Consider the following as a “shell pallet”. We continue building the rest of this pallet based
|
||||
on this template.</p>
|
||||
<p><a href="frame_support::pallet_macros::config"><code>pallet::config</code></a> and <a href="frame_support::pallet"><code>pallet::pallet</code></a> are both mandatory parts of any
|
||||
pallet. Refer to the documentation of each to get an overview of what they do.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[frame::pallet(dev_mode)]
|
||||
</span><span class="kw">pub mod </span>shell_pallet {
|
||||
<span class="kw">use </span>frame::prelude::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="attr">#[pallet::config]
|
||||
</span><span class="kw">pub trait </span>Config: frame_system::Config {}
|
||||
|
||||
<span class="attr">#[pallet::pallet]
|
||||
</span><span class="kw">pub struct </span>Pallet<T>(<span class="kw">_</span>);
|
||||
}</code></pre></div>
|
||||
<p>All of the code that follows in this guide should live inside of the <code>mod pallet</code>.</p>
|
||||
<h4 id="storage"><a class="doc-anchor" href="#storage">§</a>Storage</h4>
|
||||
<p>First, we will need to create two onchain storage declarations.</p>
|
||||
<p>One should be a mapping from account-ids to a balance type, and one value that is the total
|
||||
issuance.</p>
|
||||
<blockquote>
|
||||
<p>For the rest of this guide, we will opt for a balance type of <code>u128</code>. For the sake of
|
||||
simplicity, we are hardcoding this type. In a real pallet is best practice to define it as a
|
||||
generic bounded type in the <code>Config</code> trait, and then specify it in the implementation.</p>
|
||||
</blockquote>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub type </span>Balance = u128;</code></pre></div>
|
||||
<p>The definition of these two storage items, based on <a href="frame_support::pallet_macros::storage"><code>pallet::storage</code></a> details, is as follows:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[pallet::storage]
|
||||
</span><span class="kw">pub type </span>TotalIssuance<T: Config> = StorageValue<<span class="kw">_</span>, Balance>;</code></pre></div>
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[pallet::storage]
|
||||
</span><span class="kw">pub type </span>Balances<T: Config> = StorageMap<<span class="kw">_</span>, <span class="kw">_</span>, T::AccountId, Balance>;</code></pre></div><h4 id="dispatchables"><a class="doc-anchor" href="#dispatchables">§</a>Dispatchables</h4>
|
||||
<p>Next, we will define the dispatchable functions. As per <a href="frame_support::pallet_macros::call"><code>pallet::call</code></a>, these will be defined
|
||||
as normal <code>fn</code>s attached to <code>struct Pallet</code>.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[pallet::call]
|
||||
</span><span class="kw">impl</span><T: Config> Pallet<T> {
|
||||
<span class="doccomment">/// An unsafe mint that can be called by anyone. Not a great idea.
|
||||
</span><span class="kw">pub fn </span>mint_unsafe(
|
||||
origin: T::RuntimeOrigin,
|
||||
dest: T::AccountId,
|
||||
amount: Balance,
|
||||
) -> DispatchResult {
|
||||
<span class="comment">// ensure that this is a signed account, but we don't really check `_anyone`.
|
||||
</span><span class="kw">let </span>_anyone = ensure_signed(origin)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="comment">// update the balances map. Notice how all `<T: Config>` remains as `<T>`.
|
||||
</span>Balances::<T>::mutate(dest, |b| <span class="kw-2">*</span>b = <span class="prelude-val">Some</span>(b.unwrap_or(<span class="number">0</span>) + amount));
|
||||
<span class="comment">// update total issuance.
|
||||
</span>TotalIssuance::<T>::mutate(|t| <span class="kw-2">*</span>t = <span class="prelude-val">Some</span>(t.unwrap_or(<span class="number">0</span>) + amount));
|
||||
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Transfer `amount` from `origin` to `dest`.
|
||||
</span><span class="kw">pub fn </span>transfer(
|
||||
origin: T::RuntimeOrigin,
|
||||
dest: T::AccountId,
|
||||
amount: Balance,
|
||||
) -> DispatchResult {
|
||||
<span class="kw">let </span>sender = ensure_signed(origin)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="comment">// ensure sender has enough balance, and if so, calculate what is left after `amount`.
|
||||
</span><span class="kw">let </span>sender_balance = Balances::<T>::get(<span class="kw-2">&</span>sender).ok_or(<span class="string">"NonExistentAccount"</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">if </span>sender_balance < amount {
|
||||
<span class="kw">return </span><span class="prelude-val">Err</span>(<span class="string">"InsufficientBalance"</span>.into());
|
||||
}
|
||||
<span class="kw">let </span>remainder = sender_balance - amount;
|
||||
|
||||
<span class="comment">// update sender and dest balances.
|
||||
</span>Balances::<T>::mutate(dest, |b| <span class="kw-2">*</span>b = <span class="prelude-val">Some</span>(b.unwrap_or(<span class="number">0</span>) + amount));
|
||||
Balances::<T>::insert(<span class="kw-2">&</span>sender, remainder);
|
||||
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
}</code></pre></div>
|
||||
<p>The logic of these functions is self-explanatory. Instead, we will focus on the FRAME-related
|
||||
details:</p>
|
||||
<ul>
|
||||
<li>Where do <code>T::AccountId</code> and <code>T::RuntimeOrigin</code> come from? These are both defined in
|
||||
[<code>frame::prelude::frame_system::Config</code>], therefore we can access them in <code>T</code>.</li>
|
||||
<li>What is <code>ensure_signed</code>, and what does it do with the aforementioned <code>T::RuntimeOrigin</code>? This
|
||||
is outside the scope of this guide, and you can learn more about it in the origin reference
|
||||
document (<a href="../../reference_docs/frame_origin/index.html" title="mod pezkuwi_sdk_docs::reference_docs::frame_origin"><code>crate::reference_docs::frame_origin</code></a>). For now, you should only know the
|
||||
signature of the function: it takes a generic <code>T::RuntimeOrigin</code> and returns a
|
||||
<code>Result<T::AccountId, _></code>. So by the end of this function call, we know that this dispatchable
|
||||
was signed by <code>sender</code>.</li>
|
||||
</ul>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub fn </span>ensure_signed<OuterOrigin, AccountId>(o: OuterOrigin) -> <span class="prelude-ty">Result</span><AccountId, BadOrigin>
|
||||
<span class="kw">where
|
||||
</span>OuterOrigin: Into<<span class="prelude-ty">Result</span><RawOrigin<AccountId>, OuterOrigin>>,
|
||||
{
|
||||
<span class="kw">match </span>o.into() {
|
||||
<span class="prelude-val">Ok</span>(RawOrigin::Signed(t)) => <span class="prelude-val">Ok</span>(t),
|
||||
<span class="kw">_ </span>=> <span class="prelude-val">Err</span>(BadOrigin),
|
||||
}
|
||||
}</code></pre></div>
|
||||
<ul>
|
||||
<li>
|
||||
<p>Where does <code>mutate</code>, <code>get</code> and <code>insert</code> and other storage APIs come from? All of them are
|
||||
explained in the corresponding <code>type</code>, for example, for <code>Balances::<T>::insert</code>, you can look
|
||||
into [<code>frame::prelude::StorageMap::insert</code>].</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>The return type of all dispatchable functions is [<code>frame::prelude::DispatchResult</code>]:</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub type </span>DispatchResult = <span class="prelude-ty">Result</span><(), sp_runtime::DispatchError>;</code></pre></div>
|
||||
<p>Which is more or less a normal Rust <code>Result</code>, with a custom [<code>frame::prelude::DispatchError</code>] as
|
||||
the <code>Err</code> variant. We won’t cover this error in detail here, but importantly you should know
|
||||
that there is an <code>impl From<&'static string> for DispatchError</code> provided (see
|
||||
<a href="%60frame::prelude::DispatchError#impl-From%3C%26str%3E-for-DispatchError%60">here</a>). Therefore,
|
||||
we can use basic string literals as our error type and <code>.into()</code> them into <code>DispatchError</code>.</p>
|
||||
<ul>
|
||||
<li>Why are all <code>get</code> and <code>mutate</code> functions returning an <code>Option</code>? This is the default behavior
|
||||
of FRAME storage APIs. You can learn more about how to override this by looking into
|
||||
<a href="frame_support::pallet_macros::storage"><code>pallet::storage</code></a>, and [<code>frame::prelude::ValueQuery</code>]/[<code>frame::prelude::OptionQuery</code>]</li>
|
||||
</ul>
|
||||
<h4 id="improving-errors"><a class="doc-anchor" href="#improving-errors">§</a>Improving Errors</h4>
|
||||
<p>How we handle error in the above snippets is fairly rudimentary. Let’s look at how this can be
|
||||
improved. First, we can use [<code>frame::prelude::ensure</code>] to express the error slightly better.
|
||||
This macro will call <code>.into()</code> under the hood.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub fn </span>transfer_better(
|
||||
origin: T::RuntimeOrigin,
|
||||
dest: T::AccountId,
|
||||
amount: Balance,
|
||||
) -> DispatchResult {
|
||||
<span class="kw">let </span>sender = ensure_signed(origin)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">let </span>sender_balance = Balances::<T>::get(<span class="kw-2">&</span>sender).ok_or(<span class="string">"NonExistentAccount"</span>)<span class="question-mark">?</span>;
|
||||
<span class="macro">ensure!</span>(sender_balance >= amount, <span class="string">"InsufficientBalance"</span>);
|
||||
<span class="kw">let </span>remainder = sender_balance - amount;
|
||||
|
||||
<span class="comment">// .. snip
|
||||
</span><span class="prelude-val">Ok</span>(())
|
||||
}</code></pre></div>
|
||||
<p>Moreover, you will learn in the <a href="../../reference_docs/defensive_programming/index.html" title="mod pezkuwi_sdk_docs::reference_docs::defensive_programming">Defensive Programming
|
||||
section</a> that it is always recommended to use
|
||||
safe arithmetic operations in your runtime. By using <a href="https://docs.rs/num-traits/0.2/num_traits/ops/checked/trait.CheckedSub.html" title="trait num_traits::ops::checked::CheckedSub"><code>frame::traits::CheckedSub</code></a>, we can not
|
||||
only take a step in that direction, but also improve the error handing and make it slightly more
|
||||
ergonomic.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub fn </span>transfer_better_checked(
|
||||
origin: T::RuntimeOrigin,
|
||||
dest: T::AccountId,
|
||||
amount: Balance,
|
||||
) -> DispatchResult {
|
||||
<span class="kw">let </span>sender = ensure_signed(origin)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="kw">let </span>sender_balance = Balances::<T>::get(<span class="kw-2">&</span>sender).ok_or(<span class="string">"NonExistentAccount"</span>)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>remainder = sender_balance.checked_sub(amount).ok_or(<span class="string">"InsufficientBalance"</span>)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="comment">// .. snip
|
||||
</span><span class="prelude-val">Ok</span>(())
|
||||
}</code></pre></div>
|
||||
<p>This is more or less all the logic that there is in this basic currency pallet!</p>
|
||||
<h4 id="your-first-test-runtime"><a class="doc-anchor" href="#your-first-test-runtime">§</a>Your First (Test) Runtime</h4>
|
||||
<p>The typical testing code of a pallet lives in a module that imports some preludes useful for
|
||||
testing, similar to:</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">pub mod </span>pallet {
|
||||
<span class="comment">// snip -- actually pallet code.
|
||||
</span>}
|
||||
|
||||
<span class="attr">#[cfg(test)]
|
||||
</span><span class="kw">mod </span>tests {
|
||||
<span class="comment">// bring in the testing prelude of frame
|
||||
</span><span class="kw">use </span>frame::testing_prelude::<span class="kw-2">*</span>;
|
||||
<span class="comment">// bring in all pallet items
|
||||
</span><span class="kw">use </span><span class="kw">super</span>::pallet::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="comment">// snip -- rest of the testing code.
|
||||
</span>}</code></pre></div>
|
||||
<p>Next, we create a “test runtime” in order to test our pallet. Recall from
|
||||
<a href="../../pezkuwi_sdk/frame_runtime/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime"><code>crate::pezkuwi_sdk::frame_runtime</code></a> that a runtime is a collection of pallets, expressed
|
||||
through [<code>frame::runtime::prelude::construct_runtime</code>]. All runtimes also have to include
|
||||
[<code>frame::prelude::frame_system</code>]. So we expect to see a runtime with two pallet, <code>frame_system</code>
|
||||
and the one we just wrote.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">mod </span>runtime {
|
||||
<span class="kw">use super</span>::<span class="kw-2">*</span>;
|
||||
<span class="comment">// we need to reference our `mod pallet` as an identifier to pass to
|
||||
// `construct_runtime`.
|
||||
// YOU HAVE TO CHANGE THIS LINE BASED ON YOUR TEMPLATE
|
||||
</span><span class="kw">use </span><span class="kw">crate</span>::pallet <span class="kw">as </span>pallet_currency;
|
||||
|
||||
<span class="macro">construct_runtime!</span>(
|
||||
<span class="kw">pub enum </span>Runtime {
|
||||
<span class="comment">// ---^^^^^^ This is where `enum Runtime` is defined.
|
||||
</span>System: frame_system,
|
||||
Currency: pallet_currency,
|
||||
}
|
||||
);
|
||||
|
||||
<span class="attr">#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
|
||||
</span><span class="kw">impl </span>frame_system::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>Block = MockBlock<Runtime>;
|
||||
<span class="comment">// within pallet we just said `<T as frame_system::Config>::AccountId`, now we
|
||||
// finally specified it.
|
||||
</span><span class="kw">type </span>AccountId = u64;
|
||||
}
|
||||
|
||||
<span class="comment">// our simple pallet has nothing to be configured.
|
||||
</span><span class="kw">impl </span>pallet_currency::Config <span class="kw">for </span>Runtime {}
|
||||
}</code></pre></div>
|
||||
<blockquote>
|
||||
<p>[<code>frame::pallet_macros::derive_impl</code>] is a FRAME feature that enables developers to have
|
||||
defaults for associated types.</p>
|
||||
</blockquote>
|
||||
<p>Recall that within our pallet, (almost) all blocks of code are generic over <code><T: Config></code>. And,
|
||||
because <code>trait Config: frame_system::Config</code>, we can get access to all items in <code>Config</code> (or
|
||||
<code>frame_system::Config</code>) using <code>T::NameOfItem</code>. This is all within the boundaries of how
|
||||
Rust traits and generics work. If unfamiliar with this pattern, read
|
||||
<a href="../../reference_docs/trait_based_programming/index.html" title="mod pezkuwi_sdk_docs::reference_docs::trait_based_programming"><code>crate::reference_docs::trait_based_programming</code></a> before going further.</p>
|
||||
<p>Crucially, a typical FRAME runtime contains a <code>struct Runtime</code>. The main role of this <code>struct</code>
|
||||
is to implement the <code>trait Config</code> of all pallets. That is, anywhere within your pallet code
|
||||
where you see <code><T: Config></code> (read: <em>“some type <code>T</code> that implements <code>Config</code>”</em>), in the runtime,
|
||||
it can be replaced with <code><Runtime></code>, because <code>Runtime</code> implements <code>Config</code> of all pallets, as we
|
||||
see above.</p>
|
||||
<p>Another way to think about this is that within a pallet, a lot of types are “unknown” and, we
|
||||
only know that they will be provided at some later point. For example, when you write
|
||||
<code>T::AccountId</code> (which is short for <code><T as frame_system::Config>::AccountId</code>) in your pallet,
|
||||
you are in fact saying “<em>Some type <code>AccountId</code> that will be known later</em>”. That “later” is in
|
||||
fact when you specify these types when you implement all <code>Config</code> traits for <code>Runtime</code>.</p>
|
||||
<p>As you see above, <code>frame_system::Config</code> is setting the <code>AccountId</code> to <code>u64</code>. Of course, a real
|
||||
runtime will not use this type, and instead reside to a proper type like a 32-byte standard
|
||||
public key. This is a HUGE benefit that FRAME developers can tap into: through the framework
|
||||
being so generic, different types can always be customized to simple things when needed.</p>
|
||||
<blockquote>
|
||||
<p>Imagine how hard it would have been if all tests had to use a real 32-byte account id, as
|
||||
opposed to just a u64 number 🙈.</p>
|
||||
</blockquote>
|
||||
<h4 id="your-first-test"><a class="doc-anchor" href="#your-first-test">§</a>Your First Test</h4>
|
||||
<p>The above is all you need to execute the dispatchables of your pallet. The last thing you need
|
||||
to learn is that all of your pallet testing code should be wrapped in
|
||||
[<code>frame::testing_prelude::TestState</code>]. This is a type that provides access to an in-memory state
|
||||
to be used in our tests.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[test]
|
||||
</span><span class="kw">fn </span>first_test() {
|
||||
TestState::new_empty().execute_with(|| {
|
||||
<span class="comment">// We expect Alice's account to have no funds.
|
||||
</span><span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>ALICE), <span class="prelude-val">None</span>);
|
||||
<span class="macro">assert_eq!</span>(TotalIssuance::<Runtime>::get(), <span class="prelude-val">None</span>);
|
||||
|
||||
<span class="comment">// mint some funds into Alice's account.
|
||||
</span><span class="macro">assert_ok!</span>(Pallet::<Runtime>::mint_unsafe(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
ALICE,
|
||||
<span class="number">100
|
||||
</span>));
|
||||
|
||||
<span class="comment">// re-check the above
|
||||
</span><span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>ALICE), <span class="prelude-val">Some</span>(<span class="number">100</span>));
|
||||
<span class="macro">assert_eq!</span>(TotalIssuance::<Runtime>::get(), <span class="prelude-val">Some</span>(<span class="number">100</span>));
|
||||
})
|
||||
}</code></pre></div>
|
||||
<p>In the first test, we simply assert that there is no total issuance, and no balance associated
|
||||
with Alice’s account. Then, we mint some balance into Alice’s, and re-check.</p>
|
||||
<p>As noted above, the <code>T::AccountId</code> is now <code>u64</code>. Moreover, <code>Runtime</code> is replacing <code><T: Config></code>.
|
||||
This is why for example you see <code>Balances::<Runtime>::get(..)</code>. Finally, notice that the
|
||||
dispatchables are simply functions that can be called on top of the <code>Pallet</code> struct.</p>
|
||||
<p>Congratulations! You have written your first pallet and tested it! Next, we learn a few optional
|
||||
steps to improve our pallet.</p>
|
||||
<h3 id="improving-the-currency-pallet"><a class="doc-anchor" href="#improving-the-currency-pallet">§</a>Improving the Currency Pallet</h3><h4 id="better-test-setup"><a class="doc-anchor" href="#better-test-setup">§</a>Better Test Setup</h4>
|
||||
<p>Idiomatic FRAME pallets often use Builder pattern to define their initial state.</p>
|
||||
<blockquote>
|
||||
<p>The Pezkuwi Blockchain Academy’s Rust entrance exam has a
|
||||
<a href="https://github.com/pezkuwichain/kurdistan_blockchain-akademy/blob/main/src/m_builder.rs">section</a>
|
||||
on this that you can use to learn the Builder Pattern.</p>
|
||||
</blockquote>
|
||||
<p>Let’s see how we can implement a better test setup using this pattern. First, we define a
|
||||
<code>struct StateBuilder</code>.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">struct </span>StateBuilder {
|
||||
balances: Vec<(<Runtime <span class="kw">as </span>frame_system::Config>::AccountId, Balance)>,
|
||||
}</code></pre></div>
|
||||
<p>This struct is meant to contain the same list of accounts and balances that we want to have at
|
||||
the beginning of each block. We hardcoded this to <code>let accounts = vec![(ALICE, 100), (2, 100)];</code>
|
||||
so far. Then, if desired, we attach a default value for this struct.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>Default <span class="kw">for </span>StateBuilder {
|
||||
<span class="kw">fn </span>default() -> <span class="self">Self </span>{
|
||||
<span class="self">Self </span>{ balances: <span class="macro">vec!</span>[(ALICE, <span class="number">100</span>), (BOB, <span class="number">100</span>)] }
|
||||
}
|
||||
}</code></pre></div>
|
||||
<p>Like any other builder pattern, we attach functions to the type to mutate its internal
|
||||
properties.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>StateBuilder {
|
||||
<span class="kw">fn </span>add_balance(
|
||||
<span class="kw-2">mut </span><span class="self">self</span>,
|
||||
who: <Runtime <span class="kw">as </span>frame_system::Config>::AccountId,
|
||||
amount: Balance,
|
||||
) -> <span class="self">Self </span>{
|
||||
<span class="self">self</span>.balances.push((who, amount));
|
||||
<span class="self">self
|
||||
</span>}
|
||||
}</code></pre></div>
|
||||
<p>Finally –the useful part– we write our own custom <code>build_and_execute</code> function on
|
||||
this type. This function will do multiple things:</p>
|
||||
<ol>
|
||||
<li>It would consume <code>self</code> to produce our <code>TestState</code> based on the properties that we attached
|
||||
to <code>self</code>.</li>
|
||||
<li>It would execute any test function that we pass in as closure.</li>
|
||||
<li>A nifty trick, this allows our test setup to have some code that is executed both before and
|
||||
after each test. For example, in this test, we do some additional checking about the
|
||||
correctness of the <code>TotalIssuance</code>. We leave it up to you as an exercise to learn why the
|
||||
assertion should always hold, and how it is checked.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>StateBuilder {
|
||||
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>build_and_execute(<span class="self">self</span>, test: <span class="kw">impl </span>FnOnce() -> ()) {
|
||||
<span class="kw">let </span><span class="kw-2">mut </span>ext = TestState::new_empty();
|
||||
ext.execute_with(|| {
|
||||
<span class="kw">for </span>(who, amount) <span class="kw">in </span><span class="kw-2">&</span><span class="self">self</span>.balances {
|
||||
Balances::<Runtime>::insert(who, amount);
|
||||
TotalIssuance::<Runtime>::mutate(|b| <span class="kw-2">*</span>b = <span class="prelude-val">Some</span>(b.unwrap_or(<span class="number">0</span>) + amount));
|
||||
}
|
||||
});
|
||||
|
||||
ext.execute_with(test);
|
||||
|
||||
<span class="comment">// assertions that must always hold
|
||||
</span>ext.execute_with(|| {
|
||||
<span class="macro">assert_eq!</span>(
|
||||
Balances::<Runtime>::iter().map(|(<span class="kw">_</span>, x)| x).sum::<u128>(),
|
||||
TotalIssuance::<Runtime>::get().unwrap_or_default()
|
||||
);
|
||||
})
|
||||
}
|
||||
}</code></pre></div>
|
||||
<p>We can write tests that specifically check the initial state, and making sure our <code>StateBuilder</code>
|
||||
is working exactly as intended.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[test]
|
||||
</span><span class="kw">fn </span>state_builder_works() {
|
||||
StateBuilder::default().build_and_execute(|| {
|
||||
<span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>ALICE), <span class="prelude-val">Some</span>(<span class="number">100</span>));
|
||||
<span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>BOB), <span class="prelude-val">Some</span>(<span class="number">100</span>));
|
||||
<span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>CHARLIE), <span class="prelude-val">None</span>);
|
||||
<span class="macro">assert_eq!</span>(TotalIssuance::<Runtime>::get(), <span class="prelude-val">Some</span>(<span class="number">200</span>));
|
||||
});
|
||||
}</code></pre></div>
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[test]
|
||||
</span><span class="kw">fn </span>state_builder_add_balance() {
|
||||
StateBuilder::default().add_balance(CHARLIE, <span class="number">42</span>).build_and_execute(|| {
|
||||
<span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>CHARLIE), <span class="prelude-val">Some</span>(<span class="number">42</span>));
|
||||
<span class="macro">assert_eq!</span>(TotalIssuance::<Runtime>::get(), <span class="prelude-val">Some</span>(<span class="number">242</span>));
|
||||
})
|
||||
}</code></pre></div><h4 id="more-tests"><a class="doc-anchor" href="#more-tests">§</a>More Tests</h4>
|
||||
<p>Now that we have a more ergonomic test setup, let’s see how a well written test for transfer and
|
||||
mint would look like.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[test]
|
||||
</span><span class="kw">fn </span>transfer_works() {
|
||||
StateBuilder::default().build_and_execute(|| {
|
||||
<span class="comment">// given the initial state, when:
|
||||
</span><span class="macro">assert_ok!</span>(Pallet::<Runtime>::transfer(RuntimeOrigin::signed(ALICE), BOB, <span class="number">50</span>));
|
||||
|
||||
<span class="comment">// then:
|
||||
</span><span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>ALICE), <span class="prelude-val">Some</span>(<span class="number">50</span>));
|
||||
<span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>BOB), <span class="prelude-val">Some</span>(<span class="number">150</span>));
|
||||
<span class="macro">assert_eq!</span>(TotalIssuance::<Runtime>::get(), <span class="prelude-val">Some</span>(<span class="number">200</span>));
|
||||
|
||||
<span class="comment">// when:
|
||||
</span><span class="macro">assert_ok!</span>(Pallet::<Runtime>::transfer(RuntimeOrigin::signed(BOB), ALICE, <span class="number">50</span>));
|
||||
|
||||
<span class="comment">// then:
|
||||
</span><span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>ALICE), <span class="prelude-val">Some</span>(<span class="number">100</span>));
|
||||
<span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>BOB), <span class="prelude-val">Some</span>(<span class="number">100</span>));
|
||||
<span class="macro">assert_eq!</span>(TotalIssuance::<Runtime>::get(), <span class="prelude-val">Some</span>(<span class="number">200</span>));
|
||||
});
|
||||
}</code></pre></div>
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[test]
|
||||
</span><span class="kw">fn </span>mint_works() {
|
||||
StateBuilder::default().build_and_execute(|| {
|
||||
<span class="comment">// given the initial state, when:
|
||||
</span><span class="macro">assert_ok!</span>(Pallet::<Runtime>::mint_unsafe(RuntimeOrigin::signed(ALICE), BOB, <span class="number">100</span>));
|
||||
|
||||
<span class="comment">// then:
|
||||
</span><span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>BOB), <span class="prelude-val">Some</span>(<span class="number">200</span>));
|
||||
<span class="macro">assert_eq!</span>(TotalIssuance::<Runtime>::get(), <span class="prelude-val">Some</span>(<span class="number">300</span>));
|
||||
|
||||
<span class="comment">// given:
|
||||
</span><span class="macro">assert_ok!</span>(Pallet::<Runtime>::mint_unsafe(
|
||||
RuntimeOrigin::signed(ALICE),
|
||||
CHARLIE,
|
||||
<span class="number">100
|
||||
</span>));
|
||||
|
||||
<span class="comment">// then:
|
||||
</span><span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>CHARLIE), <span class="prelude-val">Some</span>(<span class="number">100</span>));
|
||||
<span class="macro">assert_eq!</span>(TotalIssuance::<Runtime>::get(), <span class="prelude-val">Some</span>(<span class="number">400</span>));
|
||||
});
|
||||
}</code></pre></div>
|
||||
<p>It is always a good idea to build a mental model where you write <em>at least</em> one test for each
|
||||
“success path” of a dispatchable, and one test for each “failure path”, such as:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[test]
|
||||
</span><span class="kw">fn </span>transfer_from_non_existent_fails() {
|
||||
StateBuilder::default().build_and_execute(|| {
|
||||
<span class="comment">// given the initial state, when:
|
||||
</span><span class="macro">assert_err!</span>(
|
||||
Pallet::<Runtime>::transfer(RuntimeOrigin::signed(CHARLIE), ALICE, <span class="number">10</span>),
|
||||
<span class="string">"NonExistentAccount"
|
||||
</span>);
|
||||
|
||||
<span class="comment">// then nothing has changed.
|
||||
</span><span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>ALICE), <span class="prelude-val">Some</span>(<span class="number">100</span>));
|
||||
<span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>BOB), <span class="prelude-val">Some</span>(<span class="number">100</span>));
|
||||
<span class="macro">assert_eq!</span>(Balances::<Runtime>::get(<span class="kw-2">&</span>CHARLIE), <span class="prelude-val">None</span>);
|
||||
<span class="macro">assert_eq!</span>(TotalIssuance::<Runtime>::get(), <span class="prelude-val">Some</span>(<span class="number">200</span>));
|
||||
});
|
||||
}</code></pre></div>
|
||||
<p>We leave it up to you to write a test that triggers the <code>InsufficientBalance</code> error.</p>
|
||||
<h4 id="event-and-error"><a class="doc-anchor" href="#event-and-error">§</a>Event and Error</h4>
|
||||
<p>Our pallet is mainly missing two parts that are common in most FRAME pallets: Events, and
|
||||
Errors. First, let’s understand what each is.</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p><strong>Error</strong>: The static string-based error scheme we used so far is good for readability, but it
|
||||
has a few drawbacks. The biggest problem with strings are that they are not type safe, e.g. a
|
||||
match statement cannot be exhaustive. These string literals will bloat the final wasm blob,
|
||||
and are relatively heavy to transmit and encode/decode. Moreover, it is easy to mistype them
|
||||
by one character. FRAME errors are exactly a solution to maintain readability, whilst fixing
|
||||
the drawbacks mentioned. In short, we use an enum to represent different variants of our
|
||||
error. These variants are then mapped in an efficient way (using only <code>u8</code> indices) to
|
||||
[<code>sp_runtime::DispatchError::Module</code>]. Read more about this in <a href="frame_support::pallet_macros::error"><code>pallet::error</code></a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Event</strong>: Events are akin to the return type of dispatchables. They are mostly data blobs
|
||||
emitted by the runtime to let outside world know what is happening inside the pallet. Since
|
||||
otherwise, the outside world does not have an easy access to the state changes. They should
|
||||
represent what happened at the end of a dispatch operation. Therefore, the convention is to
|
||||
use passive tense for event names (eg. <code>SomethingHappened</code>). This allows other sub-systems or
|
||||
external parties (eg. a light-node, a DApp) to listen to particular events happening, without
|
||||
needing to re-execute the whole state transition function.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p>With the explanation out of the way, let’s see how these components can be added. Both follow a
|
||||
fairly familiar syntax: normal Rust enums, with extra <a href="frame_support::pallet_macros::event"><code>pallet::event</code></a> and <a href="frame_support::pallet_macros::error"><code>pallet::error</code></a>
|
||||
attributes attached.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[pallet::event]
|
||||
#[pallet::generate_deposit(<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">fn </span>deposit_event)]
|
||||
</span><span class="kw">pub enum </span>Event<T: Config> {
|
||||
<span class="doccomment">/// A transfer succeeded.
|
||||
</span>Transferred { from: T::AccountId, to: T::AccountId, amount: Balance },
|
||||
}</code></pre></div>
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[pallet::error]
|
||||
</span><span class="kw">pub enum </span>Error<T> {
|
||||
<span class="doccomment">/// Account does not exist.
|
||||
</span>NonExistentAccount,
|
||||
<span class="doccomment">/// Account does not have enough balance.
|
||||
</span>InsufficientBalance,
|
||||
}</code></pre></div>
|
||||
<p>One slightly custom part of this is the <a href="frame_support::pallet_macros::generate_deposit"><code>pallet::generate_deposit</code></a> part. Without going into
|
||||
too much detail, in order for a pallet to emit events to the rest of the system, it needs to do
|
||||
two things:</p>
|
||||
<ol>
|
||||
<li>
|
||||
<p>Declare a type in its <code>Config</code> that refers to the overarching event type of the runtime. In
|
||||
short, by doing this, the pallet is expressing an important bound: <code>type RuntimeEvent: From<Event<Self>></code>. Read: a <code>RuntimeEvent</code> exists, and it can be created from the local <code>enum Event</code> of this pallet. This enables the pallet to convert its <code>Event</code> into <code>RuntimeEvent</code>, and
|
||||
store it where needed.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>But, doing this conversion and storing is too much to expect each pallet to define. FRAME
|
||||
provides a default way of storing events, and this is what <a href="frame_support::pallet_macros::generate_deposit"><code>pallet::generate_deposit</code></a> is
|
||||
doing.</p>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[pallet::config]
|
||||
</span><span class="kw">pub trait </span>Config: frame_system::Config {
|
||||
<span class="doccomment">/// The overarching event type of the runtime.
|
||||
</span><span class="attr">#[allow(deprecated)]
|
||||
</span><span class="kw">type </span>RuntimeEvent: From<Event<<span class="self">Self</span>>>
|
||||
+ IsType<<<span class="self">Self </span><span class="kw">as </span>frame_system::Config>::RuntimeEvent>
|
||||
+ TryInto<Event<<span class="self">Self</span>>>;
|
||||
}</code></pre></div>
|
||||
<blockquote>
|
||||
<p>These <code>Runtime*</code> types are better explained in
|
||||
<a href="../../reference_docs/frame_runtime_types/index.html" title="mod pezkuwi_sdk_docs::reference_docs::frame_runtime_types"><code>crate::reference_docs::frame_runtime_types</code></a>.</p>
|
||||
</blockquote>
|
||||
<p>Then, we can rewrite the <code>transfer</code> dispatchable as such:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub fn </span>transfer(
|
||||
origin: T::RuntimeOrigin,
|
||||
dest: T::AccountId,
|
||||
amount: Balance,
|
||||
) -> DispatchResult {
|
||||
<span class="kw">let </span>sender = ensure_signed(origin)<span class="question-mark">?</span>;
|
||||
|
||||
<span class="comment">// ensure sender has enough balance, and if so, calculate what is left after `amount`.
|
||||
</span><span class="kw">let </span>sender_balance =
|
||||
Balances::<T>::get(<span class="kw-2">&</span>sender).ok_or(Error::<T>::NonExistentAccount)<span class="question-mark">?</span>;
|
||||
<span class="kw">let </span>remainder =
|
||||
sender_balance.checked_sub(amount).ok_or(Error::<T>::InsufficientBalance)<span class="question-mark">?</span>;
|
||||
|
||||
Balances::<T>::mutate(<span class="kw-2">&</span>dest, |b| <span class="kw-2">*</span>b = <span class="prelude-val">Some</span>(b.unwrap_or(<span class="number">0</span>) + amount));
|
||||
Balances::<T>::insert(<span class="kw-2">&</span>sender, remainder);
|
||||
|
||||
<span class="self">Self</span>::deposit_event(Event::<T>::Transferred { from: sender, to: dest, amount });
|
||||
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}</code></pre></div>
|
||||
<p>Then, notice how now we would need to provide this <code>type RuntimeEvent</code> in our test runtime
|
||||
setup.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub mod </span>runtime_v2 {
|
||||
<span class="kw">use super</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">use </span><span class="kw">crate</span>::pallet_v2 <span class="kw">as </span>pallet_currency;
|
||||
|
||||
<span class="macro">construct_runtime!</span>(
|
||||
<span class="kw">pub enum </span>Runtime {
|
||||
System: frame_system,
|
||||
Currency: pallet_currency,
|
||||
}
|
||||
);
|
||||
|
||||
<span class="attr">#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
|
||||
</span><span class="kw">impl </span>frame_system::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>Block = MockBlock<Runtime>;
|
||||
<span class="kw">type </span>AccountId = u64;
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>pallet_currency::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>RuntimeEvent = RuntimeEvent;
|
||||
}
|
||||
}</code></pre></div>
|
||||
<p>In this snippet, the actual <code>RuntimeEvent</code> type (right hand side of <code>type RuntimeEvent = RuntimeEvent</code>) is generated by
|
||||
<a href="frame::runtime::prelude::construct_runtime"><code>construct_runtime</code></a>. An interesting way to inspect
|
||||
this type is to see its definition in rust-docs:
|
||||
<a href="pallet_v2/tests/runtime_v2/enum.RuntimeEvent.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeEvent"><code>crate::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeEvent</code></a>.</p>
|
||||
<h3 id="what-next"><a class="doc-anchor" href="#what-next">§</a>What Next?</h3>
|
||||
<p>The following topics where used in this guide, but not covered in depth. It is suggested to
|
||||
study them subsequently:</p>
|
||||
<ul>
|
||||
<li><a href="../../reference_docs/defensive_programming/index.html" title="mod pezkuwi_sdk_docs::reference_docs::defensive_programming"><code>crate::reference_docs::defensive_programming</code></a>.</li>
|
||||
<li><a href="../../reference_docs/frame_origin/index.html" title="mod pezkuwi_sdk_docs::reference_docs::frame_origin"><code>crate::reference_docs::frame_origin</code></a>.</li>
|
||||
<li><a href="../../reference_docs/frame_runtime_types/index.html" title="mod pezkuwi_sdk_docs::reference_docs::frame_runtime_types"><code>crate::reference_docs::frame_runtime_types</code></a>.</li>
|
||||
<li>The pallet we wrote in this guide was using <code>dev_mode</code>, learn more in <a href="frame_support::pallet_macros::config"><code>pallet::config</code></a>.</li>
|
||||
<li>Learn more about the individual pallet items/macros, such as event and errors and call, in
|
||||
[<code>frame::pallet_macros</code>].</li>
|
||||
</ul>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="pallet/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet::pallet">pallet</a></dt><dd>The <code>pallet</code> module in each FRAME pallet hosts the most important items needed
|
||||
to construct this pallet.</dd><dt><a class="mod" href="pallet_v2/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2">pallet_<wbr>v2</a></dt><dd>The <code>pallet</code> module in each FRAME pallet hosts the most important items needed
|
||||
to construct this pallet.</dd><dt><a class="mod" href="shell_pallet/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet">shell_<wbr>pallet</a></dt><dd>The <code>pallet</code> module in each FRAME pallet hosts the most important items needed
|
||||
to construct this pallet.</dd></dl></section></div></main></body></html>
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="An unsafe mint that can be called by anyone. Not a great idea."><title>mint_unsafe in pezkuwi_sdk_docs::guides::your_first_pallet::pallet::dispatchables - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">mint_unsafe</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">mint_<wbr>unsafe</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#warning-doc-only" title="Warning: Doc-Only">Warning: Doc-Only</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet::<wbr>dispatchables</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../index.html">guides</a>::<wbr><a href="../../index.html">your_first_pallet</a>::<wbr><a href="../index.html">pallet</a>::<wbr><a href="index.html">dispatchables</a></div><h1>Function <span class="fn">mint_<wbr>unsafe</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#342">Source</a> </span></div><pre class="rust item-decl"><code>pub fn mint_unsafe<T: <a class="trait" href="../trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Config">Config</a>>(dest: T::AccountId, amount: <a class="type" href="../type.Balance.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Balance">Balance</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An unsafe mint that can be called by anyone. Not a great idea.</p>
|
||||
<h2 id="warning-doc-only"><a class="doc-anchor" href="#warning-doc-only">§</a>Warning: Doc-Only</h2>
|
||||
<p>This function is an automatically generated, and is doc-only, uncallable
|
||||
stub. See the real version in
|
||||
<a href="../struct.Pallet.html#method.mint_unsafe" title="associated function pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Pallet::mint_unsafe"><code>Pallet::mint_unsafe</code></a>.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Transfer `amount` from `origin` to `dest`."><title>transfer in pezkuwi_sdk_docs::guides::your_first_pallet::pallet::dispatchables - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">transfer</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">transfer</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#warning-doc-only" title="Warning: Doc-Only">Warning: Doc-Only</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet::<wbr>dispatchables</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../index.html">guides</a>::<wbr><a href="../../index.html">your_first_pallet</a>::<wbr><a href="../index.html">pallet</a>::<wbr><a href="index.html">dispatchables</a></div><h1>Function <span class="fn">transfer</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#342">Source</a> </span></div><pre class="rust item-decl"><code>pub fn transfer<T: <a class="trait" href="../trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Config">Config</a>>(dest: T::AccountId, amount: <a class="type" href="../type.Balance.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Balance">Balance</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Transfer <code>amount</code> from <code>origin</code> to <code>dest</code>.</p>
|
||||
<h2 id="warning-doc-only"><a class="doc-anchor" href="#warning-doc-only">§</a>Warning: Doc-Only</h2>
|
||||
<p>This function is an automatically generated, and is doc-only, uncallable
|
||||
stub. See the real version in
|
||||
<a href="../struct.Pallet.html#method.transfer" title="associated function pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Pallet::transfer"><code>Pallet::transfer</code></a>.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Auto-generated docs-only module listing all defined dispatchables for this pallet."><title>pezkuwi_sdk_docs::guides::your_first_pallet::pallet::dispatchables - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module dispatchables</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module dispatchables</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#warning-doc-only" title="Warning: Doc-Only">Warning: Doc-Only</a></li></ul><h3><a href="#functions">Module Items</a></h3><ul class="block"><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../index.html">guides</a>::<wbr><a href="../../index.html">your_first_pallet</a>::<wbr><a href="../index.html">pallet</a></div><h1>Module <span>dispatchables</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#342">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Auto-generated docs-only module listing all defined dispatchables for this pallet.</p>
|
||||
<h2 id="warning-doc-only"><a class="doc-anchor" href="#warning-doc-only">§</a>Warning: Doc-Only</h2>
|
||||
<p>Members of this module cannot be used directly and are only provided for documentation
|
||||
purposes. To see the real version of each dispatchable, look for them in <a href="../struct.Pallet.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Pallet"><code>Pallet</code></a> or
|
||||
<a href="../enum.Call.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Call"><code>Call</code></a>.</p>
|
||||
</div></details><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.mint_unsafe.html" title="fn pezkuwi_sdk_docs::guides::your_first_pallet::pallet::dispatchables::mint_unsafe">mint_<wbr>unsafe</a></dt><dd>An unsafe mint that can be called by anyone. Not a great idea.</dd><dt><a class="fn" href="fn.transfer.html" title="fn pezkuwi_sdk_docs::guides::your_first_pallet::pallet::dispatchables::transfer">transfer</a></dt><dd>Transfer <code>amount</code> from <code>origin</code> to <code>dest</code>.</dd></dl></section></div></main></body></html>
|
||||
-1
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {"fn":["mint_unsafe","transfer"]};
|
||||
File diff suppressed because one or more lines are too long
@@ -1,19 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The `pallet` module in each FRAME pallet hosts the most important items needed to construct this pallet."><title>pezkuwi_sdk_docs::guides::your_first_pallet::pallet - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module pallet</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module pallet</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a></div><h1>Module <span>pallet</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#343">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The <code>pallet</code> module in each FRAME pallet hosts the most important items needed
|
||||
to construct this pallet.</p>
|
||||
<p>The main components of this pallet are:</p>
|
||||
<ul>
|
||||
<li>[<code>Pallet</code>], which implements all of the dispatchable extrinsics of the pallet, among
|
||||
other public functions.
|
||||
<ul>
|
||||
<li>The subset of the functions that are dispatchable can be identified either in the
|
||||
[<code>dispatchables</code>] module or in the [<code>Call</code>] enum.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>[<code>storage_types</code>], which contains the list of all types that are representing a
|
||||
storage item. Otherwise, all storage items are listed among <a href="#types"><em>Type Definitions</em></a>.</li>
|
||||
<li>[<code>Config</code>], which contains the configuration trait of this pallet.</li>
|
||||
<li>[<code>Event</code>] and [<code>Error</code>], which are listed among the <a href="#enums"><em>Enums</em></a>.</li>
|
||||
</ul>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="dispatchables/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet::pallet::dispatchables">dispatchables</a></dt><dd>Auto-generated docs-only module listing all defined dispatchables for this pallet.</dd><dt><a class="mod" href="storage_types/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet::pallet::storage_types">storage_<wbr>types</a></dt><dd>Auto-generated docs-only module listing all (public and private) defined storage types
|
||||
for this pallet.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Pallet.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Pallet">Pallet</a></dt><dd>The <code>Pallet</code> struct, the main type that implements traits and standalone
|
||||
functions within the pallet.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Call.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Call">Call</a></dt><dd>Contains a variant per dispatchable extrinsic that this pallet has.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Config">Config</a></dt><dd>Configuration trait of this pallet.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.Balance.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Balance">Balance</a></dt><dt><a class="type" href="type.Balances.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Balances">Balances</a></dt><dd>A mapping from <code>T::AccountId</code> to <code>Balance</code></dd><dt><a class="type" href="type.Module.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Module">Module</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dd>Type alias to <code>Pallet</code>, to be used by <code>construct_runtime</code>.</dd><dt><a class="type" href="type.TotalIssuance.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet::TotalIssuance">Total<wbr>Issuance</a></dt><dd>Single storage item, of type <code>Balance</code>.</dd></dl></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {"enum":["Call"],"mod":["dispatchables","storage_types"],"struct":["Pallet"],"trait":["Config"],"type":["Balance","Balances","Module","TotalIssuance"]};
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Auto-generated docs-only module listing all (public and private) defined storage types for this pallet."><title>pezkuwi_sdk_docs::guides::your_first_pallet::pallet::storage_types - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module storage_types</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module storage_<wbr>types</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#warning-doc-only" title="Warning: Doc-Only">Warning: Doc-Only</a></li></ul><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../index.html">guides</a>::<wbr><a href="../../index.html">your_first_pallet</a>::<wbr><a href="../index.html">pallet</a></div><h1>Module <span>storage_<wbr>types</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#342">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Auto-generated docs-only module listing all (public and private) defined storage types
|
||||
for this pallet.</p>
|
||||
<h2 id="warning-doc-only"><a class="doc-anchor" href="#warning-doc-only">§</a>Warning: Doc-Only</h2>
|
||||
<p>Members of this module cannot be used directly and are only provided for documentation
|
||||
purposes.</p>
|
||||
<p>To see the actual storage type, find a struct with the same name at the root of the
|
||||
pallet, in the list of <a href="../index.html#types"><em>Type Definitions</em></a>.</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Balances.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet::storage_types::Balances">Balances</a></dt><dd>A mapping from <code>T::AccountId</code> to <code>Balance</code></dd><dt><a class="struct" href="struct.TotalIssuance.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet::storage_types::TotalIssuance">Total<wbr>Issuance</a></dt><dd>Single storage item, of type <code>Balance</code>.</dd></dl></section></div></main></body></html>
|
||||
-1
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {"struct":["Balances","TotalIssuance"]};
|
||||
-148
File diff suppressed because one or more lines are too long
-148
File diff suppressed because one or more lines are too long
-194
File diff suppressed because one or more lines are too long
@@ -1,6 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Configuration trait of this pallet."><title>Config in pezkuwi_sdk_docs::guides::your_first_pallet::pallet - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Config</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Config</a></h2><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a>::<wbr><a href="index.html">pallet</a></div><h1>Trait <span class="trait">Config</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#350">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Config: Config { }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Configuration trait of this pallet.</p>
|
||||
<p>The main purpose of this trait is to act as an interface between this pallet and the runtime in
|
||||
which it is embedded in. A type, function, or constant in this trait is essentially left to be
|
||||
configured by the runtime that includes this pallet.</p>
|
||||
<p>Consequently, a runtime that wants to include this pallet must implement this trait.</p>
|
||||
</div></details><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.91.1/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../../../trait.impl/pezkuwi_sdk_docs/guides/your_first_pallet/pallet/trait.Config.js" async></script></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Balance` type in crate `pezkuwi_sdk_docs`."><title>Balance in pezkuwi_sdk_docs::guides::your_first_pallet::pallet - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Balance</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a>::<wbr><a href="index.html">pallet</a></div><h1>Type Alias <span class="type">Balance</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#347">Source</a> </span></div><pre class="rust item-decl"><code>pub type Balance = <a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.u128.html">u128</a>;</code></pre></section></div></main></body></html>
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A mapping from `T::AccountId` to `Balance`"><title>Balances in pezkuwi_sdk_docs::guides::your_first_pallet::pallet - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Balances</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Balances</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a>::<wbr><a href="index.html">pallet</a></div><h1>Type Alias <span class="type">Balances</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#363">Source</a> </span></div><pre class="rust item-decl"><code>pub type Balances<T: <a class="trait" href="trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Config">Config</a>> = StorageMap<_GeneratedPrefixForStorageBalances<T>, Blake2_128Concat, T::AccountId, <a class="type" href="type.Balance.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Balance">Balance</a>>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A mapping from <code>T::AccountId</code> to <code>Balance</code></p>
|
||||
<p>Storage type is [<code>StorageMap</code>] with key type <code>T :: AccountId</code> and value type <code>Balance</code>.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct Balances<T: <a class="trait" href="trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Config">Config</a>>(<span class="comment">/* private fields */</span>);</code></pre><script src="../../../../type.impl/frame_support/storage/types/map/struct.StorageMap.js" data-self-path="pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Balances" async></script></section></div></main></body></html>
|
||||
@@ -1,3 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Type alias to `Pallet`, to be used by `construct_runtime`."><title>Module in pezkuwi_sdk_docs::guides::your_first_pallet::pallet - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a>::<wbr><a href="index.html">pallet</a></div><h1>Type Alias <span class="type">Module</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#352">Source</a> </span></div><pre class="rust item-decl"><code>pub type Module<T> = <a class="struct" href="struct.Pallet.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Pallet">Pallet</a><T>;</code></pre><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: use <code>Pallet</code> instead</span></div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Type alias to <code>Pallet</code>, to be used by <code>construct_runtime</code>.</p>
|
||||
<p>Generated by <code>pallet</code> attribute macro.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct Module<T>(<span class="comment">/* private fields */</span>);</code></pre><script src="../../../../type.impl/pezkuwi_sdk_docs/guides/your_first_pallet/pallet/struct.Pallet.js" data-self-path="pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Module" async></script></section></div></main></body></html>
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Single storage item, of type `Balance`."><title>TotalIssuance in pezkuwi_sdk_docs::guides::your_first_pallet::pallet - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">TotalIssuance</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Total<wbr>Issuance</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a>::<wbr><a href="index.html">pallet</a></div><h1>Type Alias <span class="type">Total<wbr>Issuance</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#358">Source</a> </span></div><pre class="rust item-decl"><code>pub type TotalIssuance<T: <a class="trait" href="trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Config">Config</a>> = StorageValue<_GeneratedPrefixForStorageTotalIssuance<T>, <a class="type" href="type.Balance.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Balance">Balance</a>>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Single storage item, of type <code>Balance</code>.</p>
|
||||
<p>Storage type is [<code>StorageValue</code>] with value type <code>Balance</code>.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct TotalIssuance<T: <a class="trait" href="trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Config">Config</a>>(<span class="comment">/* private fields */</span>);</code></pre><script src="../../../../type.impl/frame_support/storage/types/value/struct.StorageValue.js" data-self-path="pezkuwi_sdk_docs::guides::your_first_pallet::pallet::TotalIssuance" async></script></section></div></main></body></html>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Warning: Doc-Only"><title>transfer in pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::dispatchables - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">transfer</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">transfer</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#warning-doc-only" title="Warning: Doc-Only">Warning: Doc-Only</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2::<wbr>dispatchables</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../index.html">guides</a>::<wbr><a href="../../index.html">your_first_pallet</a>::<wbr><a href="../index.html">pallet_v2</a>::<wbr><a href="index.html">dispatchables</a></div><h1>Function <span class="fn">transfer</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#667">Source</a> </span></div><pre class="rust item-decl"><code>pub fn transfer<T: <a class="trait" href="../trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Config">Config</a>>(dest: T::AccountId, amount: <a class="type" href="../../pallet/type.Balance.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Balance">Balance</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="warning-doc-only"><a class="doc-anchor" href="#warning-doc-only">§</a>Warning: Doc-Only</h2>
|
||||
<p>This function is an automatically generated, and is doc-only, uncallable
|
||||
stub. See the real version in
|
||||
<a href="../struct.Pallet.html#method.transfer" title="associated function pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Pallet::transfer"><code>Pallet::transfer</code></a>.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Auto-generated docs-only module listing all defined dispatchables for this pallet."><title>pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::dispatchables - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module dispatchables</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module dispatchables</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#warning-doc-only" title="Warning: Doc-Only">Warning: Doc-Only</a></li></ul><h3><a href="#functions">Module Items</a></h3><ul class="block"><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../index.html">guides</a>::<wbr><a href="../../index.html">your_first_pallet</a>::<wbr><a href="../index.html">pallet_v2</a></div><h1>Module <span>dispatchables</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#667">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Auto-generated docs-only module listing all defined dispatchables for this pallet.</p>
|
||||
<h2 id="warning-doc-only"><a class="doc-anchor" href="#warning-doc-only">§</a>Warning: Doc-Only</h2>
|
||||
<p>Members of this module cannot be used directly and are only provided for documentation
|
||||
purposes. To see the real version of each dispatchable, look for them in <a href="../struct.Pallet.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Pallet"><code>Pallet</code></a> or
|
||||
<a href="../enum.Call.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Call"><code>Call</code></a>.</p>
|
||||
</div></details><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.transfer.html" title="fn pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::dispatchables::transfer">transfer</a></dt><dd>Warning: Doc-Only</dd></dl></section></div></main></body></html>
|
||||
-1
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {"fn":["transfer"]};
|
||||
-233
File diff suppressed because one or more lines are too long
-200
File diff suppressed because one or more lines are too long
-230
File diff suppressed because one or more lines are too long
@@ -1,19 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The `pallet` module in each FRAME pallet hosts the most important items needed to construct this pallet."><title>pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module pallet_v2</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module pallet_<wbr>v2</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a></div><h1>Module <span>pallet_<wbr>v2</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#668">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The <code>pallet</code> module in each FRAME pallet hosts the most important items needed
|
||||
to construct this pallet.</p>
|
||||
<p>The main components of this pallet are:</p>
|
||||
<ul>
|
||||
<li>[<code>Pallet</code>], which implements all of the dispatchable extrinsics of the pallet, among
|
||||
other public functions.
|
||||
<ul>
|
||||
<li>The subset of the functions that are dispatchable can be identified either in the
|
||||
[<code>dispatchables</code>] module or in the [<code>Call</code>] enum.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>[<code>storage_types</code>], which contains the list of all types that are representing a
|
||||
storage item. Otherwise, all storage items are listed among <a href="#types"><em>Type Definitions</em></a>.</li>
|
||||
<li>[<code>Config</code>], which contains the configuration trait of this pallet.</li>
|
||||
<li>[<code>Event</code>] and [<code>Error</code>], which are listed among the <a href="#enums"><em>Enums</em></a>.</li>
|
||||
</ul>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="dispatchables/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::dispatchables">dispatchables</a></dt><dd>Auto-generated docs-only module listing all defined dispatchables for this pallet.</dd><dt><a class="mod" href="storage_types/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::storage_types">storage_<wbr>types</a></dt><dd>Auto-generated docs-only module listing all (public and private) defined storage types
|
||||
for this pallet.</dd><dt><a class="mod" href="tests/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests">tests</a></dt></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Pallet.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Pallet">Pallet</a></dt><dd>The <code>Pallet</code> struct, the main type that implements traits and standalone
|
||||
functions within the pallet.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Call.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Call">Call</a></dt><dd>Contains a variant per dispatchable extrinsic that this pallet has.</dd><dt><a class="enum" href="enum.Error.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Error">Error</a></dt><dd>The <code>Error</code> enum of this pallet.</dd><dt><a class="enum" href="enum.Event.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Event">Event</a></dt><dd>The <code>Event</code> enum of this pallet</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Config">Config</a></dt><dd>Configuration trait of this pallet.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.Balances.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Balances">Balances</a></dt><dd>Storage type is [<code>StorageMap</code>] with key type <code>T :: AccountId</code> and value type <code>Balance</code>.</dd><dt><a class="type" href="type.Module.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Module">Module</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dd>Type alias to <code>Pallet</code>, to be used by <code>construct_runtime</code>.</dd><dt><a class="type" href="type.TotalIssuance.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::TotalIssuance">Total<wbr>Issuance</a></dt><dd>Storage type is [<code>StorageValue</code>] with value type <code>Balance</code>.</dd></dl></section></div></main></body></html>
|
||||
-1
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {"enum":["Call","Error","Event"],"mod":["dispatchables","storage_types","tests"],"struct":["Pallet"],"trait":["Config"],"type":["Balances","Module","TotalIssuance"]};
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Auto-generated docs-only module listing all (public and private) defined storage types for this pallet."><title>pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::storage_types - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module storage_types</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module storage_<wbr>types</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#warning-doc-only" title="Warning: Doc-Only">Warning: Doc-Only</a></li></ul><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../index.html">guides</a>::<wbr><a href="../../index.html">your_first_pallet</a>::<wbr><a href="../index.html">pallet_v2</a></div><h1>Module <span>storage_<wbr>types</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#667">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Auto-generated docs-only module listing all (public and private) defined storage types
|
||||
for this pallet.</p>
|
||||
<h2 id="warning-doc-only"><a class="doc-anchor" href="#warning-doc-only">§</a>Warning: Doc-Only</h2>
|
||||
<p>Members of this module cannot be used directly and are only provided for documentation
|
||||
purposes.</p>
|
||||
<p>To see the actual storage type, find a struct with the same name at the root of the
|
||||
pallet, in the list of <a href="../index.html#types"><em>Type Definitions</em></a>.</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Balances.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::storage_types::Balances">Balances</a></dt><dd>Warning: Doc-Only</dd><dt><a class="struct" href="struct.TotalIssuance.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::storage_types::TotalIssuance">Total<wbr>Issuance</a></dt><dd>Warning: Doc-Only</dd></dl></section></div></main></body></html>
|
||||
-1
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {"struct":["Balances","TotalIssuance"]};
|
||||
-147
File diff suppressed because one or more lines are too long
-147
File diff suppressed because one or more lines are too long
-179
File diff suppressed because one or more lines are too long
-1
@@ -1 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `tests` mod in crate `pezkuwi_sdk_docs`."><title>pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module tests</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module tests</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../index.html">guides</a>::<wbr><a href="../../index.html">your_first_pallet</a>::<wbr><a href="../index.html">pallet_v2</a></div><h1>Module <span>tests</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#734">Source</a> </span></div><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="runtime_v2/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2">runtime_<wbr>v2</a></dt></dl></section></div></main></body></html>
|
||||
-203
File diff suppressed because one or more lines are too long
-219
File diff suppressed because one or more lines are too long
-187
File diff suppressed because one or more lines are too long
-202
File diff suppressed because one or more lines are too long
-199
File diff suppressed because one or more lines are too long
-199
File diff suppressed because one or more lines are too long
-199
File diff suppressed because one or more lines are too long
-199
File diff suppressed because one or more lines are too long
-199
File diff suppressed because one or more lines are too long
-202
File diff suppressed because one or more lines are too long
-3
@@ -1,3 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `runtime_v2` mod in crate `pezkuwi_sdk_docs`."><title>pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module runtime_v2</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module runtime_<wbr>v2</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2::<wbr>tests</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../../index.html">guides</a>::<wbr><a href="../../../index.html">your_first_pallet</a>::<wbr><a href="../../index.html">pallet_v2</a>::<wbr><a href="../index.html">tests</a></div><h1>Module <span>runtime_<wbr>v2</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#741">Source</a> </span></div><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.PalletInfo.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::PalletInfo">Pallet<wbr>Info</a></dt><dd>Provides an implementation of <code>PalletInfo</code> to provide information
|
||||
about the pallet setup in the runtime.</dd><dt><a class="struct" href="struct.Runtime.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::Runtime">Runtime</a></dt><dt><a class="struct" href="struct.RuntimeGenesisConfig.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeGenesisConfig">Runtime<wbr>Genesis<wbr>Config</a></dt><dt><a class="struct" href="struct.RuntimeOrigin.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeOrigin">Runtime<wbr>Origin</a></dt><dd>The runtime origin type representing the origin of a call.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.OriginCaller.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::OriginCaller">Origin<wbr>Caller</a></dt><dt><a class="enum" href="enum.RuntimeCall.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeCall">Runtime<wbr>Call</a></dt><dd>The aggregated runtime call type.</dd><dt><a class="enum" href="enum.RuntimeError.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeError">Runtime<wbr>Error</a></dt><dt><a class="enum" href="enum.RuntimeEvent.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeEvent">Runtime<wbr>Event</a></dt><dt><a class="enum" href="enum.RuntimeFreezeReason.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeFreezeReason">Runtime<wbr>Freeze<wbr>Reason</a></dt><dd>A reason for placing a freeze on funds.</dd><dt><a class="enum" href="enum.RuntimeHoldReason.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeHoldReason">Runtime<wbr>Hold<wbr>Reason</a></dt><dd>A reason for placing a hold on funds.</dd><dt><a class="enum" href="enum.RuntimeLockId.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeLockId">Runtime<wbr>Lock<wbr>Id</a></dt><dd>An identifier for each lock placed on funds.</dd><dt><a class="enum" href="enum.RuntimeSlashReason.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeSlashReason">Runtime<wbr>Slash<wbr>Reason</a></dt><dd>A reason for slashing funds.</dd><dt><a class="enum" href="enum.RuntimeTask.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeTask">Runtime<wbr>Task</a></dt><dd>An aggregation of all <code>Task</code> enums across all pallets included in the current runtime.</dd><dt><a class="enum" href="enum.RuntimeViewFunction.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeViewFunction">Runtime<wbr>View<wbr>Function</a></dt><dd>Runtime query type.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.AllPalletsWithSystem.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::AllPalletsWithSystem">AllPallets<wbr>With<wbr>System</a></dt><dd>All pallets included in the runtime as a nested tuple of types.</dd><dt><a class="type" href="type.AllPalletsWithoutSystem.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::AllPalletsWithoutSystem">AllPallets<wbr>Without<wbr>System</a></dt><dd>All pallets included in the runtime as a nested tuple of types.
|
||||
Excludes the System pallet.</dd><dt><a class="type" href="type.Currency.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::Currency">Currency</a></dt><dt><a class="type" href="type.System.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::System">System</a></dt><dt><a class="type" href="type.SystemConfig.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::SystemConfig">System<wbr>Config</a></dt></dl></section></div></main></body></html>
|
||||
-1
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {"enum":["OriginCaller","RuntimeCall","RuntimeError","RuntimeEvent","RuntimeFreezeReason","RuntimeHoldReason","RuntimeLockId","RuntimeSlashReason","RuntimeTask","RuntimeViewFunction"],"struct":["PalletInfo","Runtime","RuntimeGenesisConfig","RuntimeOrigin"],"type":["AllPalletsWithSystem","AllPalletsWithoutSystem","Currency","System","SystemConfig"]};
|
||||
-146
File diff suppressed because one or more lines are too long
-169
File diff suppressed because one or more lines are too long
-153
File diff suppressed because one or more lines are too long
-159
File diff suppressed because one or more lines are too long
-2
@@ -1,2 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="All pallets included in the runtime as a nested tuple of types."><title>AllPalletsWithSystem in pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">AllPalletsWithSystem</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2::<wbr>tests::<wbr>runtime_<wbr>v2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../../index.html">guides</a>::<wbr><a href="../../../index.html">your_first_pallet</a>::<wbr><a href="../../index.html">pallet_v2</a>::<wbr><a href="../index.html">tests</a>::<wbr><a href="index.html">runtime_v2</a></div><h1>Type Alias <span class="type">AllPallets<wbr>With<wbr>System</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#745-750">Source</a> </span></div><pre class="rust item-decl"><code>pub type AllPalletsWithSystem = (<a class="type" href="type.System.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::System">System</a>, <a class="type" href="type.Currency.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::Currency">Currency</a>);</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>All pallets included in the runtime as a nested tuple of types.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="All pallets included in the runtime as a nested tuple of types. Excludes the System pallet."><title>AllPalletsWithoutSystem in pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">AllPalletsWithoutSystem</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2::<wbr>tests::<wbr>runtime_<wbr>v2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../../index.html">guides</a>::<wbr><a href="../../../index.html">your_first_pallet</a>::<wbr><a href="../../index.html">pallet_v2</a>::<wbr><a href="../index.html">tests</a>::<wbr><a href="index.html">runtime_v2</a></div><h1>Type Alias <span class="type">AllPallets<wbr>Without<wbr>System</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#745-750">Source</a> </span></div><pre class="rust item-decl"><code>pub type AllPalletsWithoutSystem = (<a class="type" href="type.Currency.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::Currency">Currency</a>,);</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>All pallets included in the runtime as a nested tuple of types.
|
||||
Excludes the System pallet.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
-1
@@ -1 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `Currency` type in crate `pezkuwi_sdk_docs`."><title>Currency in pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Currency</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Currency</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2::<wbr>tests::<wbr>runtime_<wbr>v2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../../index.html">guides</a>::<wbr><a href="../../../index.html">your_first_pallet</a>::<wbr><a href="../../index.html">pallet_v2</a>::<wbr><a href="../index.html">tests</a>::<wbr><a href="index.html">runtime_v2</a></div><h1>Type Alias <span class="type">Currency</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#745-750">Source</a> </span></div><pre class="rust item-decl"><code>pub type Currency = <a class="struct" href="../../struct.Pallet.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Pallet">Pallet</a><<a class="struct" href="struct.Runtime.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::Runtime">Runtime</a>>;</code></pre><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct Currency(<span class="comment">/* private fields */</span>);</code></pre><script src="../../../../../../type.impl/pezkuwi_sdk_docs/guides/your_first_pallet/pallet_v2/struct.Pallet.js" data-self-path="pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::Currency" async></script></section></div></main></body></html>
|
||||
-1
@@ -1 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `System` type in crate `pezkuwi_sdk_docs`."><title>System in pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">System</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">System</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2::<wbr>tests::<wbr>runtime_<wbr>v2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../../index.html">guides</a>::<wbr><a href="../../../index.html">your_first_pallet</a>::<wbr><a href="../../index.html">pallet_v2</a>::<wbr><a href="../index.html">tests</a>::<wbr><a href="index.html">runtime_v2</a></div><h1>Type Alias <span class="type">System</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#745-750">Source</a> </span></div><pre class="rust item-decl"><code>pub type System = Pallet<<a class="struct" href="struct.Runtime.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::Runtime">Runtime</a>>;</code></pre><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct System(<span class="comment">/* private fields */</span>);</code></pre><script src="../../../../../../type.impl/frame_system/pallet/struct.Pallet.js" data-self-path="pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::System" async></script></section></div></main></body></html>
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `SystemConfig` type in crate `pezkuwi_sdk_docs`."><title>SystemConfig in pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../../" data-static-root-path="../../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">SystemConfig</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">System<wbr>Config</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3><h3><a href="#fields">Fields</a></h3><ul class="block field"><li><a href="#structfield._config" title="_config">_config</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2::<wbr>tests::<wbr>runtime_<wbr>v2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../../index.html">guides</a>::<wbr><a href="../../../index.html">your_first_pallet</a>::<wbr><a href="../../index.html">pallet_v2</a>::<wbr><a href="../index.html">tests</a>::<wbr><a href="index.html">runtime_v2</a></div><h1>Type Alias <span class="type">System<wbr>Config</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#745-750">Source</a> </span></div><pre class="rust item-decl"><code>pub type SystemConfig = GenesisConfig<<a class="struct" href="struct.Runtime.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::Runtime">Runtime</a>>;</code></pre><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct SystemConfig {
|
||||
pub _config: <a class="struct" href="https://doc.rust-lang.org/1.91.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a><<a class="struct" href="struct.Runtime.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::Runtime">Runtime</a>>,
|
||||
}</code></pre><h2 id="fields" class="fields section-header">Fields<a href="#fields" class="anchor">§</a></h2><span id="structfield._config" class="structfield section-header"><a href="#structfield._config" class="anchor field">§</a><code>_config: <a class="struct" href="https://doc.rust-lang.org/1.91.1/core/marker/struct.PhantomData.html" title="struct core::marker::PhantomData">PhantomData</a><<a class="struct" href="struct.Runtime.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::Runtime">Runtime</a>></code></span><script src="../../../../../../type.impl/frame_system/pallet/struct.GenesisConfig.js" data-self-path="pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::SystemConfig" async></script></section></div></main></body></html>
|
||||
-1
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {"mod":["runtime_v2"]};
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Configuration trait of this pallet."><title>Config in pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Config</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Config</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.RuntimeEvent" title="RuntimeEvent">RuntimeEvent</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a>::<wbr><a href="index.html">pallet_v2</a></div><h1>Trait <span class="trait">Config</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#674-680">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Config: Config + Config<RuntimeEvent: <a class="trait" href="https://doc.rust-lang.org/1.91.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="enum.Event.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Event">Event</a><Self>>> {
|
||||
type <a href="#associatedtype.RuntimeEvent" class="associatedtype">RuntimeEvent</a>: <a class="trait" href="https://doc.rust-lang.org/1.91.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="enum.Event.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Event">Event</a><Self>> + IsType<<Self as Config>::RuntimeEvent> + <a class="trait" href="https://doc.rust-lang.org/1.91.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="enum" href="enum.Event.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Event">Event</a><Self>>;
|
||||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Configuration trait of this pallet.</p>
|
||||
<p>The main purpose of this trait is to act as an interface between this pallet and the runtime in
|
||||
which it is embedded in. A type, function, or constant in this trait is essentially left to be
|
||||
configured by the runtime that includes this pallet.</p>
|
||||
<p>Consequently, a runtime that wants to include this pallet must implement this trait.</p>
|
||||
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.RuntimeEvent" class="method"><a class="src rightside" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#677-679">Source</a><h4 class="code-header">type <a href="#associatedtype.RuntimeEvent" class="associatedtype">RuntimeEvent</a>: <a class="trait" href="https://doc.rust-lang.org/1.91.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><<a class="enum" href="enum.Event.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Event">Event</a><Self>> + IsType<<Self as Config>::RuntimeEvent> + <a class="trait" href="https://doc.rust-lang.org/1.91.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><<a class="enum" href="enum.Event.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Event">Event</a><Self>></h4></section></summary><div class="docblock"><p>The overarching event type of the runtime.</p>
|
||||
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.91.1/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-Config-for-Runtime" class="impl"><a class="src rightside" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#758-760">Source</a><a href="#impl-Config-for-Runtime" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Config">Config</a> for <a class="struct" href="tests/runtime_v2/struct.Runtime.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::Runtime">Runtime</a></h3></section></summary><div class="impl-items"><section id="associatedtype.RuntimeEvent-1" class="associatedtype trait-impl"><a class="src rightside" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#759">Source</a><a href="#associatedtype.RuntimeEvent-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.RuntimeEvent" class="associatedtype">RuntimeEvent</a> = <a class="enum" href="tests/runtime_v2/enum.RuntimeEvent.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeEvent">RuntimeEvent</a></h4></section></div></details></div><script src="../../../../trait.impl/pezkuwi_sdk_docs/guides/your_first_pallet/pallet_v2/trait.Config.js" async></script></section></div></main></body></html>
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Storage type is `StorageMap` with key type `T :: AccountId` and value type `Balance`."><title>Balances in pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Balances</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Balances</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a>::<wbr><a href="index.html">pallet_v2</a></div><h1>Type Alias <span class="type">Balances</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#686">Source</a> </span></div><pre class="rust item-decl"><code>pub type Balances<T: <a class="trait" href="trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Config">Config</a>> = StorageMap<_GeneratedPrefixForStorageBalances<T>, Blake2_128Concat, T::AccountId, <a class="type" href="../pallet/type.Balance.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Balance">Balance</a>>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Storage type is [<code>StorageMap</code>] with key type <code>T :: AccountId</code> and value type <code>Balance</code>.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct Balances<T: <a class="trait" href="trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Config">Config</a>>(<span class="comment">/* private fields */</span>);</code></pre><script src="../../../../type.impl/frame_support/storage/types/map/struct.StorageMap.js" data-self-path="pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Balances" async></script></section></div></main></body></html>
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Type alias to `Pallet`, to be used by `construct_runtime`."><title>Module in pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a>::<wbr><a href="index.html">pallet_v2</a></div><h1>Type Alias <span class="type">Module</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#682">Source</a> </span></div><pre class="rust item-decl"><code>pub type Module<T> = <a class="struct" href="struct.Pallet.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Pallet">Pallet</a><T>;</code></pre><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: use <code>Pallet</code> instead</span></div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Type alias to <code>Pallet</code>, to be used by <code>construct_runtime</code>.</p>
|
||||
<p>Generated by <code>pallet</code> attribute macro.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct Module<T>(<span class="comment">/* private fields */</span>);</code></pre><script src="../../../../type.impl/pezkuwi_sdk_docs/guides/your_first_pallet/pallet_v2/struct.Pallet.js" data-self-path="pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Module" async></script></section></div></main></body></html>
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Storage type is `StorageValue` with value type `Balance`."><title>TotalIssuance in pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">TotalIssuance</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Total<wbr>Issuance</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>pallet_<wbr>v2</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a>::<wbr><a href="index.html">pallet_v2</a></div><h1>Type Alias <span class="type">Total<wbr>Issuance</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#689">Source</a> </span></div><pre class="rust item-decl"><code>pub type TotalIssuance<T: <a class="trait" href="trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Config">Config</a>> = StorageValue<_GeneratedPrefixForStorageTotalIssuance<T>, <a class="type" href="../pallet/type.Balance.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::pallet::Balance">Balance</a>>;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Storage type is [<code>StorageValue</code>] with value type <code>Balance</code>.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct TotalIssuance<T: <a class="trait" href="trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::Config">Config</a>>(<span class="comment">/* private fields */</span>);</code></pre><script src="../../../../type.impl/frame_support/storage/types/value/struct.StorageValue.js" data-self-path="pezkuwi_sdk_docs::guides::your_first_pallet::pallet_v2::TotalIssuance" async></script></section></div></main></body></html>
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Auto-generated docs-only module listing all defined dispatchables for this pallet."><title>pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet::dispatchables - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module dispatchables</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module dispatchables</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#warning-doc-only" title="Warning: Doc-Only">Warning: Doc-Only</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>shell_<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../index.html">guides</a>::<wbr><a href="../../index.html">your_first_pallet</a>::<wbr><a href="../index.html">shell_pallet</a></div><h1>Module <span>dispatchables</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#331">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Auto-generated docs-only module listing all defined dispatchables for this pallet.</p>
|
||||
<h2 id="warning-doc-only"><a class="doc-anchor" href="#warning-doc-only">§</a>Warning: Doc-Only</h2>
|
||||
<p>Members of this module cannot be used directly and are only provided for documentation
|
||||
purposes. To see the real version of each dispatchable, look for them in <a href="../struct.Pallet.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet::Pallet"><code>Pallet</code></a> or
|
||||
<a href="../enum.Call.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet::Call"><code>Call</code></a>.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
-1
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {};
|
||||
-214
File diff suppressed because one or more lines are too long
@@ -1,19 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The `pallet` module in each FRAME pallet hosts the most important items needed to construct this pallet."><title>pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module shell_pallet</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module shell_<wbr>pallet</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a></div><h1>Module <span>shell_<wbr>pallet</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#332">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The <code>pallet</code> module in each FRAME pallet hosts the most important items needed
|
||||
to construct this pallet.</p>
|
||||
<p>The main components of this pallet are:</p>
|
||||
<ul>
|
||||
<li>[<code>Pallet</code>], which implements all of the dispatchable extrinsics of the pallet, among
|
||||
other public functions.
|
||||
<ul>
|
||||
<li>The subset of the functions that are dispatchable can be identified either in the
|
||||
[<code>dispatchables</code>] module or in the [<code>Call</code>] enum.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>[<code>storage_types</code>], which contains the list of all types that are representing a
|
||||
storage item. Otherwise, all storage items are listed among <a href="#types"><em>Type Definitions</em></a>.</li>
|
||||
<li>[<code>Config</code>], which contains the configuration trait of this pallet.</li>
|
||||
<li>[<code>Event</code>] and [<code>Error</code>], which are listed among the <a href="#enums"><em>Enums</em></a>.</li>
|
||||
</ul>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="dispatchables/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet::dispatchables">dispatchables</a></dt><dd>Auto-generated docs-only module listing all defined dispatchables for this pallet.</dd><dt><a class="mod" href="storage_types/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet::storage_types">storage_<wbr>types</a></dt><dd>Auto-generated docs-only module listing all (public and private) defined storage types
|
||||
for this pallet.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Pallet.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet::Pallet">Pallet</a></dt><dd>The <code>Pallet</code> struct, the main type that implements traits and standalone
|
||||
functions within the pallet.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Call.html" title="enum pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet::Call">Call</a></dt><dd>Contains a variant per dispatchable extrinsic that this pallet has.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.Config.html" title="trait pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet::Config">Config</a></dt><dd>Configuration trait of this pallet.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.Module.html" title="type pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet::Module">Module</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dd>Type alias to <code>Pallet</code>, to be used by <code>construct_runtime</code>.</dd></dl></section></div></main></body></html>
|
||||
-1
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {"enum":["Call"],"mod":["dispatchables","storage_types"],"struct":["Pallet"],"trait":["Config"],"type":["Module"]};
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Auto-generated docs-only module listing all (public and private) defined storage types for this pallet."><title>pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet::storage_types - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module storage_types</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module storage_<wbr>types</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#warning-doc-only" title="Warning: Doc-Only">Warning: Doc-Only</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>shell_<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../index.html">guides</a>::<wbr><a href="../../index.html">your_first_pallet</a>::<wbr><a href="../index.html">shell_pallet</a></div><h1>Module <span>storage_<wbr>types</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#331">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Auto-generated docs-only module listing all (public and private) defined storage types
|
||||
for this pallet.</p>
|
||||
<h2 id="warning-doc-only"><a class="doc-anchor" href="#warning-doc-only">§</a>Warning: Doc-Only</h2>
|
||||
<p>Members of this module cannot be used directly and are only provided for documentation
|
||||
purposes.</p>
|
||||
<p>To see the actual storage type, find a struct with the same name at the root of the
|
||||
pallet, in the list of <a href="../index.html#types"><em>Type Definitions</em></a>.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
-1
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {};
|
||||
-175
File diff suppressed because one or more lines are too long
-6
@@ -1,6 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Configuration trait of this pallet."><title>Config in pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Config</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Config</a></h2><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>shell_<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a>::<wbr><a href="index.html">shell_pallet</a></div><h1>Trait <span class="trait">Config</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#336">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Config: Config { }</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Configuration trait of this pallet.</p>
|
||||
<p>The main purpose of this trait is to act as an interface between this pallet and the runtime in
|
||||
which it is embedded in. A type, function, or constant in this trait is essentially left to be
|
||||
configured by the runtime that includes this pallet.</p>
|
||||
<p>Consequently, a runtime that wants to include this pallet must implement this trait.</p>
|
||||
</div></details><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.91.1/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../../../trait.impl/pezkuwi_sdk_docs/guides/your_first_pallet/shell_pallet/trait.Config.js" async></script></section></div></main></body></html>
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Type alias to `Pallet`, to be used by `construct_runtime`."><title>Module in pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module</a></h2><h3><a href="#aliased-type">Aliased Type</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides::<wbr>your_<wbr>first_<wbr>pallet::<wbr>shell_<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../index.html">guides</a>::<wbr><a href="../index.html">your_first_pallet</a>::<wbr><a href="index.html">shell_pallet</a></div><h1>Type Alias <span class="type">Module</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../src/pezkuwi_sdk_docs/guides/your_first_pallet/mod.rs.html#338">Source</a> </span></div><pre class="rust item-decl"><code>pub type Module<T> = <a class="struct" href="struct.Pallet.html" title="struct pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet::Pallet">Pallet</a><T>;</code></pre><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated: use <code>Pallet</code> instead</span></div></span><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Type alias to <code>Pallet</code>, to be used by <code>construct_runtime</code>.</p>
|
||||
<p>Generated by <code>pallet</code> attribute macro.</p>
|
||||
</div></details><h2 id="aliased-type" class="section-header">Aliased Type<a href="#aliased-type" class="anchor">§</a></h2><pre class="rust item-decl"><code>pub struct Module<T>(<span class="comment">/* private fields */</span>);</code></pre><script src="../../../../type.impl/pezkuwi_sdk_docs/guides/your_first_pallet/shell_pallet/struct.Pallet.js" data-self-path="pezkuwi_sdk_docs::guides::your_first_pallet::shell_pallet::Module" async></script></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {"mod":["pallet","pallet_v2","shell_pallet"]};
|
||||
@@ -1,234 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Write your first real runtime, compiling it to WASM."><title>pezkuwi_sdk_docs::guides::your_first_runtime - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module your_first_runtime</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module your_<wbr>first_<wbr>runtime</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#your-first-runtime" title="Your first Runtime">Your first Runtime</a><ul><li><a href="#setup" title="Setup">Setup</a></li><li><a href="#your-first-runtime-1" title="Your First Runtime">Your First Runtime</a></li><li><a href="#genesis-configuration" title="Genesis Configuration">Genesis Configuration</a></li><li><a href="#next-step" title="Next Step">Next Step</a></li><li><a href="#further-reading" title="Further Reading">Further Reading</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>guides</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../index.html">guides</a></div><h1>Module <span>your_<wbr>first_<wbr>runtime</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/pezkuwi_sdk_docs/guides/your_first_runtime.rs.html#1-186">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Write your first real <a href="../../reference_docs/wasm_meta_protocol/index.html" title="mod pezkuwi_sdk_docs::reference_docs::wasm_meta_protocol">runtime</a>,
|
||||
compiling it to <a href="../../pezkuwi_sdk/substrate/index.html#wasm-build" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::substrate">WASM</a>.</p>
|
||||
<h2 id="your-first-runtime"><a class="doc-anchor" href="#your-first-runtime">§</a>Your first Runtime</h2>
|
||||
<p>This guide will walk you through the steps to add your pallet to a runtime.</p>
|
||||
<p>The good news is, in <a href="../your_first_pallet/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet"><code>crate::guides::your_first_pallet</code></a>, we have already created a <em>test</em>
|
||||
runtime that was used for testing, and a real runtime is not that much different!</p>
|
||||
<h3 id="setup"><a class="doc-anchor" href="#setup">§</a>Setup</h3>
|
||||
<p>A runtime shares a few similar setup requirements as with a pallet:</p>
|
||||
<ul>
|
||||
<li>importing [<code>frame</code>], [<code>codec</code>], and [<code>scale_info</code>] crates.</li>
|
||||
<li>following the <a href="../../pezkuwi_sdk/substrate/index.html#wasm-build" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::substrate"><code>std</code> feature-gating</a> pattern.</li>
|
||||
</ul>
|
||||
<p>But, more specifically, it also contains:</p>
|
||||
<ul>
|
||||
<li>a <code>build.rs</code> that uses [<code>substrate_wasm_builder</code>]. This entails declaring
|
||||
<code>[build-dependencies]</code> in the Cargo manifest file:</li>
|
||||
</ul>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code>[build-dependencies]
|
||||
substrate-wasm-builder = { ... }</code></pre></div>
|
||||
<blockquote>
|
||||
<p>Note that a runtime must always be one-runtime-per-crate. You cannot define multiple runtimes
|
||||
per rust crate.</p>
|
||||
</blockquote>
|
||||
<p>You can find the full code of this guide in [<code>first_runtime</code>].</p>
|
||||
<h3 id="your-first-runtime-1"><a class="doc-anchor" href="#your-first-runtime-1">§</a>Your First Runtime</h3>
|
||||
<p>The first new property of a real runtime that it must define its
|
||||
[<code>frame::runtime::prelude::RuntimeVersion</code>]:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[runtime_version]
|
||||
</span><span class="kw">pub const </span>VERSION: RuntimeVersion = RuntimeVersion {
|
||||
spec_name: alloc::borrow::Cow::Borrowed(<span class="string">"first-runtime"</span>),
|
||||
impl_name: alloc::borrow::Cow::Borrowed(<span class="string">"first-runtime"</span>),
|
||||
authoring_version: <span class="number">1</span>,
|
||||
spec_version: <span class="number">0</span>,
|
||||
impl_version: <span class="number">1</span>,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
transaction_version: <span class="number">1</span>,
|
||||
system_version: <span class="number">1</span>,
|
||||
};</code></pre></div>
|
||||
<p>The version contains a number of very important fields, such as <code>spec_version</code> and <code>spec_name</code>
|
||||
that play an important role in identifying your runtime and its version, more importantly in
|
||||
runtime upgrades. More about runtime upgrades in
|
||||
<a href="../../reference_docs/frame_runtime_upgrades_and_migrations/index.html" title="mod pezkuwi_sdk_docs::reference_docs::frame_runtime_upgrades_and_migrations"><code>crate::reference_docs::frame_runtime_upgrades_and_migrations</code></a>.</p>
|
||||
<p>Then, a real runtime also contains the <code>impl</code> of all individual pallets’ <code>trait Config</code> for
|
||||
<code>struct Runtime</code>, and a [<code>frame::runtime::prelude::construct_runtime</code>] macro that amalgamates
|
||||
them all.</p>
|
||||
<p>In the case of our example:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">impl </span>our_first_pallet::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>RuntimeEvent = RuntimeEvent;
|
||||
}</code></pre></div>
|
||||
<p>In this example, we bring in a number of other pallets from [<code>frame</code>] into the runtime, each of
|
||||
their <code>Config</code> need to be implemented for <code>struct Runtime</code>:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">use super</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="macro">parameter_types!</span> {
|
||||
<span class="kw">pub const </span>Version: RuntimeVersion = VERSION;
|
||||
}
|
||||
|
||||
<span class="attr">#[derive_impl(frame_system::config_preludes::SolochainDefaultConfig)]
|
||||
</span><span class="kw">impl </span>frame_system::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>Block = Block;
|
||||
<span class="kw">type </span>Version = Version;
|
||||
<span class="kw">type </span>AccountData =
|
||||
pallet_balances::AccountData<<Runtime <span class="kw">as </span>pallet_balances::Config>::Balance>;
|
||||
}
|
||||
|
||||
<span class="attr">#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
|
||||
</span><span class="kw">impl </span>pallet_balances::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>AccountStore = System;
|
||||
}
|
||||
|
||||
<span class="attr">#[derive_impl(pallet_sudo::config_preludes::TestDefaultConfig)]
|
||||
</span><span class="kw">impl </span>pallet_sudo::Config <span class="kw">for </span>Runtime {}
|
||||
|
||||
<span class="attr">#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)]
|
||||
</span><span class="kw">impl </span>pallet_timestamp::Config <span class="kw">for </span>Runtime {}
|
||||
|
||||
<span class="attr">#[derive_impl(pallet_transaction_payment::config_preludes::TestDefaultConfig)]
|
||||
</span><span class="kw">impl </span>pallet_transaction_payment::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>OnChargeTransaction = pallet_transaction_payment::FungibleAdapter<Balances, ()>;
|
||||
<span class="comment">// We specify a fixed length to fee here, which essentially means all transactions charge
|
||||
// exactly 1 unit of fee.
|
||||
</span><span class="kw">type </span>LengthToFee = FixedFee<<span class="number">1</span>, <<span class="self">Self </span><span class="kw">as </span>pallet_balances::Config>::Balance>;
|
||||
<span class="kw">type </span>WeightToFee = NoFee<<<span class="self">Self </span><span class="kw">as </span>pallet_balances::Config>::Balance>;
|
||||
}</code></pre></div>
|
||||
<p>Notice how we use [<code>frame::pallet_macros::derive_impl</code>] to provide “default” configuration items
|
||||
for each pallet. Feel free to dive into the definition of each default prelude (eg.
|
||||
[<code>frame::prelude::frame_system::pallet::config_preludes</code>]) to learn more which types are exactly
|
||||
used.</p>
|
||||
<p>Recall that in test runtime in <a href="../your_first_pallet/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_pallet"><code>crate::guides::your_first_pallet</code></a>, we provided <code>type AccountId = u64</code> to <code>frame_system</code>, while in this case we rely on whatever is provided by
|
||||
<a href="struct@frame_system::pallet::config_preludes::SolochainDefaultConfig"><code>SolochainDefaultConfig</code></a>, which is indeed a “real” 32 byte account id.</p>
|
||||
<p>Then, a familiar instance of <code>construct_runtime</code> amalgamates all of the pallets:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="macro">construct_runtime!</span>(
|
||||
<span class="kw">pub struct </span>Runtime {
|
||||
<span class="comment">// Mandatory for all runtimes
|
||||
</span>System: frame_system,
|
||||
|
||||
<span class="comment">// A number of other pallets from FRAME.
|
||||
</span>Timestamp: pallet_timestamp,
|
||||
Balances: pallet_balances,
|
||||
Sudo: pallet_sudo,
|
||||
TransactionPayment: pallet_transaction_payment,
|
||||
|
||||
<span class="comment">// Our local pallet
|
||||
</span>FirstPallet: our_first_pallet,
|
||||
}
|
||||
);</code></pre></div>
|
||||
<p>Recall from <a href="../../reference_docs/wasm_meta_protocol/index.html" title="mod pezkuwi_sdk_docs::reference_docs::wasm_meta_protocol"><code>crate::reference_docs::wasm_meta_protocol</code></a> that every (real) runtime needs to
|
||||
implement a set of runtime APIs that will then let the node to communicate with it. The final
|
||||
steps of crafting a runtime are related to achieving exactly this.</p>
|
||||
<p>First, we define a number of types that eventually lead to the creation of an instance of
|
||||
[<code>frame::runtime::prelude::Executive</code>]. The executive is a handy FRAME utility that, through
|
||||
amalgamating all pallets and further types, implements some of the very very core pieces of the
|
||||
runtime logic, such as how blocks are executed and other runtime-api implementations.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">use super</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">type </span>SignedExtra = (
|
||||
<span class="comment">// `frame` already provides all the signed extensions from `frame-system`. We just add the
|
||||
// one related to tx-payment here.
|
||||
</span>frame::runtime::types_common::SystemTransactionExtensionsOf<Runtime>,
|
||||
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
|
||||
);
|
||||
|
||||
<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">type </span>Block = frame::runtime::types_common::BlockOf<Runtime, SignedExtra>;
|
||||
<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">type </span>Header = HeaderFor<Runtime>;
|
||||
|
||||
<span class="kw">pub</span>(<span class="kw">super</span>) <span class="kw">type </span>RuntimeExecutive = Executive<
|
||||
Runtime,
|
||||
Block,
|
||||
frame_system::ChainContext<Runtime>,
|
||||
Runtime,
|
||||
AllPalletsWithSystem,
|
||||
>;</code></pre></div>
|
||||
<p>Finally, we use [<code>frame::runtime::prelude::impl_runtime_apis</code>] to implement all of the runtime
|
||||
APIs that the runtime wishes to expose. As you will see in the code, most of these runtime API
|
||||
implementations are merely forwarding calls to <code>RuntimeExecutive</code> which handles the actual
|
||||
logic. Given that the implementation block is somewhat large, we won’t repeat it here. You can
|
||||
look for <code>impl_runtime_apis!</code> in [<code>first_runtime</code>].</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="macro">impl_runtime_apis!</span> {
|
||||
<span class="kw">impl </span>apis::Core<Block> <span class="kw">for </span>Runtime {
|
||||
<span class="kw">fn </span>version() -> RuntimeVersion {
|
||||
VERSION
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>execute_block(block: Block) {
|
||||
RuntimeExecutive::execute_block(block)
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>initialize_block(header: <span class="kw-2">&</span>Header) -> ExtrinsicInclusionMode {
|
||||
RuntimeExecutive::initialize_block(header)
|
||||
}
|
||||
}
|
||||
|
||||
<span class="comment">// many more trait impls...
|
||||
</span>}</code></pre></div>
|
||||
<p>And that more or less covers the details of how you would write a real runtime!</p>
|
||||
<p>Once you compile a crate that contains a runtime as above, simply running <code>cargo build</code> will
|
||||
generate the wasm blobs and place them under <code>./target/release/wbuild</code>, as explained
|
||||
<a href="../../pezkuwi_sdk/substrate/index.html#wasm-build" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::substrate">here</a>.</p>
|
||||
<h3 id="genesis-configuration"><a class="doc-anchor" href="#genesis-configuration">§</a>Genesis Configuration</h3>
|
||||
<p>Every runtime specifies a number of runtime APIs that help the outer world (most notably, a
|
||||
<code>node</code>) know what is the genesis state of this runtime. These APIs are then used to generate
|
||||
what is known as a <strong>Chain Specification, or chain spec for short</strong>. A chain spec is the
|
||||
primary way to run a new chain.</p>
|
||||
<p>These APIs are defined in [<code>sp_genesis_builder</code>], and are re-exposed as a part of
|
||||
[<code>frame::runtime::apis</code>]. Therefore, the implementation blocks can be found inside of
|
||||
<code>impl_runtime_apis!</code> similar to:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="macro">impl_runtime_apis!</span> {
|
||||
<span class="kw">impl </span>apis::GenesisBuilder<Block> <span class="kw">for </span>Runtime {
|
||||
<span class="kw">fn </span>build_state(config: Vec<u8>) -> GenesisBuilderResult {
|
||||
build_state::<RuntimeGenesisConfig>(config)
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>get_preset(id: <span class="kw-2">&</span><span class="prelude-ty">Option</span><PresetId>) -> <span class="prelude-ty">Option</span><Vec<u8>> {
|
||||
get_preset::<RuntimeGenesisConfig>(id, <span class="self">self</span>::genesis_config_presets::get_preset)
|
||||
}
|
||||
|
||||
<span class="kw">fn </span>preset_names() -> Vec<PresetId> {
|
||||
<span class="kw">crate</span>::genesis_config_presets::preset_names()
|
||||
}
|
||||
}
|
||||
|
||||
}</code></pre></div>
|
||||
<p>The implementation of these function can naturally vary from one runtime to the other, but the
|
||||
overall pattern is common. For the case of this runtime, we do the following:</p>
|
||||
<ol>
|
||||
<li>Expose one non-default preset, namely [<code>sp_genesis_builder::DEV_RUNTIME_PRESET</code>]. This means
|
||||
our runtime has two “presets” of genesis state in total: <code>DEV_RUNTIME_PRESET</code> and <code>None</code>.</li>
|
||||
</ol>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub fn </span>preset_names() -> Vec<PresetId> {
|
||||
<span class="macro">vec!</span>[PresetId::from(DEV_RUNTIME_PRESET)]
|
||||
}</code></pre></div>
|
||||
<p>For <code>build_state</code> and <code>get_preset</code>, we use the helper functions provide by frame:</p>
|
||||
<ul>
|
||||
<li>[<code>frame::runtime::prelude::build_state</code>] and [<code>frame::runtime::prelude::get_preset</code>].</li>
|
||||
</ul>
|
||||
<p>Indeed, our runtime needs to specify what its <code>DEV_RUNTIME_PRESET</code> genesis state should be like:</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub fn </span>development_config_genesis() -> Value {
|
||||
<span class="kw">let </span>endowment = <MinimumBalance <span class="kw">as </span>Get<Balance>>::get().max(<span class="number">1</span>) * <span class="number">1000</span>;
|
||||
<span class="macro">build_struct_json_patch!</span>(RuntimeGenesisConfig {
|
||||
balances: BalancesConfig {
|
||||
balances: Sr25519Keyring::iter()
|
||||
.map(|a| (a.to_account_id(), endowment))
|
||||
.collect::<Vec<<span class="kw">_</span>>>(),
|
||||
},
|
||||
sudo: SudoConfig { key: <span class="prelude-val">Some</span>(Sr25519Keyring::Alice.to_account_id()) },
|
||||
})
|
||||
}</code></pre></div>
|
||||
<p>For more in-depth information about <code>GenesisConfig</code>, <code>ChainSpec</code>, the <code>GenesisBuilder</code> API and
|
||||
<code>chain-spec-builder</code>, see <a href="../../reference_docs/chain_spec_genesis/index.html" title="mod pezkuwi_sdk_docs::reference_docs::chain_spec_genesis"><code>crate::reference_docs::chain_spec_genesis</code></a>.</p>
|
||||
<h3 id="next-step"><a class="doc-anchor" href="#next-step">§</a>Next Step</h3>
|
||||
<p>See <a href="../your_first_node/index.html" title="mod pezkuwi_sdk_docs::guides::your_first_node"><code>crate::guides::your_first_node</code></a>.</p>
|
||||
<h3 id="further-reading"><a class="doc-anchor" href="#further-reading">§</a>Further Reading</h3>
|
||||
<ol>
|
||||
<li>To learn more about signed extensions, see <a href="../../reference_docs/signed_extensions/index.html" title="mod pezkuwi_sdk_docs::reference_docs::signed_extensions"><code>crate::reference_docs::signed_extensions</code></a>.</li>
|
||||
<li><code>AllPalletsWithSystem</code> is also generated by <code>construct_runtime</code>, as explained in
|
||||
<a href="../../reference_docs/frame_runtime_types/index.html" title="mod pezkuwi_sdk_docs::reference_docs::frame_runtime_types"><code>crate::reference_docs::frame_runtime_types</code></a>.</li>
|
||||
<li><code>Executive</code> supports more generics, most notably allowing the runtime to configure more
|
||||
runtime migrations, as explained in
|
||||
<a href="../../reference_docs/frame_runtime_upgrades_and_migrations/index.html" title="mod pezkuwi_sdk_docs::reference_docs::frame_runtime_upgrades_and_migrations"><code>crate::reference_docs::frame_runtime_upgrades_and_migrations</code></a>.</li>
|
||||
<li>Learn more about adding and implementing runtime apis in
|
||||
<a href="../../reference_docs/custom_runtime_api_rpc/index.html" title="mod pezkuwi_sdk_docs::reference_docs::custom_runtime_api_rpc"><code>crate::reference_docs::custom_runtime_api_rpc</code></a>.</li>
|
||||
<li>To see a complete example of a runtime+pallet that is similar to this guide, please see
|
||||
<a href="../../pezkuwi_sdk/templates/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::templates"><code>crate::pezkuwi_sdk::templates</code></a>.</li>
|
||||
</ol>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {};
|
||||
@@ -1,67 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Pezkuwi SDK Docs"><title>pezkuwi_sdk_docs - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Crate pezkuwi_sdk_docs</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#pezkuwi-sdk-docs" title="Pezkuwi SDK Docs">Pezkuwi SDK Docs</a><ul><li><a href="#getting-started" title="Getting Started">Getting Started</a></li><li><a href="#information-architecture" title="Information Architecture">Information Architecture</a></li></ul></li></ul><h3><a href="#modules">Crate Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>pezkuwi_<wbr>sdk_<wbr>docs</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/pezkuwi_sdk_docs/lib.rs.html#1-50">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="pezkuwi-sdk-docs"><a class="doc-anchor" href="#pezkuwi-sdk-docs">§</a>Pezkuwi SDK Docs</h2>
|
||||
<p>The Pezkuwi SDK Developer Documentation.</p>
|
||||
<p>This crate is a <em>minimal</em>, <em>always-accurate</em> and low level source of truth about Pezkuwi-SDK.
|
||||
For more high level docs, please go to <a href="https://docs.pezkuwichain.io">docs.pezkuwi.com</a>.</p>
|
||||
<h3 id="getting-started"><a class="doc-anchor" href="#getting-started">§</a>Getting Started</h3>
|
||||
<p>We suggest the following reading sequence:</p>
|
||||
<ul>
|
||||
<li>Start by learning about <a href="pezkuwi_sdk/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk"><code>pezkuwi_sdk</code></a>, its structure and context.</li>
|
||||
<li>Then, head over to the <a href="guides/index.html" title="mod pezkuwi_sdk_docs::guides"><code>guides</code></a>. This modules contains in-depth guides about the most
|
||||
important user-journeys of the Pezkuwi SDK.
|
||||
<ul>
|
||||
<li>Whilst reading the guides, you might find back-links to <a href="reference_docs/index.html" title="mod pezkuwi_sdk_docs::reference_docs"><code>reference_docs</code></a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="external_resources/index.html" title="mod pezkuwi_sdk_docs::external_resources"><code>external_resources</code></a> for a list of 3rd party guides and tutorials.</li>
|
||||
<li>Finally, <a href="https://paritytech.github.io">https://paritytech.github.io</a> is the parent website of this crate that contains the
|
||||
list of further tools related to the Pezkuwi SDK.</li>
|
||||
</ul>
|
||||
<h3 id="information-architecture"><a class="doc-anchor" href="#information-architecture">§</a>Information Architecture</h3>
|
||||
<p>This section paints a picture over the high-level information architecture of this crate.</p>
|
||||
<pre class="mermaid" style="text-align:center;background: transparent;">
|
||||
flowchart TD
|
||||
dot[pezkuwichain.io] --> devhub[pezkuwi_sdk_docs]
|
||||
|
||||
devhub --> pezkuwi_sdk
|
||||
devhub --> reference_docs
|
||||
devhub --> guides
|
||||
devhub --> external_resources
|
||||
|
||||
pezkuwi_sdk --> substrate
|
||||
pezkuwi_sdk --> frame
|
||||
pezkuwi_sdk --> xcm
|
||||
pezkuwi_sdk --> templates
|
||||
|
||||
</pre><script src="https://cdn.jsdelivr.net/npm/mermaid@9.4.3/dist/mermaid.min.js"></script>
|
||||
<script>
|
||||
mermaid.initialize({
|
||||
startOnLoad: false,
|
||||
theme: 'dark',
|
||||
flowchart: { useMaxWidth: true, htmlLabels: true },
|
||||
suppressErrorRendering: true
|
||||
});
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
const elements = document.querySelectorAll('.mermaid');
|
||||
for (const el of elements) {
|
||||
const code = el.textContent;
|
||||
try {
|
||||
const { svg } = await mermaid.render('mermaid-' + Math.random().toString(36).substr(2, 9), code);
|
||||
el.innerHTML = svg;
|
||||
} catch (e) {
|
||||
// On error, show as styled code block
|
||||
el.style.fontFamily = 'monospace';
|
||||
el.style.whiteSpace = 'pre';
|
||||
el.style.background = '#1e293b';
|
||||
el.style.padding = '1rem';
|
||||
el.style.borderRadius = '8px';
|
||||
el.style.color = '#94a3b8';
|
||||
el.style.fontSize = '0.85rem';
|
||||
el.style.border = '1px solid #334155';
|
||||
}
|
||||
}
|
||||
});
|
||||
</script></div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="external_resources/index.html" title="mod pezkuwi_sdk_docs::external_resources">external_<wbr>resources</a></dt><dd>A list of external resources and learning material about Pezkuwi SDK.</dd><dt><a class="mod" href="guides/index.html" title="mod pezkuwi_sdk_docs::guides">guides</a></dt><dd>In-depth guides about the most common components of the Pezkuwi SDK. They are slightly more
|
||||
high level and broad than <a href="reference_docs/index.html" title="mod pezkuwi_sdk_docs::reference_docs"><code>reference_docs</code></a>.</dd><dt><a class="mod" href="meta_contributing/index.html" title="mod pezkuwi_sdk_docs::meta_contributing">meta_<wbr>contributing</a></dt><dd>Meta information about this crate, how it is built, what principles dictates its evolution and
|
||||
how one can contribute to it.</dd><dt><a class="mod" href="pezkuwi_sdk/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk">pezkuwi_<wbr>sdk</a></dt><dd>An introduction to the Pezkuwi SDK. Read this module to learn about the structure of the SDK,
|
||||
the tools that are provided as a part of it, and to gain a high level understanding of each.</dd><dt><a class="mod" href="reference_docs/index.html" title="mod pezkuwi_sdk_docs::reference_docs">reference_<wbr>docs</a></dt><dd>Reference documents covering in-depth topics across the Pezkuwi SDK. It is suggested to read
|
||||
these on-demand, while you are going through the <a href="guides/index.html" title="mod pezkuwi_sdk_docs::guides"><code>guides</code></a> or other content.</dd></dl><script type="text/json" id="notable-traits-data">{"&'static [u8]":"<h3>Notable traits for <code>&[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.91.1/std/primitive.u8.html\">u8</a>]</code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.91.1/std/io/trait.Read.html\" title=\"trait std::io::Read\">Read</a> for &[<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.91.1/std/primitive.u8.html\">u8</a>]</div>","Vec<u8>":"<h3>Notable traits for <code><a class=\"struct\" href=\"https://doc.rust-lang.org/1.91.1/alloc/vec/struct.Vec.html\" title=\"struct alloc::vec::Vec\">Vec</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.91.1/std/primitive.u8.html\">u8</a>, A></code></h3><pre><code><div class=\"where\">impl<A> <a class=\"trait\" href=\"https://doc.rust-lang.org/1.91.1/std/io/trait.Write.html\" title=\"trait std::io::Write\">Write</a> for <a class=\"struct\" href=\"https://doc.rust-lang.org/1.91.1/alloc/vec/struct.Vec.html\" title=\"struct alloc::vec::Vec\">Vec</a><<a class=\"primitive\" href=\"https://doc.rust-lang.org/1.91.1/std/primitive.u8.html\">u8</a>, A><div class=\"where\">where\n A: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.91.1/core/alloc/trait.Allocator.html\" title=\"trait core::alloc::Allocator\">Allocator</a>,</div></div>"}</script></section></div></main></body></html>
|
||||
@@ -1,127 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Meta information about this crate, how it is built, what principles dictates its evolution and how one can contribute to it."><title>pezkuwi_sdk_docs::meta_contributing - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module meta_contributing</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module meta_<wbr>contributing</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#contribution" title="Contribution">Contribution</a><ul><li><a href="#why-rust-docs" title="Why Rust Docs?">Why Rust Docs?</a></li><li><a href="#scope" title="Scope">Scope</a></li><li><a href="#principles" title="Principles">Principles</a></li><li><a href="#cratesio-and-publishing" title="`crates.io` and Publishing"><code>crates.io</code> and Publishing</a></li><li><a href="#versioning" title="Versioning">Versioning</a></li><li><a href="#how-to-develop-locally" title="How to Develop Locally">How to Develop Locally</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate pezkuwi_<wbr>sdk_<wbr>docs</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">pezkuwi_sdk_docs</a></div><h1>Module <span>meta_<wbr>contributing</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/pezkuwi_sdk_docs/meta_contributing.rs.html#1-151">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Meta information about this crate, how it is built, what principles dictates its evolution and
|
||||
how one can contribute to it.</p>
|
||||
<h2 id="contribution"><a class="doc-anchor" href="#contribution">§</a>Contribution</h2>
|
||||
<p>The following sections cover more detailed information about this crate and how it should be
|
||||
maintained.</p>
|
||||
<h3 id="why-rust-docs"><a class="doc-anchor" href="#why-rust-docs">§</a>Why Rust Docs?</h3>
|
||||
<p>We acknowledge that blockchain based systems, particularly a cutting-edge one like Pezkuwi SDK
|
||||
is a software artifact that is complex, and rapidly evolving. This makes the task of documenting
|
||||
it externally extremely difficult, especially with regards to making sure it is up-to-date.</p>
|
||||
<p>Consequently, we argue that the best hedge against this is to move as much of the documentation
|
||||
near the source code as possible. This would further incentivize developers to keep the
|
||||
documentation up-to-date, as the overhead is reduced by making sure everything is in one
|
||||
repository, and everything being in <code>.rs</code> files.</p>
|
||||
<blockquote>
|
||||
<p>This is not to say that a more visually appealing version of this crate (for example as an
|
||||
<code>md-book</code>) cannot exist, but it would be outside the scope of this crate.</p>
|
||||
</blockquote>
|
||||
<p>Moreover, we acknowledge that a major pain point has been not only outdated <em>concepts</em>, but also
|
||||
<em>outdated code</em>. For this, we commit to making sure no code-snippet in this crate is left as
|
||||
<code>///ignore</code> or <code>///no_compile</code>, making sure all code snippets are self-contained, compile-able,
|
||||
and correct at every single revision of the entire repository.</p>
|
||||
<blockquote>
|
||||
<p>This also allows us to have a clear versioning on the entire content of this crate. For every
|
||||
commit of the Pezkuwi SDK, there would be one version of this crate that is guaranteed to be
|
||||
correct.</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>To achieve this, we often use <a href="https://github.com/sam0x17/docify"><code>docify</code></a>, a nifty invention
|
||||
of <code>@sam0x17</code>.</p>
|
||||
</blockquote>
|
||||
<p>Also see: <a href="https://github.com/pezkuwichain/pezkuwi-sdk/issues/109">https://github.com/pezkuwichain/pezkuwi-sdk/issues/109</a>.</p>
|
||||
<h3 id="scope"><a class="doc-anchor" href="#scope">§</a>Scope</h3>
|
||||
<p>The above would NOT be attainable if we don’t acknowledge that the scope of this crate MUST be
|
||||
limited, or else its maintenance burden would be infeasible or not worthwhile. In short, future
|
||||
maintainers should always strive to keep the content of this repository as minimal as possible.
|
||||
Some of the following principles are specifically there to be the guidance for this.</p>
|
||||
<h3 id="principles"><a class="doc-anchor" href="#principles">§</a>Principles</h3>
|
||||
<p>The following guidelines are meant to be the guiding torch of those who contribute to this
|
||||
crate.</p>
|
||||
<ol>
|
||||
<li>🔺 Ground Up: Information should be laid out in the most ground-up fashion. The lowest level
|
||||
(i.e. “ground”) is Rust-docs. The highest level (i.e. “up”) is “outside of this crate”. In
|
||||
between lies <a href="../reference_docs/index.html" title="mod pezkuwi_sdk_docs::reference_docs"><code>reference_docs</code></a> and <a href="../guides/index.html" title="mod pezkuwi_sdk_docs::guides"><code>guides</code></a>, from low to high. The point of this principle
|
||||
is to document as much of the information as possible in the lower level media, as it is
|
||||
easier to maintain and more reachable. Then, use excessive linking to back-link when writing
|
||||
in a more high level.</li>
|
||||
</ol>
|
||||
<blockquote>
|
||||
<p>A prime example of this, the details of the FRAME storage APIs should NOT be explained in a
|
||||
high level tutorial. They should be explained in the rust-doc of the corresponding type or
|
||||
macro.</p>
|
||||
</blockquote>
|
||||
<ol start="2">
|
||||
<li>🧘 Less is More: For reasons mentioned <a href="#why-rust-docs">above</a>, the more concise this crate
|
||||
is, the better.</li>
|
||||
<li>√ Don’t Repeat Yourself – DRY: A summary of the above two points. Authors should always
|
||||
strive to avoid any duplicate information. Every concept should ideally be documented in
|
||||
<em>ONE</em> place and one place only. This makes the task of maintaining topics significantly
|
||||
easier.</li>
|
||||
</ol>
|
||||
<blockquote>
|
||||
<p>A prime example of this, the list of CLI arguments of a particular binary should not be
|
||||
documented in multiple places across this crate. It should be only be documented in the
|
||||
corresponding crate (e.g. <code>sc_cli</code>).</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>Moreover, this means that as a contributor, <strong>it is your responsibility to have a grasp over
|
||||
what topics are already covered in this crate, and how you can build on top of the information
|
||||
that they already pose, rather than repeating yourself</strong>.</p>
|
||||
</blockquote>
|
||||
<p>For more details see the <a href="https://github.com/pezkuwichain/pezkuwi-sdk/blob/master/docs/contributor/DOCUMENTATION_GUIDELINES.md">latest documenting
|
||||
guidelines</a>.</p>
|
||||
<h5 id="example-explaining-palletcall"><a class="doc-anchor" href="#example-explaining-palletcall">§</a>Example: Explaining <code>#[pallet::call]</code></h5><details>
|
||||
<summary>
|
||||
Let's consider the seemingly simple example of explaining to someone dead-simple code of a FRAME
|
||||
call and see how we can use the above principles.
|
||||
</summary>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attr">#[frame::pallet(dev_mode)]
|
||||
</span><span class="kw">pub mod </span>pallet {
|
||||
<span class="attr">#[pallet::call]
|
||||
</span><span class="kw">impl</span><T: Config> Pallet<T> {
|
||||
<span class="kw">pub fn </span>a_simple_call(origin: OriginFor<T>, data: u32) -> DispatchResult {
|
||||
<span class="macro">ensure!</span>(data > <span class="number">10</span>, <span class="string">"SomeStaticString"</span>);
|
||||
<span class="macro">todo!</span>();
|
||||
}
|
||||
}
|
||||
}</code></pre></div>
|
||||
<ul>
|
||||
<li>Before even getting started, what is with all of this <code><T: Config></code>? We link to
|
||||
<a href="../reference_docs/trait_based_programming/index.html" title="mod pezkuwi_sdk_docs::reference_docs::trait_based_programming"><code>crate::reference_docs::trait_based_programming</code></a>.</li>
|
||||
<li>First, the name. Why is this called <code>pallet::call</code>? This goes back to <code>enum Call</code>, which is
|
||||
explained in <a href="../reference_docs/frame_runtime_types/index.html" title="mod pezkuwi_sdk_docs::reference_docs::frame_runtime_types"><code>crate::reference_docs::frame_runtime_types</code></a>. Build on top of this!</li>
|
||||
<li>Then, what is <code>origin</code>? Just an account id? <a href="../reference_docs/frame_origin/index.html" title="mod pezkuwi_sdk_docs::reference_docs::frame_origin"><code>crate::reference_docs::frame_origin</code></a>.</li>
|
||||
<li>Then, what is <code>DispatchResult</code>? Why is this called <em>dispatch</em>? Probably something that can be
|
||||
explained in the documentation of [<code>frame::prelude::DispatchResult</code>].</li>
|
||||
<li>Why is <code>"SomeStaticString"</code> a valid error? Because there is implementation for it that you can
|
||||
see <a href="frame::prelude::DispatchError#impl-From%3C%26'static+str%3E-for-DispatchError">here</a>.</li>
|
||||
</ul>
|
||||
<p>All of these are examples of underlying information that a contributor should:</p>
|
||||
<ol>
|
||||
<li>Try and create and they are going along.</li>
|
||||
<li>Back-link to if they already exist.</li>
|
||||
</ol>
|
||||
<p>Of course, all of this is not set in stone as a either/or rule. Sometimes, it is necessary to
|
||||
rephrase a concept in a new context.</p>
|
||||
</details>
|
||||
<h3 id="cratesio-and-publishing"><a class="doc-anchor" href="#cratesio-and-publishing">§</a><code>crates.io</code> and Publishing</h3>
|
||||
<p>As it stands now, this crate cannot be published to crates.io because of its use of
|
||||
<a href="https://github.com/sam0x17/docify/issues/22">workspace-level <code>docify</code></a>. For now, we accept this
|
||||
compromise, but in the long term, we should work towards finding a way to maintain different
|
||||
revisions of this crate.</p>
|
||||
<h3 id="versioning"><a class="doc-anchor" href="#versioning">§</a>Versioning</h3>
|
||||
<p>So long as not deployed in <code>crates.io</code>, please notice that all of the information in this crate,
|
||||
namely in <a href="../guides/index.html" title="mod pezkuwi_sdk_docs::guides"><code>crate::guides</code></a> and such are compatible with the master branch of <code>pezkuwi-sdk</code>. A
|
||||
few solutions have been proposed to improve this, please see
|
||||
<a href="https://github.com/pezkuwichain/pezkuwi-sdk/issues/146">here</a>.</p>
|
||||
<h3 id="how-to-develop-locally"><a class="doc-anchor" href="#how-to-develop-locally">§</a>How to Develop Locally</h3>
|
||||
<p>To view the docs specific <a href="../index.html" title="mod pezkuwi_sdk_docs"><code>crate</code></a> locally for development, including the correct HTML headers
|
||||
injected, run:</p>
|
||||
<div class="example-wrap"><pre class="language-sh"><code>SKIP_WASM_BUILD=1 \
|
||||
RUSTDOCFLAGS="--html-in-header $(pwd)/docs/sdk/assets/header.html --extend-css $(pwd)/docs/sdk/assets/theme.css --default-theme=ayu" \
|
||||
cargo doc -p pezkuwi-sdk-docs --no-deps --open</code></pre></div>
|
||||
<p>If even faster build time for docs is needed, you can temporarily remove most of the
|
||||
substrate/cumulus dependencies that are only used for linking purposes.</p>
|
||||
<p>For more on local development, see <a href="../reference_docs/development_environment_advice/index.html" title="mod pezkuwi_sdk_docs::reference_docs::development_environment_advice"><code>crate::reference_docs::development_environment_advice</code></a>.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {};
|
||||
@@ -1,90 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Learn about Cumulus, the framework that transforms `substrate`-based chains into `pezkuwi`-enabled teyrchains."><title>pezkuwi_sdk_docs::pezkuwi_sdk::cumulus - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module cumulus</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module cumulus</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#cumulus" title="Cumulus">Cumulus</a><ul><li><a href="#example-runtime" title="Example: Runtime">Example: Runtime</a></li></ul></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>pezkuwi_<wbr>sdk</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../index.html">pezkuwi_sdk</a></div><h1>Module <span>cumulus</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/pezkuwi_sdk_docs/pezkuwi_sdk/cumulus.rs.html#1-130">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Learn about Cumulus, the framework that transforms <a href="../substrate/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::substrate"><code>substrate</code></a>-based chains into
|
||||
<a href="../pezkuwi/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::pezkuwi"><code>pezkuwi</code></a>-enabled teyrchains.</p>
|
||||
<h2 id="cumulus"><a class="doc-anchor" href="#cumulus">§</a>Cumulus</h2>
|
||||
<p>Substrate provides a framework (<a href="../frame_runtime/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime">FRAME</a>) through which a blockchain node and runtime can easily
|
||||
be created. Cumulus aims to extend the same approach to creation of Pezkuwi teyrchains.</p>
|
||||
<blockquote>
|
||||
<p>Cumulus clouds are shaped sort of like dots; together they form a system that is intricate,
|
||||
beautiful and functional.</p>
|
||||
</blockquote>
|
||||
<h3 id="example-runtime"><a class="doc-anchor" href="#example-runtime">§</a>Example: Runtime</h3>
|
||||
<p>A Cumulus-based runtime is fairly similar to other <a href="../frame_runtime/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime">FRAME</a>-based runtimes. Most notably, the
|
||||
following changes are applied to a normal FRAME-based runtime to make it a Cumulus-based
|
||||
runtime:</p>
|
||||
<h5 id="cumulus-pallets"><a class="doc-anchor" href="#cumulus-pallets">§</a>Cumulus Pallets</h5>
|
||||
<p>A teyrchain runtime should use a number of pallets that are provided by Cumulus and Substrate.
|
||||
Notably:</p>
|
||||
<ul>
|
||||
<li><a href="frame::prelude::frame_system"><code>frame-system</code></a>, like all FRAME-based runtimes.</li>
|
||||
<li>[<code>cumulus_pallet_teyrchain_system</code>]</li>
|
||||
<li>[<code>teyrchain_info</code>]</li>
|
||||
</ul>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">mod </span>system_pallets {
|
||||
<span class="kw">use super</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="attr">#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
|
||||
</span><span class="kw">impl </span>frame_system::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>Block = MockBlock<<span class="self">Self</span>>;
|
||||
<span class="kw">type </span>OnSetCode = cumulus_pallet_teyrchain_system::TeyrchainSetCode<<span class="self">Self</span>>;
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>cumulus_pallet_teyrchain_system::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>RuntimeEvent = RuntimeEvent;
|
||||
<span class="kw">type </span>OnSystemEvent = ();
|
||||
<span class="kw">type </span>SelfParaId = teyrchain_info::Pallet<Runtime>;
|
||||
<span class="kw">type </span>OutboundXcmpMessageSource = ();
|
||||
<span class="kw">type </span>XcmpMessageHandler = ();
|
||||
<span class="kw">type </span>ReservedDmpWeight = ();
|
||||
<span class="kw">type </span>ReservedXcmpWeight = ();
|
||||
<span class="kw">type </span>CheckAssociatedRelayNumber =
|
||||
cumulus_pallet_teyrchain_system::RelayNumberMonotonicallyIncreases;
|
||||
<span class="kw">type </span>ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<
|
||||
Runtime,
|
||||
<span class="number">6000</span>, <span class="comment">// relay chain block time
|
||||
</span><span class="number">1</span>,
|
||||
<span class="number">1</span>,
|
||||
>;
|
||||
<span class="kw">type </span>WeightInfo = ();
|
||||
<span class="kw">type </span>DmpQueue = frame::traits::EnqueueWithOrigin<(), sp_core::ConstU8<<span class="number">0</span>>>;
|
||||
<span class="kw">type </span>RelayParentOffset = ConstU32<<span class="number">0</span>>;
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>teyrchain_info::Config <span class="kw">for </span>Runtime {}
|
||||
}</code></pre></div>
|
||||
<p>Given that all Cumulus-based runtimes use a simple Aura-based consensus mechanism, the following
|
||||
pallets also need to be added:</p>
|
||||
<ul>
|
||||
<li>[<code>pallet_timestamp</code>]</li>
|
||||
<li>[<code>pallet_aura</code>]</li>
|
||||
<li>[<code>cumulus_pallet_aura_ext</code>]</li>
|
||||
</ul>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">mod </span>consensus_pallets {
|
||||
<span class="kw">use super</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="kw">impl </span>pallet_aura::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>AuthorityId = AuraId;
|
||||
<span class="kw">type </span>DisabledValidators = ();
|
||||
<span class="kw">type </span>MaxAuthorities = ConstU32<<span class="number">100_000</span>>;
|
||||
<span class="kw">type </span>AllowMultipleBlocksPerSlot = ConstBool<<span class="bool-val">false</span>>;
|
||||
<span class="kw">type </span>SlotDuration = pallet_aura::MinimumPeriodTimesTwo<<span class="self">Self</span>>;
|
||||
}
|
||||
|
||||
<span class="attr">#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)]
|
||||
</span><span class="kw">impl </span>pallet_timestamp::Config <span class="kw">for </span>Runtime {}
|
||||
|
||||
<span class="kw">impl </span>cumulus_pallet_aura_ext::Config <span class="kw">for </span>Runtime {}
|
||||
}</code></pre></div>
|
||||
<p>Finally, a separate macro, similar to
|
||||
<a href="frame::runtime::prelude::impl_runtime_apis"><code>impl_runtime_api</code></a>, which creates the default set
|
||||
of runtime APIs, will generate the teyrchain runtime’s validation runtime API, also known as
|
||||
teyrchain validation function (PVF). Without this API, the relay chain is unable to validate
|
||||
blocks produced by our teyrchain.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="macro">cumulus_pallet_teyrchain_system::register_validate_block!</span> {
|
||||
Runtime = Runtime,
|
||||
BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,
|
||||
}</code></pre></div>
|
||||
<hr />
|
||||
</div></details></section></div></main></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
window.SIDEBAR_ITEMS = {};
|
||||
@@ -1,185 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Learn about FRAME, the framework used to build Substrate runtimes."><title>pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module frame_runtime</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module frame_<wbr>runtime</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#frame" title="FRAME">FRAME</a><ul><li><a href="#introduction" title="Introduction">Introduction</a></li><li><a href="#pallets" title="Pallets">Pallets</a></li><li><a href="#runtime" title="Runtime">Runtime</a></li><li><a href="#more-examples" title="More Examples">More Examples</a></li><li><a href="#alternatives-" title="Alternatives 🌈">Alternatives 🌈</a></li></ul></li></ul><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>pezkuwi_<wbr>sdk</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../index.html">pezkuwi_sdk</a></div><h1>Module <span>frame_<wbr>runtime</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/pezkuwi_sdk_docs/pezkuwi_sdk/frame_runtime.rs.html#1-175">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Learn about FRAME, the framework used to build Substrate runtimes.</p>
|
||||
<h2 id="frame"><a class="doc-anchor" href="#frame">§</a>FRAME</h2><div class="example-wrap"><pre class="language-no_compile"><code> ______ ______ ________ ___ __ __ ______
|
||||
/_____/\ /_____/\ /_______/\ /__//_//_/\ /_____/\
|
||||
\::::_\/_\:::_ \ \ \::: _ \ \\::\| \| \ \\::::_\/_
|
||||
\:\/___/\\:(_) ) )_\::(_) \ \\:. \ \\:\/___/\
|
||||
\:::._\/ \: __ `\ \\:: __ \ \\:.\-/\ \ \\::___\/_
|
||||
\:\ \ \ \ `\ \ \\:.\ \ \ \\. \ \ \ \\:\____/\
|
||||
\_\/ \_\/ \_\/ \__\/\__\/ \__\/ \__\/ \_____\/</code></pre></div>
|
||||
<blockquote>
|
||||
<p><strong>F</strong>ramework for <strong>R</strong>untime <strong>A</strong>ggregation of <strong>M</strong>odularized <strong>E</strong>ntities: Substrate’s
|
||||
State Transition Function (Runtime) Framework.</p>
|
||||
</blockquote>
|
||||
<h3 id="introduction"><a class="doc-anchor" href="#introduction">§</a>Introduction</h3>
|
||||
<p>As described in <a href="../../reference_docs/wasm_meta_protocol/index.html" title="mod pezkuwi_sdk_docs::reference_docs::wasm_meta_protocol"><code>crate::reference_docs::wasm_meta_protocol</code></a>, at a high-level Substrate-based
|
||||
blockchains are composed of two parts:</p>
|
||||
<ol>
|
||||
<li>A <em>runtime</em> which represents the state transition function (i.e. “Business Logic”) of a
|
||||
blockchain, and is encoded as a WASM blob.</li>
|
||||
<li>A node whose primary purpose is to execute the given runtime.</li>
|
||||
</ol>
|
||||
<pre class="mermaid" style="text-align:center;background: transparent;">
|
||||
graph TB
|
||||
subgraph Substrate
|
||||
direction LR
|
||||
subgraph Node
|
||||
end
|
||||
subgraph Runtime
|
||||
end
|
||||
end
|
||||
|
||||
</pre><script src="https://cdn.jsdelivr.net/npm/mermaid@9.4.3/dist/mermaid.min.js"></script>
|
||||
<script>
|
||||
mermaid.initialize({
|
||||
startOnLoad: false,
|
||||
theme: 'dark',
|
||||
flowchart: { useMaxWidth: true, htmlLabels: true },
|
||||
suppressErrorRendering: true
|
||||
});
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
const elements = document.querySelectorAll('.mermaid');
|
||||
for (const el of elements) {
|
||||
const code = el.textContent;
|
||||
try {
|
||||
const { svg } = await mermaid.render('mermaid-' + Math.random().toString(36).substr(2, 9), code);
|
||||
el.innerHTML = svg;
|
||||
} catch (e) {
|
||||
// On error, show as styled code block
|
||||
el.style.fontFamily = 'monospace';
|
||||
el.style.whiteSpace = 'pre';
|
||||
el.style.background = '#1e293b';
|
||||
el.style.padding = '1rem';
|
||||
el.style.borderRadius = '8px';
|
||||
el.style.color = '#94a3b8';
|
||||
el.style.fontSize = '0.85rem';
|
||||
el.style.border = '1px solid #334155';
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<p><em>FRAME is the Substrate’s framework of choice to build a runtime.</em></p>
|
||||
<p>FRAME is composed of two major components, <strong>pallets</strong> and a <strong>runtime</strong>.</p>
|
||||
<h3 id="pallets"><a class="doc-anchor" href="#pallets">§</a>Pallets</h3>
|
||||
<p>A pallet is a unit of encapsulated logic. It has a clearly defined responsibility and can be
|
||||
linked to other pallets. In order to be reusable, pallets shipped with FRAME strive to only care
|
||||
about its own responsibilities and make as few assumptions about the general runtime as
|
||||
possible. A pallet is analogous to a <em>module</em> in the runtime.</p>
|
||||
<p>A pallet is defined as a <code>mod pallet</code> wrapped by the [<code>frame::pallet</code>] macro. Within this macro,
|
||||
pallet components/parts can be defined. Most notable of these parts are:</p>
|
||||
<ul>
|
||||
<li><a href="frame::pallet_macros::config">Config</a>, allowing a pallet to make itself configurable and
|
||||
generic over types, values and such.</li>
|
||||
<li><a href="frame::pallet_macros::storage">Storage</a>, allowing a pallet to define onchain storage.</li>
|
||||
<li><a href="frame::pallet_macros::call">Dispatchable function</a>, allowing a pallet to define extrinsics
|
||||
that are callable by end users, from the outer world.</li>
|
||||
<li><a href="frame::pallet_macros::event">Events</a>, allowing a pallet to emit events.</li>
|
||||
<li><a href="frame::pallet_macros::error">Errors</a>, allowing a pallet to emit well-formed errors.</li>
|
||||
</ul>
|
||||
<p>Some of these pallet components resemble the building blocks of a smart contract. While both
|
||||
models are programming state transition functions of blockchains, there are crucial differences
|
||||
between the two. See <a href="../../reference_docs/runtime_vs_smart_contract/index.html" title="mod pezkuwi_sdk_docs::reference_docs::runtime_vs_smart_contract"><code>crate::reference_docs::runtime_vs_smart_contract</code></a> for more.</p>
|
||||
<p>Most of these components are defined using macros, the full list of which can be found in
|
||||
[<code>frame::pallet_macros</code>].</p>
|
||||
<h4 id="example"><a class="doc-anchor" href="#example">§</a>Example</h4>
|
||||
<p>The following example showcases a minimal pallet.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="attr">#[frame::pallet(dev_mode)]
|
||||
</span><span class="kw">pub mod </span>pallet {
|
||||
<span class="kw">use </span>frame::prelude::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="doccomment">/// The configuration trait of a pallet. Mandatory. Allows a pallet to receive types at a
|
||||
/// later point from the runtime that wishes to contain it. It allows the pallet to be
|
||||
/// parameterized over both types and values.
|
||||
</span><span class="attr">#[pallet::config]
|
||||
</span><span class="kw">pub trait </span>Config: frame_system::Config {
|
||||
<span class="doccomment">/// A type that is not known now, but the runtime that will contain this pallet will
|
||||
/// know it later, therefore we define it here as an associated type.
|
||||
</span><span class="attr">#[allow(deprecated)]
|
||||
</span><span class="kw">type </span>RuntimeEvent: IsType<<<span class="self">Self </span><span class="kw">as </span>frame_system::Config>::RuntimeEvent> + From<Event<<span class="self">Self</span>>>;
|
||||
|
||||
<span class="doccomment">/// A parameterize-able value that we receive later via the `Get<_>` trait.
|
||||
</span><span class="kw">type </span>ValueParameter: Get<u32>;
|
||||
|
||||
<span class="doccomment">/// Similar to [`Config::ValueParameter`], but using `const`. Both are functionally
|
||||
/// equal, but offer different tradeoffs.
|
||||
</span><span class="kw">const </span>ANOTHER_VALUE_PARAMETER: u32;
|
||||
}
|
||||
|
||||
<span class="doccomment">/// A mandatory struct in each pallet. All functions callable by external users (aka.
|
||||
/// transactions) must be attached to this type (see [`frame::pallet_macros::call`]). For
|
||||
/// convenience, internal (private) functions can also be attached to this type.
|
||||
</span><span class="attr">#[pallet::pallet]
|
||||
</span><span class="kw">pub struct </span>Pallet<T>(PhantomData<T>);
|
||||
|
||||
<span class="doccomment">/// The events that this pallet can emit.
|
||||
</span><span class="attr">#[pallet::event]
|
||||
</span><span class="kw">pub enum </span>Event<T: Config> {}
|
||||
|
||||
<span class="doccomment">/// A storage item that this pallet contains. This will be part of the state root trie
|
||||
/// of the blockchain.
|
||||
</span><span class="attr">#[pallet::storage]
|
||||
</span><span class="kw">pub type </span>Value<T> = StorageValue<Value = u32>;
|
||||
|
||||
<span class="doccomment">/// All *dispatchable* call functions (aka. transactions) are attached to `Pallet` in a
|
||||
/// `impl` block.
|
||||
</span><span class="attr">#[pallet::call]
|
||||
</span><span class="kw">impl</span><T: Config> Pallet<T> {
|
||||
<span class="doccomment">/// This will be callable by external users, and has two u32s as a parameter.
|
||||
</span><span class="kw">pub fn </span>some_dispatchable(
|
||||
_origin: OriginFor<T>,
|
||||
_param: u32,
|
||||
_other_para: u32,
|
||||
) -> DispatchResult {
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}
|
||||
}
|
||||
}</code></pre></div><h3 id="runtime"><a class="doc-anchor" href="#runtime">§</a>Runtime</h3>
|
||||
<p>A runtime is a collection of pallets that are amalgamated together. Each pallet typically has
|
||||
some configurations (exposed as a <code>trait Config</code>) that needs to be <em>specified</em> in the runtime.
|
||||
This is done with [<code>frame::runtime::prelude::construct_runtime</code>].</p>
|
||||
<p>A (real) runtime that actually wishes to compile to WASM needs to also implement a set of
|
||||
runtime-apis. These implementation can be specified using the
|
||||
[<code>frame::runtime::prelude::impl_runtime_apis</code>] macro.</p>
|
||||
<h4 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h4>
|
||||
<p>The following example shows a (test) runtime that is composing the pallet demonstrated above,
|
||||
next to the [<code>frame::prelude::frame_system</code>] pallet, into a runtime.</p>
|
||||
|
||||
<div class="example-wrap ignore"><a href="#" class="tooltip" title="This example is not tested">ⓘ</a><pre class="rust rust-example-rendered"><code><span class="kw">pub mod </span>runtime {
|
||||
<span class="kw">use </span><span class="kw">super</span>::pallet <span class="kw">as </span>pallet_example;
|
||||
<span class="kw">use </span>frame::{prelude::<span class="kw-2">*</span>, testing_prelude::<span class="kw-2">*</span>};
|
||||
|
||||
<span class="comment">// The major macro that amalgamates pallets into `enum Runtime`
|
||||
</span><span class="macro">construct_runtime!</span>(
|
||||
<span class="kw">pub enum </span>Runtime {
|
||||
System: frame_system,
|
||||
Example: pallet_example,
|
||||
}
|
||||
);
|
||||
|
||||
<span class="comment">// These `impl` blocks specify the parameters of each pallet's `trait Config`.
|
||||
</span><span class="attr">#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
|
||||
</span><span class="kw">impl </span>frame_system::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>Block = MockBlock<<span class="self">Self</span>>;
|
||||
}
|
||||
|
||||
<span class="kw">impl </span>pallet_example::Config <span class="kw">for </span>Runtime {
|
||||
<span class="kw">type </span>RuntimeEvent = RuntimeEvent;
|
||||
<span class="kw">type </span>ValueParameter = ConstU32<<span class="number">42</span>>;
|
||||
<span class="kw">const </span>ANOTHER_VALUE_PARAMETER: u32 = <span class="number">42</span>;
|
||||
}
|
||||
}</code></pre></div><h3 id="more-examples"><a class="doc-anchor" href="#more-examples">§</a>More Examples</h3>
|
||||
<p>You can find more FRAME examples that revolve around specific features at [<code>pallet_examples</code>].</p>
|
||||
<h3 id="alternatives-"><a class="doc-anchor" href="#alternatives-">§</a>Alternatives 🌈</h3>
|
||||
<p>There is nothing in the Substrate’s node side code-base that mandates the use of FRAME. While
|
||||
FRAME makes it very simple to write Substrate-based runtimes, it is by no means intended to be
|
||||
the only one. At the end of the day, any WASM blob that exposes the right set of runtime APIs is
|
||||
a valid Runtime form the point of view of a Substrate client (see
|
||||
<a href="../../reference_docs/wasm_meta_protocol/index.html" title="mod pezkuwi_sdk_docs::reference_docs::wasm_meta_protocol"><code>crate::reference_docs::wasm_meta_protocol</code></a>). Notable examples are:</p>
|
||||
<ul>
|
||||
<li>writing a runtime in pure Rust, as done in <a href="https://github.com/JoshOrndorff/frameless-node-template">this template</a>.</li>
|
||||
<li>writing a runtime in AssemblyScript, as explored in <a href="https://github.com/LimeChain/subsembly">this project</a>.</li>
|
||||
</ul>
|
||||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="pallet/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime::pallet">pallet</a></dt><dd>The <code>pallet</code> module in each FRAME pallet hosts the most important items needed
|
||||
to construct this pallet.</dd><dt><a class="mod" href="runtime/index.html" title="mod pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime::runtime">runtime</a></dt><dd>A simple runtime that contains the above pallet and <code>frame_system</code>, the mandatory pallet of
|
||||
all runtimes. This runtime is for testing, but it shares a lot of similarities with a <em>real</em>
|
||||
runtime.</dd></dl></section></div></main></body></html>
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="This will be callable by external users, and has two u32s as a parameter."><title>some_dispatchable in pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime::pallet::dispatchables - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">some_dispatchable</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">some_<wbr>dispatchable</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#warning-doc-only" title="Warning: Doc-Only">Warning: Doc-Only</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>pezkuwi_<wbr>sdk::<wbr>frame_<wbr>runtime::<wbr>pallet::<wbr>dispatchables</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../index.html">pezkuwi_sdk</a>::<wbr><a href="../../index.html">frame_runtime</a>::<wbr><a href="../index.html">pallet</a>::<wbr><a href="index.html">dispatchables</a></div><h1>Function <span class="fn">some_<wbr>dispatchable</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../src/pezkuwi_sdk_docs/pezkuwi_sdk/frame_runtime.rs.html#96">Source</a> </span></div><pre class="rust item-decl"><code>pub fn some_dispatchable<T: <a class="trait" href="../trait.Config.html" title="trait pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime::pallet::Config">Config</a>>(_param: <a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.u32.html">u32</a>, _other_para: <a class="primitive" href="https://doc.rust-lang.org/1.91.1/std/primitive.u32.html">u32</a>)</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This will be callable by external users, and has two u32s as a parameter.</p>
|
||||
<h2 id="warning-doc-only"><a class="doc-anchor" href="#warning-doc-only">§</a>Warning: Doc-Only</h2>
|
||||
<p>This function is an automatically generated, and is doc-only, uncallable
|
||||
stub. See the real version in
|
||||
<a href="../struct.Pallet.html#method.some_dispatchable" title="associated function pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime::pallet::Pallet::some_dispatchable"><code>Pallet::some_dispatchable</code></a>.</p>
|
||||
</div></details></section></div></main></body></html>
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Auto-generated docs-only module listing all defined dispatchables for this pallet."><title>pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime::pallet::dispatchables - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../../../static.files/rustdoc-e56847b5.css"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="pezkuwi_sdk_docs" data-themes="" data-resource-suffix="" data-rustdoc-version="1.91.1 (ed61e7d7e 2025-11-07)" data-channel="1.91.1" data-search-js="search-e256b49e.js" data-stringdex-js="stringdex-c3e638e9.js" data-settings-js="settings-c38705f0.js" ><script src="../../../../../static.files/storage-e2aeef58.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../../../static.files/main-6dc2a7f3.js"></script><noscript><link rel="stylesheet" href="../../../../../static.files/noscript-263c88ec.css"></noscript><link rel="icon" href="https://pezkuwichain.io/favicon.ico"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module dispatchables</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../pezkuwi_sdk_docs/index.html">pezkuwi_<wbr>sdk_<wbr>docs</a><span class="version">0.0.1</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module dispatchables</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#warning-doc-only" title="Warning: Doc-Only">Warning: Doc-Only</a></li></ul><h3><a href="#functions">Module Items</a></h3><ul class="block"><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In pezkuwi_<wbr>sdk_<wbr>docs::<wbr>pezkuwi_<wbr>sdk::<wbr>frame_<wbr>runtime::<wbr>pallet</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../../../index.html">pezkuwi_sdk_docs</a>::<wbr><a href="../../../index.html">pezkuwi_sdk</a>::<wbr><a href="../../index.html">frame_runtime</a>::<wbr><a href="../index.html">pallet</a></div><h1>Module <span>dispatchables</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../../../src/pezkuwi_sdk_docs/pezkuwi_sdk/frame_runtime.rs.html#96">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Auto-generated docs-only module listing all defined dispatchables for this pallet.</p>
|
||||
<h2 id="warning-doc-only"><a class="doc-anchor" href="#warning-doc-only">§</a>Warning: Doc-Only</h2>
|
||||
<p>Members of this module cannot be used directly and are only provided for documentation
|
||||
purposes. To see the real version of each dispatchable, look for them in <a href="../struct.Pallet.html" title="struct pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime::pallet::Pallet"><code>Pallet</code></a> or
|
||||
<a href="../enum.Call.html" title="enum pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime::pallet::Call"><code>Call</code></a>.</p>
|
||||
</div></details><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.some_dispatchable.html" title="fn pezkuwi_sdk_docs::pezkuwi_sdk::frame_runtime::pallet::dispatchables::some_dispatchable">some_<wbr>dispatchable</a></dt><dd>This will be callable by external users, and has two u32s as a parameter.</dd></dl></section></div></main></body></html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user