-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
981d6c0
commit c593bca
Showing
8 changed files
with
361 additions
and
11 deletions.
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Polkadot Omni Node | ||
|
||
This is a white labeled implementation based on [`polkadot-omni-node-lib`](https://crates.io/crates/polkadot-omni-node-lib). | ||
It can be used to start a parachain node from a provided chain spec file. It is only compatible with runtimes that use block | ||
number `u32` and `Aura` consensus. | ||
|
||
## Installation | ||
|
||
Download & expose it via `PATH`: | ||
|
||
```bash | ||
# Download and set it on PATH. | ||
wget https://github.com/paritytech/polkadot-sdk/releases/download/<stable_release_tag>/polkadot-omni-node | ||
chmod +x polkadot-omni-node | ||
export PATH="$PATH:`pwd`" | ||
``` | ||
|
||
Compile & install via `cargo`: | ||
|
||
```bash | ||
# Assuming ~/.cargo/bin is on the PATH | ||
cargo install polkadot-omni-node | ||
``` | ||
|
||
## Usage | ||
|
||
A basic example for an Omni Node run starts from a runtime which implements the [`sp_genesis_builder::GenesisBuilder`](https://docs.rs/sp-genesis-builder/latest/sp_genesis_builder/trait.GenesisBuilder.html). | ||
The interface mandates the runtime to expose a [`named-preset`](https://docs.rs/staging-chain-spec-builder/latest/staging_chain_spec_builder/#generate-chain-spec-using-runtime-provided-genesis-config-preset). | ||
|
||
### 1. Install chain-spec-builder | ||
|
||
**Note**: `chain-spec-builder` binary is published on [`crates.io`](https://crates.io) under | ||
[`staging-chain-spec-builder`](https://crates.io/crates/staging-chain-spec-builder) due to a name conflict. | ||
Install it with `cargo` like bellow : | ||
|
||
```bash | ||
cargo install staging-chain-spec-builder | ||
``` | ||
|
||
### 2. Generate a chain spec | ||
|
||
Omni Node expects for the chain spec to contain parachains related fields like `relay_chain` and `para_id`. | ||
These fields can be introduced by running [`staging-chain-spec-builder`](https://crates.io/crates/staging-chain-spec-builder) | ||
with additional flags: | ||
|
||
```bash | ||
chain-spec-builder create --relay-chain <relay_chain_id> --para-id <id> -r <runtime.wasm> named-preset <preset_name> | ||
``` | ||
|
||
### 3. Run Omni Node | ||
|
||
And now with the generated chain spec we can start the node in development mode like so: | ||
|
||
```bash | ||
polkadot-omni-node --dev --chain <chain_spec.json> | ||
``` | ||
|
||
## Useful links | ||
|
||
* [`Omni Node Polkadot SDK Docs`](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/omni_node/index.html) | ||
* [`Chain Spec Genesis Reference Docs`](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/chain_spec_genesis/index.html) | ||
* [`polkadot-parachain-bin`](https://crates.io/crates/polkadot-parachain-bin) | ||
* [`polkadot-sdk-parachain-template`](https://github.com/paritytech/polkadot-sdk-parachain-template) | ||
* [`frame-omni-bencher`](https://crates.io/crates/frame-omni-bencher) | ||
* [`staging-chain-spec-builder`](https://crates.io/crates/staging-chain-spec-builder) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
||
title: OmniNode --dev flag starts node with manual seal | ||
|
||
doc: | ||
- audience: [ Runtime Dev, Node Dev ] | ||
description: | | ||
`polkadot-omni-node` lib supports `--dev` flag now by allowing also to pass over a chain spec, | ||
and starts the node with manual seal. It will seal the node at each `dev_block_time` milliseconds, | ||
which can be set via `--dev-block-time`, and if not set will default to `3000ms`. | ||
|
||
crates: | ||
- name: sc-cli | ||
bump: patch | ||
- name: polkadot-omni-node-lib | ||
bump: patch | ||
- name: polkadot-omni-node | ||
bump: patch |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[relaychain] | ||
default_command = "polkadot-omni-node" | ||
chain = "dev" | ||
chain_spec_path = "<path/to/chain_spec.json>" | ||
default_args = ["--dev"] | ||
|
||
[[relaychain.nodes]] | ||
name = "alice" | ||
ws_port = 9944 |
Oops, something went wrong.