-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revamp the Readme of the minimal template #4649
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
5ed8670
Update minimal template readme
rzadp 099d5ac
img
rzadp 5d3a023
broken link
rzadp 99344c3
mv
rzadp f919b60
pjs
rzadp 55bfc70
link fix
rzadp c0a64c7
links were not working on github render
rzadp 48cf537
typo?
rzadp df1a1c2
zing and pep
rzadp 357de65
seems more natural
rzadp 0349e1e
simplify
rzadp dd06a8a
simplify
rzadp 32d79b5
Remove substrate.io links
rzadp 94327e2
rewrite and shorten pallets readme
rzadp 89e622e
rewrite / shorten runtime readme
rzadp 48bf863
revamp node readme
rzadp c45f7d7
link
rzadp 5e57bb3
main readme, and last substrate.io link
rzadp 02d0879
link
rzadp d99f819
restructure and info
rzadp 89f00b0
shorten sentence
rzadp bc2cbac
no validators in this template
rzadp bb98cff
Update templates/minimal/node/README.md
rzadp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,95 @@ | ||
# Minimal Template | ||
<div align="center"> | ||
|
||
This is a minimal template for creating a blockchain using the Polkadot SDK. | ||
# Polkadot SDK's Minimal Template | ||
|
||
# Docs | ||
<img height="70px" alt="Polkadot SDK Logo" src="https://github.com/paritytech/polkadot-sdk/raw/master/docs/images/Polkadot_Logo_Horizontal_Pink_White.png#gh-dark-mode-only"/> | ||
<img height="70px" alt="Polkadot SDK Logo" src="https://github.com/paritytech/polkadot-sdk/raw/master/docs/images/Polkadot_Logo_Horizontal_Pink_Black.png#gh-light-mode-only"/> | ||
|
||
You can generate and view the [Rust | ||
Docs](https://doc.rust-lang.org/cargo/commands/cargo-doc.html) for this template | ||
with this command: | ||
> This is a minimal template for creating a blockchain based on Polkadot SDK. | ||
> | ||
> This template is automatically updated after releases in the main [Polkadot SDK monorepo](https://github.com/paritytech/polkadot-sdk). | ||
|
||
</div> | ||
|
||
🤏 This template is a minimal (in terms of complexity and the number of components) template for building a blockchain node. | ||
|
||
🔧 It's runtime is configured of a single custom pallet as a staring point, and a handful of ready-made pallets such as a [Balances pallet](https://paritytech.github.io/polkadot-sdk/master/pallet_balances/index.html). | ||
|
||
👤 The template has no consensus configured - it is best for experimenting with a single node network. | ||
|
||
## Template Structure | ||
|
||
A Polkadot SDK based project such as this one consists of: | ||
|
||
- 💿 a [Node](./node/README.md) - the binary application. | ||
- 🧮 the [Runtime](./runtime/README.md) - the core logic of the blockchain. | ||
- 🎨 the [Pallets](./pallets/README.md) - from which the runtime is constructed. | ||
|
||
## Getting Started | ||
|
||
🦀 The template is using the Rust language. | ||
|
||
👉 Check the | ||
[Rust installation instructions](https://www.rust-lang.org/tools/install) for your system. | ||
|
||
🛠️ Depending on your operating system and Rust version, there might be additional | ||
packages required to compile this template - please take note of the Rust compiler output. | ||
|
||
### Build | ||
|
||
🔨 Use the following command to build the node without launching it: | ||
|
||
```sh | ||
cargo doc -p minimal-template --open | ||
cargo build --release | ||
``` | ||
|
||
🐳 Alternatively, build the docker image: | ||
|
||
```sh | ||
docker build . -t polkadot-sdk-minimal-template | ||
``` | ||
|
||
### Single-Node Development Chain | ||
|
||
👤 The following command starts a single-node development chain: | ||
|
||
```sh | ||
./target/release/minimal-template-node --dev | ||
|
||
# docker version: | ||
docker run --rm polkadot-sdk-minimal-template --dev | ||
``` | ||
|
||
Development chains: | ||
|
||
- 🧹 Do not persist the state. | ||
- 💰 Are preconfigured with a genesis state that includes several prefunded development accounts. | ||
- 🧑⚖️ Development accounts are used as `sudo` accounts. | ||
|
||
### Connect with the Polkadot-JS Apps Front-End | ||
|
||
🌐 You can interact with your local node using the | ||
hosted version of the [Polkadot/Substrate | ||
Portal](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944). | ||
|
||
🪐 A hosted version is also | ||
available on [IPFS](https://dotapps.io/). | ||
|
||
🧑🔧 You can also find the source code and instructions for hosting your own instance in the | ||
[`polkadot-js/apps`](https://github.com/polkadot-js/apps) repository. | ||
|
||
## Contributing | ||
|
||
🔄 This template is automatically updated after releases in the main [Polkadot SDK monorepo](https://github.com/paritytech/polkadot-sdk). | ||
|
||
➡️ Any pull requests should be directed to this [source](https://github.com/paritytech/polkadot-sdk/tree/master/templates/minimal). | ||
|
||
😇 Please refer to the monorepo's [contribution guidelines](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md) and [Code of Conduct](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CODE_OF_CONDUCT.md). | ||
|
||
## Getting Help | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is great. |
||
🧑🏫 To learn about Polkadot in general, [Polkadot.network](https://polkadot.network/) website is a good starting point. | ||
|
||
🧑🔧 For technical introduction, [here](https://github.com/paritytech/polkadot-sdk#-documentation) are the Polkadot SDK documentation resources. | ||
|
||
👥 Additionally, there are [GitHub issues](https://github.com/paritytech/polkadot-sdk/issues) and [Substrate StackExchange](https://substrate.stackexchange.com/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Node | ||
|
||
ℹ️ A node - in Polkadot - is a binary executable, whose primary purpose is to execute the [runtime](../runtime/README.md). | ||
|
||
🔗 It communicates with other nodes in the network, and aims for [consensus](https://wiki.polkadot.network/docs/learn-consensus) among them. | ||
|
||
⚙️ It acts as a remote procedure call (RPC) server, allowing interaction with the blockchain. | ||
|
||
👉 Learn more about the architecture, and a difference between a node and a runtime [here](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/wasm_meta_protocol/index.html). | ||
|
||
👇 Here are the most important files in this node template: | ||
|
||
- [`chain_spec.rs`](./src/chain_spec.rs): A chain specification is a source code file that defines the chain's initial (genesis) state. | ||
- [`service.rs`](./src/service.rs): This file defines the node implementation. It's a place to configure consensus-related topics. In favor of minimalism, this template has no consensus configured. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Pallets | ||
|
||
ℹ️ A pallet is a unit of encapsulated logic, with a clearly defined responsibility. A pallet is analogous to a module in the runtime. | ||
|
||
💁 In this template, there is a simple custom pallet based on the FRAME framework. | ||
|
||
👉 Learn more about FRAME [here](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html). | ||
|
||
🧑🏫 Please refer to [this guide](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html) to learn how to write a basic pallet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Runtime | ||
|
||
ℹ️ The runtime (in other words, a state transition function), refers to the core logic of the blockchain that is responsible for | ||
validating blocks and executing the state changes they define. | ||
|
||
💁 The runtime in this template is constructed using ready-made FRAME pallets that ship with [Polkadot SDK](https://github.com/paritytech/polkadot-sdk), and a [template for a custom pallet](../pallets/README.md). | ||
|
||
👉 Learn more about FRAME [here](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/polkadot_sdk/frame_runtime/index.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the question is what is the minimal template?
The main difference between the minimal template and others is that it has the least number of components to run.
In the runtime side, this template only has a handful of pallets, which you can list.
On the node side, this template has no consensus and can run both with custom block time via CLI. see
enum Consensus
in thenode
folder.In general, for palying around with a single node, this template is best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I felt like some more introduction of what you're looking at is missing.
I added something based on this comment.