Skip to content
No description, website, or topics provided.
Rust Shell
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example/substrate-node-template
src Update validate_unsigned Nov 26, 2019
.gitattributes Initial commit Nov 26, 2019
.gitignore Initial commit Nov 26, 2019
Cargo.lock Fix test environment Nov 26, 2019
Cargo.toml Fix test environment Nov 26, 2019
HOWTO.md Initial commit Nov 26, 2019
LICENSE Initial commit Nov 26, 2019
README.md Initial commit Nov 26, 2019

README.md

substrate-module-template

This is a template for a Substrate runtime module which lives as its own crate so it can be imported into multiple other runtimes. It is based on the "template" module which is included with the Substrate node template.

Check out the HOWTO to learn how to use this for your own runtime module.

This README should act as a general template for distributing your module to others.

Purpose

This module acts as a template for building other runtime modules.

It currently allows a user to put a u32 value into storage, which triggers a runtime event.

Dependencies

Traits

This module does not depend on any externally defined traits.

Modules

This module does not depend on any other SRML or externally developed modules.

Installation

Runtime Cargo.toml

To add this module to your runtime, simply include the following to your runtime's Cargo.toml file:

[dependencies.substrate-module-template]
default_features = false
git = 'https://github.com/substrate-developer-hub/substrate-module-template.git'

and update your runtime's std feature to include this module:

std = [
    ...
    'example_module/std',
]

Runtime lib.rs

You should implement it's trait like so:

/// Used for the module test_module
impl substrate_module_template::Trait for Runtime {
	type Event = Event;
}

and include it in your construct_runtime! macro:

ExampleModule: substrate_module_template::{Module, Call, Storage, Event<T>},

Genesis Configuration

This template module does not have any genesis configuration.

Reference Docs

You can view the reference docs for this module by running:

cargo doc --open

or by visiting this site:

You can’t perform that action at this time.