Skip to content

Commit

Permalink
Add moonbase runtime and chain spec (#446)
Browse files Browse the repository at this point in the history
* Add moonbase runtime and chain spec

* Add moonbase chain specs into command

* Add generated moonbase chain specs

* Add moonbase option in scripts and CI workflows

* Add moonbase option in  CI workflows

* Add moonbase option in scripts and CI workflows

* update moonbase genesis info

* update moonbase chain spec using :moobase

Co-authored-by: Kailai Wang <[email protected]>
  • Loading branch information
h4n0 and Kailai-Wang authored Apr 13, 2022
1 parent 9a47338 commit e3566a6
Show file tree
Hide file tree
Showing 45 changed files with 4,717 additions and 19 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/benchmark_runtime_weights.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ on:
type: choice
description: The chain whose runtime is benchmarked
options:
- litmus
- litentry
- rococo
- litmus
- litentry
- rococo
- moonbase
pallets:
description: pallets to benchmark, * for all, or comma listed (e.g. frame-system,pallet-proxy)
default: '*'
default: "*"
required: true

env:
REMOTE_HOST: parachain-benchmark # remote host to run benchmarking upon, must be ssh reachable
REMOTE_HOST: parachain-benchmark # remote host to run benchmarking upon, must be ssh reachable

jobs:
## build docker image with runtime-benchmarks feature, and then run the benchmarking remotely
Expand Down Expand Up @@ -62,13 +63,13 @@ jobs:
- name: Create auto PR
uses: peter-evans/create-pull-request@v3
with:
commit-message: '[benchmarking bot] Auto commit generated weights files'
commit-message: "[benchmarking bot] Auto commit generated weights files"
committer: benchmarking bot <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: benchmarking-bot-${{ github.run_id }}
delete-branch: true
title: '[benchmarking bot] Update generated weights files'
title: "[benchmarking bot] Update generated weights files"
body: |
This is an automatically created PR.
It updates the weights files under `runtime/${{ github.event.inputs.chain }}/src/weights/*.rs` after running benchmarks on the remote machine: ${{ env.REMOTE_HOST }}
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/build_and_run_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches:
- dev
paths-ignore:
- '**/dependabot.yml'
- '**/README.md'
- "**/dependabot.yml"
- "**/README.md"
pull_request:
branches:
- dev
Expand Down Expand Up @@ -221,6 +221,7 @@ jobs:
- litmus
- litentry
- rococo
- moonbase
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -285,7 +286,13 @@ jobs:
# Only push docker image when tests are passed on dev branch
push-docker-image:
runs-on: ubuntu-latest
needs: ["check-cargo-clippy", "run-cargo-unit-tests", "run-cargo-runtime-tests", "run-ts-tests"]
needs:
[
"check-cargo-clippy",
"run-cargo-unit-tests",
"run-cargo-runtime-tests",
"run-ts-tests",
]
if: ${{ success() && (github.event_name == 'push') && (github.ref == 'refs/heads/dev') }}
steps:
- uses: actions/download-artifact@v3
Expand All @@ -303,5 +310,4 @@ jobs:
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Push docker image
run:
docker push litentry/litentry-parachain:latest
run: docker push litentry/litentry-parachain:latest
4 changes: 3 additions & 1 deletion .github/workflows/create_release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
required: true
diff_tag:
description: an existing tag to run diff against (e.g. v1.2.0)
default: ''
default: ""
required: false
genesis_release:
type: choice
Expand All @@ -25,6 +25,7 @@ on:
- litmus
- rococo
- litentry
- moonbase

env:
RELEASE_TYPE: ${{ github.event.inputs.release_type }}
Expand All @@ -43,6 +44,7 @@ jobs:
- litmus
- rococo
- litentry
- moonbase
steps:
- name: Checkout codes on ${{ env.RELEASE_TAG }}
uses: actions/checkout@v2
Expand Down
72 changes: 72 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ members = [
'runtime/litentry',
'runtime/litmus',
'runtime/rococo',
'runtime/moonbase',
]
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ build-runtime-litmus:
build-runtime-rococo:
cargo build -p $(call pkgid, rococo-parachain-runtime) --release

.PHONY: build-runtime-moonbase ## Build moonbase release runtime
build-runtime-moonbase:
cargo build -p $(call pkgid, moonbase-parachain-runtime) --release

.PHONY: srtool-build-wasm-litentry ## Build litentry wasm with srtools
srtool-build-wasm-litentry:
@./scripts/build-wasm.sh litentry
Expand All @@ -57,6 +61,10 @@ srtool-build-wasm-litmus:
srtool-build-wasm-rococo:
@./scripts/build-wasm.sh rococo

.PHONY: srtool-build-wasm-moonbase ## Build moonbase wasm with srtools
srtool-build-wasm-moonbase:
@./scripts/build-wasm.sh moonbase

.PHONY: build-docker-dev ## Build docker image using Dockerfile.dev
build-docker-dev:
@./scripts/build-docker.sh dev
Expand Down
3 changes: 3 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "p
litentry-parachain-runtime = { path = "../runtime/litentry" }
litmus-parachain-runtime = { path = "../runtime/litmus" }
rococo-parachain-runtime = { path = "../runtime/rococo" }
moonbase-parachain-runtime = { path = "../runtime/moonbase" }
primitives = { path = "../primitives" }

[build-dependencies]
Expand All @@ -103,11 +104,13 @@ runtime-benchmarks = [
"litentry-parachain-runtime/runtime-benchmarks",
"litmus-parachain-runtime/runtime-benchmarks",
"rococo-parachain-runtime/runtime-benchmarks",
"moonbase-parachain-runtime/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
]
try-runtime = [
"litentry-parachain-runtime/try-runtime",
"litmus-parachain-runtime/try-runtime",
"rococo-parachain-runtime/try-runtime",
"moonbase-parachain-runtime/try-runtime",
"polkadot-service/try-runtime",
]
105 changes: 105 additions & 0 deletions node/res/chain_specs/moonbase-plain.json

Large diffs are not rendered by default.

98 changes: 98 additions & 0 deletions node/res/chain_specs/moonbase.json

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions node/res/genesis_info/moonbase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"rootKey": "jcMcexZDWw6PUEeSEXAcGppmyy1mSzSvgHCmge6jYYmVma2Y7",
"invulnerables": [
[
"jcRVUU8svEMTtwJjX1HzySNrrVEHVnoAdNAmhnbM8ub5dfbM9",
"jcSmq9jXyvZWwJQY6cqf7fCAbnFpesph35H3iqKPgSexTLbCr"
]
],
"candidacyBond": "16000000000000",
"endowedAccounts": [
[
"jcRVUU8svEMTtwJjX1HzySNrrVEHVnoAdNAmhnbM8ub5dfbM9",
"1000000000000000"
],
[
"jcMcexZDWw6PUEeSEXAcGppmyy1mSzSvgHCmge6jYYmVma2Y7",
"1000000000000000"
],
[
"jcS2wD5jDwouCqVABGCZhVjKQQm3ZHxMYTabySfT3Pygzck9W",
"1000000000000000"
]
],
"council": [
"jcRVUU8svEMTtwJjX1HzySNrrVEHVnoAdNAmhnbM8ub5dfbM9"
],
"technicalCommittee": [
"jcRVUU8svEMTtwJjX1HzySNrrVEHVnoAdNAmhnbM8ub5dfbM9"
],
"bootNodes": [
"/dns/moonbase-parachain-sg-0.litentry.io/tcp/40333/ws/p2p/12D3KooWB4f2J7EzKNDmuc4pEgJR9F7w3nE3JNWEEad6PphJhTNx"
],
"telemetryEndpoints": [
"wss://telemetry-backend.parachain.litentry.io/submit"
]
}
1 change: 1 addition & 0 deletions node/src/chain_specs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use sp_runtime::traits::{IdentifyAccount, Verify};

pub mod litentry;
pub mod litmus;
pub mod moonbase;
pub mod rococo;

// This is a default chain spec using litentry genesis config
Expand Down
Loading

0 comments on commit e3566a6

Please sign in to comment.