Giter Club home page Giter Club logo

substrate-package's Introduction

Substrate Package

A stable, known working version of the Substrate Node Template, Substrate Module Template, and Substrate Front End Template.

What is this?

  • The fastest way to get started building on Substrate.
  • Compatible with the latest documentation available for Substrate runtime module development.
  • Using Substrate commit: d1cd01c74e8d5550396cb654f9a3f1b641efdf4c
  • Using Polkadot-JS API version: ^0.95.0-beta.21

How to use it:

  • Run git clone https://github.com/substrate-developer-hub/substrate-package.git.

  • Run cd substrate-package.

  • Run curl https://getsubstrate.io -sSf | bash -s -- --fast

    • This installs external dependencies needed for substrate. Take a look at the script.
    • The --fast command allows us to skip the cargo install steps for substrate and subkey, which is not needed for runtime development.
    • Windows users need to follow instructions here instead
  • Go into the substrate-node-template folder and run:

    ./scripts/init.sh
    cargo build --release
    ./target/release/node-template --dev

    The above process may take 30 minuites or so, depending on your hardware. This should start your node, and you should see blocks being created.

  • Go into the substrate-front-end-template folder and run:

    yarn install
    yarn start

    This should start a web server on localhost:3000 where you can interact with your node.

  • Go into the substrate-module-template folder:

    • Read HOWTO.md
    • Edit /src/lib.rs to create a custom Substrate runtime module
    • Add dependencies to Cargo.toml with the appropriate rev
  • Interact with your node and hack away!

What is the Substrate Module Template?

The substrate-module-template is a template where you can start building your own runtime module as it's own independent crate.

This is an alternative from writing your module in substrate-node-template/runtime/src/template.rs, where you would not be able to easily share your runtime module after your are done. We recommend development in the substrate-module-template if you want to allow others to include your runtime module into their Substrate node.

Instructions for using the substrate-module-template are included with the project.

We have added the Substrate module template as a dependency to the substrate-node-template, but if you want to remove it, you will need to:

  1. Remove references from the runtime Cargo.toml file.
  2. Remove references from the runtime lib.rs file.

How was it made?

This project simply clones the individual templates in a single place where they are tested to be compatible with one another.

git clone https://github.com/substrate-developer-hub/substrate-node-template
git clone https://github.com/substrate-developer-hub/substrate-module-template
git clone https://github.com/substrate-developer-hub/substrate-front-end-template

Why do I need substrate-package?

Substrate is a rapidly evolving platform, which means that breaking changes may occur on a day to day basis. Most of the times, these breaking changes do not radically change how substrate works, but may affect how Substrate is organized, the name of functions, the name of modules, etc...

The substrate-package repository tries to help solve these problems by taking a snapshot of substrate when it is known to be working and compatible with these different resources:

  • Documentation
  • Tutorials
  • Samples
  • User Interfaces
  • etc...

substrate-package's People

Contributors

bddap avatar jamesray1 avatar jimmychu0807 avatar joshorndorff avatar ltfschoen avatar nikvolf avatar shawntabrizi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

substrate-package's Issues

Should package incude subkey?

I started revising the private network tutorial for Substrate v2.0. Specifically I wanted to write against Substrate Package v1.5.0 which I cut today and is a pre-v2.0 . One of the first things users have to do is generate their own keys using subkey, and I didn't know how to write against package.

yarn install throws build error on blake2js

yarn install v1.16.0
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
[3/4] ๐Ÿ”—  Linking dependencies...
warning " > @polkadot/[email protected]" has unmet peer dependency "@polkadot/util@*".
[4/4] ๐Ÿ”จ  Building fresh packages...
[-/4] โ  waiting...
[2/4] โ  blake2js
[-/4] โ  waiting...
error /Users/arikan/Sites/substrate-artistcollections/artistcollections-ui/node_modules/blake2js: Command failed.
Exit code: 1
...
25 warnings and 1 error generated.
make: *** [Release/obj.target/addon/src/blake2.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node/12.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Darwin 17.2.0
gyp ERR! command "/usr/local/Cellar/node/12.1.0/bin/node" "/usr/local/Cellar/node/12.1.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/arikan/Sites/substrate-artistcollections/artistcollections-ui/node_modules/blake2js
gyp ERR! node -v v12.1.0

dependency: hex-literal fails to build

cd substrate-node-template
./scripts/build.sh

results in

error: proc-macro derive panicked
  --> /Users/a/.cargo/registry/src/github.com-1ecc6299db9ec823/hex-literal-0.1.3/src/lib.rs:38:1
   |
38 | / proc_macro_expr_decl! {
39 | |     /// Macro for converting hex string to byte array at compile time
40 | |     hex! => hex_impl
41 | | }
   | |_^
   |
   = help: message: assertion failed: `(left == right)`
             left: `Some("#[allow(unused,")`,
            right: `Some("#[allow(unused")`
   = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

Following README instructions doesn't work

โžœ  ~ curl https://getsubstrate.io -sSf | bash -s -- --fast
Arch Linux detected.
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
warning: cmake-3.14.3-1 is up to date -- reinstalling
warning: gcc-8.3.0-1 is up to date -- reinstalling
warning: openssl-1.0-1.0.2.r-1 is up to date -- reinstalling
warning: pkgconf-1.6.1-1 is up to date -- reinstalling
warning: git-2.21.0-1 is up to date -- reinstalling
warning: clang-8.0.0-3 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (6) clang-8.0.0-3  cmake-3.14.3-1  gcc-8.3.0-1  git-2.21.0-1  openssl-1.0-1.0.2.r-1  pkgconf-1.6.1-1

Total Installed Size:  297.18 MiB
Net Upgrade Size:        0.00 MiB

:: Proceed with installation? [Y/n] (0/6) checking keys in keyring                                                        [-------------------(6/6) checking keys in keyring                                                        [#################################################] 100%
(6/6) checking package integrity                                                      [#################################################] 100%
(6/6) loading package files                                                           [#################################################] 100%
(6/6) checking for file conflicts                                                     [#################################################] 100%
(6/6) checking available disk space                                                   [#################################################] 100%
:: Processing package changes...
(1/6) reinstalling cmake                                                              [#################################################] 100%
(2/6) reinstalling gcc                                                                [#################################################] 100%
(3/6) reinstalling openssl-1.0                                                        [#################################################] 100%
(4/6) reinstalling pkgconf                                                            [#################################################] 100%
(5/6) reinstalling git                                                                [#################################################] 100%
(6/6) reinstalling clang                                                              [#################################################] 100%
:: Running post-transaction hooks...
(1/7) Updating icon theme caches...
(2/7) Reloading system manager configuration...
(3/7) Creating system user accounts...
(4/7) Arming ConditionNeedsUpdate...
(5/7) Updating the info directory file...
(6/7) Updating the desktop file MIME type cache...
(7/7) Updating the MIME type database...
โžœ  ~ ./substrate-package-rename.sh test jamesray          
zsh: no such file or directory: ./substrate-package-rename.sh
โžœ  ~        

Additionally, it's not very efficient to reinstall packages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.