Giter Club home page Giter Club logo

dotemplate's Introduction

POP

Your one-stop entry into the exciting world of Blockchain development with Polkadot

Getting Started

Use pop to either clone of your existing templates or instantiate a new parachain template:

# Create a minimal parachain template
pop create my-app
# Get the extended-parachain-template
pop create my-app ept
# Get a pallet-contracts enabled template
pop create my-app cpt
# Get a evm compatible parachain template
pop create my-app fpt

You can also customize a template by providing config options for token symbol (as it appears on polkadot-js apps UI), token decimals, and the initial endowment for substrate developer accounts. Here's how:

# Create a minimal parachain template with "DOT" as token symbol, 6 token decimals and 1 billion tokens per dev account
pop create my-app --symbol DOT --decimals 6 --endowment 1_000_000_000

There's also the shorter version:

pop create my-app -s DOT -d 6 -i 1_000_000_000

To create a new pallet, simply pop pallet. And that's it. You will have a new pallet-template ready for hacking. To customize the new pallet you can follow these options:

# create a pallet with name `pallet-awesome` in the current working directory
pop pallet pallet-awesome
# or with options
pop pallet pallet-awesome --authors Me --description "This pallet oozes awesomeness" --path my_app/pallets

Finally, you would need to build and run it.

cd my-app
cargo build --release

For running any parachain, we recommend using zombienet.

Zombinet integration coming soon...

dotemplate's People

Contributors

weezy20 avatar dependabot[bot] avatar

Watchers

 avatar

dotemplate's Issues

Minimizing keystrokes on adding a new pallet inside instantiated Template. Figure out mechanism to detect if $(CWD).isTemplate

If a user instantiates a template using pop create, and then navigates inside the folder and runs pop pallet, we want a default where it detects a pallets/ folder, if not one, create it, and then complete the pallet addition logic. However, there's a one caveat:

How do we know from pop that we are inside a template project?

Among pop pallet <options> there will be an option to take in a --path but we should also provide a quick default that replicates the behaviour described above for a frictionless experience.

Extend vanilla CLI to accomodate chainspec customization

Based on the runtime config that's generated, the chainspec must adjust accordingly.

For instance, if the template is generating config for some pallet which expects a genesis_config, the same should reflect in the appropriate chain_spec.templ

Pop Pallet installation inside the Runtime

Should close #8 before this.

Once it's detected that we are inside a substrate parachain repo, pop pallet will create a pallet that's inert. The user will have to manually install the pallet into their runtime and genesis in order to use it. This brings us to a somewhat of a crossroads.

Q : How should the pallet be installed?
One way would be to generate the AST of runtime and chain_spec code specifically and insert quote! { .. } nodes into it. But this is not easily done with runtime/src/lib.rs because the file makes heavy use of macros already. For the chain_spec.rs file, this solution can be applied. For the runtime however, we would need to scrape the file and edit it in place with the pallet config, benchmarks, and other machinery, while also checking for name collisons.
Then finally, the runtime/Cargo.toml and node/Cargo.toml will have to be updated.

SemVer comptability

The current design provides the latest templates. Is it worthwhile to add functionality to create a template at a specific version ?

# example
pop create my-app [email protected]

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.