-
Notifications
You must be signed in to change notification settings - Fork 822
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add development chain-spec file for minimal/parachain templates for O…
…mni Node compatibility (#6529) # Description This PR adds development chain specs for the minimal and parachain templates. [#6334](#6334) ## Integration This PR adds development chain specs for the minimal and para chain template runtimes, ensuring synchronization with runtime code. It updates zombienet-omni-node.toml, zombinet.toml files to include valid chain spec paths, simplifying configuration for zombienet in the parachain and minimal template. ## Review Notes 1. Overview of Changes: - Added development chain specs for use in the minimal and parachain template. - Updated zombienet-omni-node.toml and zombinet.toml files in the minimal and parachain templates to include paths to the new dev chain specs. 2. Integration Guidance: **NB: Follow the templates' READMEs from the polkadot-SDK master branch. Please build the binaries and runtimes based on the polkadot-SDK master branch.** - Ensure you have set up your runtimes `parachain-template-runtime` and `minimal-template-runtime` - Ensure you have installed the nodes required ie `parachain-template-node` and `minimal-template-node` - Set up [Zombinet](https://paritytech.github.io/zombienet/intro.html) - For running the parachains, you will need to install the polkadot `cargo install --path polkadot` remember from the polkadot-SDK master branch. - Inside the template folders minimal or parachain, run the command to start with `Zombienet with Omni Node`, `Zombienet with minimal-template-node` or `Zombienet with parachain-template-node` *Include your leftover TODOs, if any, here.* * [ ] Test the syncing of chain specs with runtime's code. --------- Signed-off-by: EleisonC <[email protected]> Co-authored-by: Iulian Barbu <[email protected]> Co-authored-by: Alexander Samusev <[email protected]>
- Loading branch information
1 parent
b2004ed
commit d85147d
Showing
8 changed files
with
284 additions
and
9 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 |
---|---|---|
|
@@ -31,7 +31,66 @@ on: | |
default: "" | ||
|
||
jobs: | ||
prepare-chain-spec-artifacts: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- template: minimal | ||
package_name: 'minimal-template-runtime' | ||
runtime_path: './templates/minimal/runtime' | ||
runtime_wasm_path: minimal-template-runtime/minimal_template_runtime.compact.compressed.wasm | ||
relay_chain: 'dev' | ||
- template: parachain | ||
package_name: 'parachain-template-runtime' | ||
runtime_path: './templates/parachain/runtime' | ||
runtime_wasm_path: parachain-template-runtime/parachain_template_runtime.compact.compressed.wasm | ||
relay_chain: 'rococo-local' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: "${{ github.event.inputs.stable_release_branch }}" | ||
|
||
- name: Setup build environment | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y protobuf-compiler | ||
cargo install --git https://github.com/chevdor/srtool-cli --locked | ||
cargo install --path substrate/bin/utils/chain-spec-builder --locked | ||
srtool pull | ||
- name: Build runtime and generate chain spec | ||
run: | | ||
# Prepare directories | ||
sudo mkdir -p ${{ matrix.template.runtime_path }}/target | ||
sudo chmod -R 777 ${{ matrix.template.runtime_path }}/target | ||
# Build runtime | ||
srtool build --package ${{ matrix.template.package_name }} --runtime-dir ${{ matrix.template.runtime_path }} --root | ||
# Generate chain spec | ||
# Note that para-id is set to 1000 for both minimal/parachain templates. | ||
# `parachain-runtime` is hardcoded to use this parachain id. | ||
# `minimal` template isn't using it, but when started with Omni Node, this para id is required (any number can do it, so setting it to 1000 for convenience). | ||
chain-spec-builder -c dev_chain_spec.json create \ | ||
--relay-chain "${{ matrix.template.relay_chain }}" \ | ||
--para-id 1000 \ | ||
--runtime "${{ matrix.template.runtime_path }}/target/srtool/release/wbuild/${{ matrix.template.runtime_wasm_path }}" \ | ||
named-preset development | ||
- name: Prepare upload directory | ||
run: | | ||
mkdir -p artifacts-${{ matrix.template }} | ||
cp dev_chain_spec.json artifacts-${{ matrix.template }}/dev_chain_spec.json | ||
- name: Upload template directory | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifacts-${{ matrix.template }} | ||
path: artifacts-${{ matrix.template }}/dev_chain_spec.json | ||
|
||
sync-templates: | ||
needs: prepare-chain-spec-artifacts | ||
runs-on: ubuntu-latest | ||
environment: master | ||
strategy: | ||
|
@@ -52,6 +111,12 @@ jobs: | |
with: | ||
path: polkadot-sdk | ||
ref: "${{ github.event.inputs.stable_release_branch }}" | ||
- name: Download template artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: artifacts-${{ matrix.template }} | ||
path: templates/${{ matrix.template }}/ | ||
if: matrix.template != 'solochain' | ||
- name: Generate a token for the template repository | ||
id: app_token | ||
uses: actions/[email protected] | ||
|
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
Large diffs are not rendered by default.
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
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
Large diffs are not rendered by default.
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