Taking the best of Substrate Recipes and applying them to a new framework for structuring a collection of how-to guides.

Overview

Attention: This repository has been archived and is no longer being maintained. It has been replaced by the Substrate How-to Guides. Please use the Substrate docs repository to submit PRs and issues for new or existing guides.

Substrate how-to guides

Creating new content for the Subsrate developer hub and taking the best of Substrate Recipes and applying them to a new framework for structuring a collection of "how-to guides".

The latest website can be found here.

Generate the site locally

From this directory:

yarn install
yarn start

Plugins

Components

Comments
  • Substrate kitties tutorial issues

    Substrate kitties tutorial issues

    I'm either missing something really fundamental here or there are some missing instructions for turning the pallet template into an empty kitties pallet.

    1. Basic set-up
      • under Getting started with the node template
        • Might be worth adding "all instances of node-template and node-template-runtime in /node/Cargo.toml under features, bin, package, and dependencies should be renamed"; instructions are vague and might suggest not renaming under deps or benchmarks.
      • under Creating and integrating pallet_kitties
        • Should we copy the "most bare-bones version" pallet code into pallets/kitties/src/lib.rs? If so, we should state that. So far, it only describes what a bare-bones pallet looks like but then doesn't use it to explain anything.
        • instructing to rename pallets/template to pallet/kitties breaks everything related to pallet_template in runtime/src/lib.rs:
          • this includes the import, config impl, TemplateModule reference, benchmarks at the bottom, so instructions handling that should be included
        • include instructions to rename pallets/template to pallets/kitties in /Cargo.toml.
        • Fix all references to pallet_template in runtime/src/lib.rs. There are several, and they don't exist anymore
        • it says the the pallets/kitties/Cargo.toml file should be modified, but it does not say what needs to be modified
          • include instructions of "rename pallet-template to pallet-kitties"
          • in runtime/Cargo.toml include instructions to rename every instance of
            • pallet-template to pallet-kitties
            • ../pallets/template to ../pallets/kitties
          • in runtime/src/lib.rs rename pallet_template to pallet_kitties
        • impl pallet_kitties::Config for Runtime {} implements an empty config for runtime, but it is never included in construct_runtime!
    opened by jakehemmerle 20
  • Build errors in mint-token pallet

    Build errors in mint-token pallet

    Hi there,

    Trying to set up this pallet, but I get the following errors.

    token-error

    Is something missing from the storage declaration below?

    /// Storage item for balances to accounts mapping. #[pallet::storage] #[pallet::getter(fn get_balance)] pub(super) type BalanceToAccount<T: Config> = StorageMap< _, Blake2_128Concat, T::AccountId, T::Balance, ValueQuery >;

    opened by anaelleltd 7
  • Kitties tutorial not compiling

    Kitties tutorial not compiling

     cargo +nightly build --release
    

    results in:

       Compiling futures-executor v0.3.16
    error[E0034]: multiple applicable items in scope
       --> /home/rafael/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-derive-0.7.0/src/lib.rs:109:14
        |
    109 |             .intersperse(quote!(|));
        |              ^^^^^^^^^^^ multiple `intersperse` found
        |
        = note: candidate #1 is defined in an impl of the trait `Iterator` for the type `Map<I, F>`
        = note: candidate #2 is defined in an impl of the trait `Itertools` for the type `T`
    

    On my environment, which I would say is very recent:

    Default host: x86_64-unknown-linux-gnu
    rustup home:  /home/rafael/.rustup
    
    installed toolchains
    --------------------
    
    stable-x86_64-unknown-linux-gnu (default)
    nightly-x86_64-unknown-linux-gnu
    
    active toolchain
    ----------------
    
    stable-x86_64-unknown-linux-gnu (default)
    rustc 1.55.0 (c8dfcfe04 2021-09-06)
    

    Also, coming from many other different languages I find it surprising the +nightly pervasive usage. Removing it makes compilation work in my particular environment.

    opened by rvalle 6
  • I need help, stack at the very beginning

    I need help, stack at the very beginning

    Who is in charge of some projects? Can you support it? I follow the tutorial and can't understand it at all. The subject node template I saw has been updated to monthly-2021-07 release by Jimmy Chu. I can't compile in step 3 of part I: basic setup

    As I copy over the bare-bones of the pallet into kitties/src/lib.rs, it can't be build or check directly, the compiler said SubstrateKitties does not have defined, and the full error is as followed:

    Compiling kitties-runtime v3.0.0 (/Users/xiongzhend/Documents/RustProj/my-substratekitties/runtime) warning: unused import:frame_support::pallet_prelude::*--> pallets/kitties/src/lib.rs:11:6 | 11 | use frame_support::pallet_prelude::*; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note:#[warn(unused_imports)]` on by default

    warning: unused import: frame_system::pallet_prelude::* --> pallets/kitties/src/lib.rs:12:6 | 12 | use frame_system::pallet_prelude::*; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    warning: 2 warnings emitted

    Checking frame-benchmarking-cli v3.0.0 (https://github.com/paritytech/substrate.git?tag=monthly-2021-07#83808aa8)
    

    error: failed to run custom build command for kitties-runtime v3.0.0 (/Users/xiongzhend/Documents/RustProj/my-substratekitties/runtime)

    Caused by: process didn't exit successfully: /Users/xiongzhend/Documents/RustProj/my-substratekitties/target/debug/build/kitties-runtime-3959c83639dd6822/build-script-build (exit status: 1) --- stdout Information that should be included in a bug report. Executing build command: "/Users/xiongzhend/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/Users/xiongzhend/Documents/RustProj/my-substratekitties/target/debug/wbuild/kitties-runtime/Cargo.toml" "--color=always" "--release" Using rustc version: rustc 1.55.0-nightly (b1f8e27b7 2021-07-15)

    --- stderr warning: unused import: frame_support::pallet_prelude::* --> /Users/xiongzhend/Documents/RustProj/my-substratekitties/pallets/kitties/src/lib.rs:11:6 | 11 | use frame_support::pallet_prelude::*; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: #[warn(unused_imports)] on by default

    warning: unused import: frame_system::pallet_prelude::* --> /Users/xiongzhend/Documents/RustProj/my-substratekitties/pallets/kitties/src/lib.rs:12:6 | 12 | use frame_system::pallet_prelude::*; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    warning: 2 warnings emitted

     Compiling kitties-runtime v3.0.0 (/Users/xiongzhend/Documents/RustProj/my-substratekitties/runtime)
    

    error: SubstrateKitties does not have #[pallet::genesis_config] defined, perhaps you should remove Config from construct_runtime? --> /Users/xiongzhend/Documents/RustProj/my-substratekitties/runtime/src/lib.rs:276:1 | 276 | / construct_runtime!( 277 | | pub enum Runtime where 278 | | Block = Block, 279 | | NodeBlock = opaque::Block, ... | 292 | | } 293 | | ); | |__^ | = note: this error originates in the macro pallet_kitties::__substrate_genesis_config_check::is_genesis_config_defined (in Nightly builds, run with -Z macro-backtrace for more info)

    error: could not compile kitties-runtime due to previous error`

    opened by xiongzhend 4
  • Updated required functions in staking pallet

    Updated required functions in staking pallet

    I look for some more or less working example of staking pallet and found the example and I have found not updated documentation.

    Here is the source of new functions.

    opened by TomaszWaszczyk 4
  • Dep update, attempting to build locally

    Dep update, attempting to build locally

    Trying to use the latest stable node, npm

    nvm use stable
    Now using node v14.13.0 (npm v7.24.0)
    

    Updating packages, removing unused ones, start at modifying to get the build working. I am stuck here, and would love some support to get this working and merge-able :pray:

    opened by NukeManDan 3
  • Script to customize Node Template

    Script to customize Node Template

    Having a script that sets a template node up in a single command would speed things up for new comers. This would alleviate potential issues as raised in #36.

    It would take away a large chunk of what's in Kitties Part I for example, resulting in a more rewarding experience.

    help wanted tutorial 
    opened by sacha-l 3
  • Make keyword tags visible and searchable

    Make keyword tags visible and searchable

    1. Right now the "tags" are in the form of keywords in the metadata of each guide. Working on a solution to have them displayed as a component under each heading. Possibly an MDX thing.
    2. In tandem, modify search functionality to display content by tags.
    feature 
    opened by sacha-l 3
  • Unable to build the template-node

    Unable to build the template-node

    Hello! I'm trying to build the template-node (main branch)

    $ cargo run --release
    
    error: failed to download `parity-db v0.2.3`
    
    Caused by:
      unable to get packages from source
    
    Caused by:
      failed to parse manifest at `/home/vyorkin/.cargo/registry/src/github.com-1ecc6299db9ec823/parity-db-0.2.3/Cargo.toml`
    
    Caused by:
      failed to parse the version requirement `0.11 ` for dependency `parking_lot`
    
    Caused by:
      expected comma after minor version number, found '\t'
    

    If I remove the Cargo.lock then it is unable to resolve a version for snow crate:

    $ cargo run --release -- --dev --tmp
    
        Updating crates.io index
    error: failed to select a version for `snow`.
        ... required by package `libp2p-noise v0.29.0`
        ... which is depended on by `libp2p v0.34.0`
        ... which is depended on by `sc-cli v0.9.0`
        ... which is depended on by `frame-benchmarking-cli v3.0.0`
        ... which is depended on by `node-template v3.0.0 (/home/vyorkin/projects/play/rust/substrate/how-to-guides/example-code/template-node/node)`
    versions that meet the requirements `^0.7.1` are: 0.7.2, 0.7.1
    
    all possible versions conflict with previously selected packages.
    
      previously selected package `snow v0.7.1`
        ... which is depended on by `libp2p-noise v0.29.0`
        ... which is depended on by `libp2p v0.34.0`
        ... which is depended on by `sc-cli v0.9.0`
        ... which is depended on by `frame-benchmarking-cli v3.0.0`
        ... which is depended on by `node-template v3.0.0 (/home/vyorkin/projects/play/rust/substrate/how-to-guides/example-code/template-node/node)`
    
    failed to select a version for `snow` which could resolve this conflict
    

    My rustup show output:

    Default host: x86_64-unknown-linux-gnu
    rustup home:  /home/vyorkin/.rustup
    
    installed toolchains
    --------------------
    
    stable-x86_64-unknown-linux-gnu (default)
    nightly-2020-10-25-x86_64-unknown-linux-gnu
    nightly-2021-01-25-x86_64-unknown-linux-gnu
    nightly-2021-01-26-x86_64-unknown-linux-gnu
    nightly-2021-03-15-x86_64-unknown-linux-gnu
    nightly-2021-05-20-x86_64-unknown-linux-gnu
    nightly-2021-06-01-x86_64-unknown-linux-gnu
    nightly-2021-06-17-x86_64-unknown-linux-gnu
    nightly-2021-06-29-x86_64-unknown-linux-gnu
    nightly-x86_64-unknown-linux-gnu
    1.34.1-x86_64-unknown-linux-gnu
    1.48.0-x86_64-unknown-linux-gnu
    1.50.0-x86_64-unknown-linux-gnu
    1.51.0-x86_64-unknown-linux-gnu
    
    active toolchain
    ----------------
    
    stable-x86_64-unknown-linux-gnu (default)
    rustc 1.55.0 (c8dfcfe04 2021-09-06)
    

    EDIT 1:

    Updating parity-db from 0.2.3 to 0.2.4 helps. https://github.com/paritytech/substrate/issues/8161#issuecomment-895695913

    But I got another error related to pallet_kitties:

      error[E0437]: type `Randomness` is not a member of trait `pallet_kitties::Config`
         --> /home/vyorkin/projects/play/rust/substrate/how-to-guides/example-code/template-node/runtime/src/lib.rs:296:2
          |
      296 |     type Randomness = RandomnessCollectiveFlip;
          |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a member of trait `pallet_kitties::Config`
    
      error[E0046]: not all trait items implemented, missing: `KittyRandomness`
         --> /home/vyorkin/projects/play/rust/substrate/how-to-guides/example-code/template-node/runtime/src/lib.rs:294:1
          |
      294 | impl pallet_kitties::Config for Runtime {
          | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `KittyRandomness` in implementation
          |
          = help: implement the missing item: `type KittyRandomness = Type;`
    

    Possibly related to #36

    opened by vyorkin 2
  • About Enterprise Sample tutorial

    About Enterprise Sample tutorial

    Hi, I'm working on a new small project that looks like part of Entreprise Sample. I find this WIP enterprise tutorial branch aims to render in v2 frame.

    Maybe I can help with this tutorial during my coding. my project needs several pallets like DID, registrar and rbac. I'm planning to start by adapting them to the new v2 frame. Do you have any suggestions for me to do this? Thx.

    opened by saintfeng 2
  • Integrate kickstart

    Integrate kickstart

    Use kickstart to easily create how-to guides from the CLI.

    E.g:

    • Title?
    • Goal?
    • Use cases?
    • Overview?
    • Steps?

    Note: this is a future feature, kickstart is a cool tool but still has a few bugs.

    feature 
    opened by sacha-l 2
  • New Guides ✨

    New Guides ✨

    Adding some new guides:

    • [x] Simple origin guide: how to assign accountId to a custom origin
    • [ ] Multiple origins: create a custom origin to handle multiple origin types
    opened by sacha-l 1
Owner
Substrate Developer Hub
Documentation, samples, and tutorials for the Substrate framework for building blockchains.
Substrate Developer Hub
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

HoangDuong 1 Oct 19, 2021
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

HoangDuong 1 Oct 19, 2021
Substrate blockchain generated with Substrate Startkit

Substrate Node Template A new FRAME-based Substrate node, ready for hacking ?? Getting Started This project contains some configuration files to help

Liam Parry 0 Nov 6, 2021
Recipes - A Hands-On Cookbook for Aspiring Blockchain Chefs

Substrate Recipes ?? ?? ?? A Hands-On Cookbook for Aspiring Blockchain Chefs Get Started Ready to roll up your sleeves and cook some blockchain? Read

Joshy Orndorff 335 Dec 20, 2022
Notabena, the pure Rust open-source note-taking app.

Notabena About Notabena is the free and open source note-taking app, written in pure Rust. Features These are our current planned features. (Most feat

Mart Zielman 7 Jun 22, 2023
Open-source tool to enforce privacy & security best-practices on Windows and macOS, because privacy is sexy 🍑🍆

privacy-sexy Open-source tool to enforce privacy & security best-practices on Windows and MacOs, because privacy is sexy ?? ?? privacy-sexy is a data-

Subconscious Compute 3 Oct 20, 2022
Node implementation for aleph blockchain built with Substrate framework

This repository contains the Rust implementation of Aleph Zero blockchain node based on the Substrate framework. Aleph Zero is an open-source layer 1

Aleph Zero Foundation 55 Dec 15, 2022
Implementation of Proof of Existence consensus using Substrate Framework, Frame, Pallets, RUST

Substrate Node Template A fresh FRAME-based Substrate node, ready for hacking ?? Getting Started Follow the steps below to get started with the Node T

Vijayendra Gaur 1 Jun 8, 2022
Polkadex - An Orderbook-based Decentralized Exchange using the Substrate Blockchain Framework.

What is Polkadex? ?? Polkadex is a Open Source, Decentralized Exchange Platform made using Substrate Blockchain Framework that provides traders with t

Polkadex 243 Dec 16, 2022
A rewriting of Duniter based on Substrate framework

Duniter v2s A rewriting of Duniter based on Substrate framework. duniter-v2s is under active development, only a test network called "ĞDev" is deploye

Duniter 9 Dec 15, 2022
The best place to start if you want to use Triton VM.

Triton VM Scaffold If you want to try out and tinker with Triton VM, this repository is a great place to start. The main function defines a program in

Triton VM 4 Apr 24, 2023
Open Protocol Indexer, OPI, is the best-in-slot open-source indexing client for meta-protocols on Bitcoin.

OPI - Open Protocol Indexer Open Protocol Indexer, OPI, is the best-in-slot open-source indexing client for meta-protocols on Bitcoin. OPI uses a fork

Best in Slot 33 Dec 16, 2023
A brand-new multi-scenarios smart contract compiler framework

The Smart Intermediate Representation The Smart Intermediate Representation(short for IR) project is a new compiler framework intended for smart contr

AntChainOpenLabs 62 Jan 2, 2024
CosmWasm-Examples is a collection of example contracts and applications built using the CosmWasm framework

CosmWasm-Examples is a collection of example contracts and applications built using the CosmWasm framework. CosmWasm is a secure and efficient smart contract platform designed specifically for the Cosmos ecosystem.

Vitalii Tsyhulov 20 Jun 9, 2023
Selendra is a multichains interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications.

Selendra An interoperable nominated Proof-of-Stake network for developing and running Substrate-based and EVM compatible blockchain applications. Read

Selendra 16 Nov 29, 2022
An Ethereum compatible Substrate blockchain for bounties and governance for the Devcash community.

Substrate Node Template A fresh FRAME-based Substrate node, ready for hacking ?? Getting Started Follow the steps below to get started with the Node T

null 4 Mar 30, 2022
Faterium Substrate Node, Runtime, and Pallets. Contains "faterium-polls-pallet" with logic of Faterium Polls.

Faterium Substrate Node Faterium - a place where fates are forged. This is the official implementation of Faterium Crowdfunding Polls in Rust as Subst

Faterium 3 Dec 15, 2022
ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot network.

ARYA Network ARYA Network is a polkadot/substrate based chain for Non-fungible Token platform on which we can own sell and buy the NFT's on polkadot n

Pankaj Chaudhary 6 Dec 20, 2022
Substrate: The platform for blockchain innovators

Substrate · Substrate is a next-generation framework for blockchain innovation ?? . Trying it out Simply go to substrate.dev and follow the installati

Parity Technologies 7.7k Dec 30, 2022