# Polkadot SDK's Minimal Template

> 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).
## Table of Contents
- [Intro](#intro)
- [Template Structure](#template-structure)
- [Getting Started](#getting-started)
- [Starting a Minimal Template Chain](#starting-a-minimal-template-chain)
- [Omni Node](#omni-node)
- [Minimal Template Node](#minimal-template-node)
- [Zombienet with Omni Node](#zombienet-with-omni-node)
- [Zombienet with Minimal Template Node](#zombienet-with-minimal-template-node)
- [Connect with the Polkadot-JS Apps Front-End](#connect-with-the-polkadot-js-apps-front-end)
- [Takeaways](#takeaways)
- [Contributing](#contributing)
- [Getting Help](#getting-help)
## Intro
- ๐ค This template is a minimal (in terms of complexity and the number of components)
template for building a blockchain node.
- ๐ง Its runtime is configured with a single custom pallet as a starting 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:
- ๐งฎ the [Runtime](./runtime/README.md) - the core logic of the blockchain.
- ๐จ the [Pallets](./pallets/README.md) - from which the runtime is constructed.
- ๐ฟ a [Node](./node/README.md) - the binary application (which is not part of the cargo default-members list and is not
compiled unless building the entire workspace).
## 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.
Fetch minimal template code:
```sh
git clone https://github.com/paritytech/polkadot-sdk-minimal-template.git minimal-template
cd minimal-template
```
## Starting a Minimal Template Chain
### Omni Node
[Omni Node](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/omni_node/index.html) can
be used to run the minimal template's runtime. `polkadot-omni-node` binary crate usage is described at a high-level
[on crates.io](https://crates.io/crates/polkadot-omni-node).
#### Install `polkadot-omni-node`
Please see installation section on [crates.io/omni-node](https://crates.io/crates/polkadot-omni-node).
#### Build `minimal-template-runtime`
```sh
cargo build -p minimal-template-runtime --release
```
#### Install `staging-chain-spec-builder`
Please see the installation section at [`crates.io/staging-chain-spec-builder`](https://crates.io/crates/staging-chain-spec-builder).
#### Use chain-spec-builder to generate the chain_spec.json file
```sh
chain-spec-builder create --relay-chain "dev" --para-id 1000 --runtime \
target/release/wbuild/minimal-template-runtime/minimal_template_runtime.wasm named-preset development
```
**Note**: the `relay-chain` and `para-id` flags are extra bits of information required to
configure the node for the case of representing a parachain that is connected to a relay chain.
They are not relevant to minimal template business logic, but they are mandatory information for
Omni Node, nonetheless.
#### Run Omni Node
Start Omni Node in development mode (sets up block production and finalization based on manual seal,
sealing a new block every 3 seconds), with a minimal template runtime chain spec.
```sh
polkadot-omni-node --chain