-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[create-pull-request] automated change
- Loading branch information
Showing
17 changed files
with
300 additions
and
10,480 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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,28 @@ | ||
FROM docker.io/paritytech/ci-unified:latest as builder | ||
|
||
WORKDIR /polkadot | ||
COPY . /polkadot | ||
|
||
RUN cargo fetch | ||
RUN cargo build --locked --release | ||
|
||
FROM docker.io/parity/base-bin:latest | ||
|
||
COPY --from=builder /polkadot/target/release/minimal-template-node /usr/local/bin | ||
|
||
USER root | ||
RUN useradd -m -u 1001 -U -s /bin/sh -d /polkadot polkadot && \ | ||
mkdir -p /data /polkadot/.local/share && \ | ||
chown -R polkadot:polkadot /data && \ | ||
ln -s /data /polkadot/.local/share/polkadot && \ | ||
# unclutter and minimize the attack surface | ||
rm -rf /usr/bin /usr/sbin && \ | ||
# check if executable works in this container | ||
/usr/local/bin/minimal-template-node --version | ||
|
||
USER polkadot | ||
|
||
EXPOSE 30333 9933 9944 9615 | ||
VOLUME ["/data"] | ||
|
||
ENTRYPOINT ["/usr/local/bin/minimal-template-node"] |
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,24 @@ | ||
This is free and unencumbered software released into the public domain. | ||
|
||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
|
||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
For more information, please refer to <http://unlicense.org> |
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,101 @@ | ||
# 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. | ||
|
||
* 🔧 Its runtime is configured of 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: | ||
|
||
* 💿 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/). |
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
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,18 @@ | ||
# 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
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
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
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.