diff --git a/templates/minimal/README.md b/templates/minimal/README.md index 0541e393db93b..3488bc43cc902 100644 --- a/templates/minimal/README.md +++ b/templates/minimal/README.md @@ -1,13 +1,95 @@ -# Minimal Template +
-This is a minimal template for creating a blockchain using the Polkadot SDK. +# Polkadot SDK's Minimal Template -# Docs +Polkadot SDK Logo +Polkadot SDK Logo -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). + +
+ +๐Ÿค 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 + +๐Ÿง‘โ€๐Ÿซ 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/). diff --git a/templates/minimal/node/README.md b/templates/minimal/node/README.md new file mode 100644 index 0000000000000..04a916f5053b4 --- /dev/null +++ b/templates/minimal/node/README.md @@ -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. diff --git a/templates/minimal/pallets/README.md b/templates/minimal/pallets/README.md new file mode 100644 index 0000000000000..26003638e9acb --- /dev/null +++ b/templates/minimal/pallets/README.md @@ -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. diff --git a/templates/minimal/runtime/README.md b/templates/minimal/runtime/README.md new file mode 100644 index 0000000000000..2fdfef8bc35b1 --- /dev/null +++ b/templates/minimal/runtime/README.md @@ -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). diff --git a/templates/solochain/README.md b/templates/solochain/README.md index 37c65797dcb00..2e3b1146a8fde 100644 --- a/templates/solochain/README.md +++ b/templates/solochain/README.md @@ -103,9 +103,8 @@ After you start the node template locally, you can interact with it using the hosted version of the [Polkadot/Substrate Portal](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944) front-end by connecting to the local node endpoint. A hosted version is also -available on [IPFS (redirect) here](https://dotapps.io/) or [IPNS (direct) -here](ipns://dotapps.io/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer). You can -also find the source code and instructions for hosting your own instance on the +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. ### Multi-Node Local Testnet @@ -131,7 +130,7 @@ capabilities: the network. Substrate makes it possible to supply custom consensus engines and also ships with several consensus mechanisms that have been built on top of [Web3 Foundation - research](https://research.web3.foundation/en/latest/polkadot/NPoS/index.html). + research](https://research.web3.foundation/Polkadot/protocols/NPoS). - RPC Server: A remote procedure call (RPC) server is used to interact with Substrate nodes.