mirror of
https://github.com/pezkuwichain/pez-solochain-template.git
synced 2026-06-12 21:41:05 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8599efc46a | |||
| af8901fed9 | |||
| 1c62506267 | |||
| ef08431ae0 | |||
| 94e47b6e47 | |||
| a41ab75c30 | |||
| a9e0db20dd |
@@ -0,0 +1,16 @@
|
|||||||
|
name: Free disk space
|
||||||
|
description: We've run into out-of-disk error when compiling Rust projects, so we free up some space this way.
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Free Disk Space
|
||||||
|
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # 1.3.1
|
||||||
|
with:
|
||||||
|
android: true # This alone is a 12 GB save.
|
||||||
|
# We disable the rest because it caused some problems. (they're enabled by default)
|
||||||
|
# The Android removal is enough.
|
||||||
|
dotnet: false
|
||||||
|
haskell: false
|
||||||
|
large-packages: false
|
||||||
|
swap-storage: false
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
name: Install macOS dependencies
|
||||||
|
description: Installs dependencies required to compile the template on macOS
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- run: |
|
||||||
|
curl https://sh.rustup.rs -sSf -y | sh
|
||||||
|
brew install protobuf
|
||||||
|
rustup target add wasm32-unknown-unknown --toolchain stable-aarch64-apple-darwin
|
||||||
|
rustup component add rust-src --toolchain stable-aarch64-apple-darwin
|
||||||
|
shell: sh
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
name: Install Ubuntu dependencies
|
||||||
|
description: Installs dependencies required to compile the template in Ubuntu
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Rust compilation prerequisites (Ubuntu)
|
||||||
|
if: contains(matrix.os, 'ubuntu')
|
||||||
|
run: |
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y \
|
||||||
|
protobuf-compiler
|
||||||
|
rustup target add wasm32-unknown-unknown
|
||||||
|
rustup component add rustfmt clippy rust-src
|
||||||
|
shell: bash
|
||||||
+43
-36
@@ -12,30 +12,20 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Rust compilation prerequisites
|
- if: contains(matrix.os, 'ubuntu')
|
||||||
run: |
|
uses: ./.github/actions/free-disk-space
|
||||||
sudo apt update
|
- if: contains(matrix.os, 'ubuntu')
|
||||||
sudo apt install -y \
|
uses: ./.github/actions/ubuntu-dependencies
|
||||||
protobuf-compiler
|
- if: contains(matrix.os, 'macos')
|
||||||
rustup target add wasm32-unknown-unknown
|
uses: ./.github/actions/macos-dependencies
|
||||||
rustup component add rustfmt clippy rust-src
|
|
||||||
|
|
||||||
# We've run into out-of-disk error when compiling Polkadot in the next step, so we free up some space this way.
|
|
||||||
- name: Free Disk Space (Ubuntu)
|
|
||||||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # 1.3.1
|
|
||||||
with:
|
|
||||||
android: true # This alone is a 12 GB save.
|
|
||||||
# We disable the rest because it caused some problems. (they're enabled by default)
|
|
||||||
# The Android removal is enough.
|
|
||||||
dotnet: false
|
|
||||||
haskell: false
|
|
||||||
large-packages: false
|
|
||||||
swap-storage: false
|
|
||||||
|
|
||||||
- name: Build the template
|
- name: Build the template
|
||||||
run: cargo build
|
run: cargo build
|
||||||
@@ -48,29 +38,46 @@ jobs:
|
|||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
|
||||||
- name: Run the tests
|
- name: Run the tests
|
||||||
run: cargo test
|
run: SKIP_WASM_BUILD=1 cargo test
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
|
|
||||||
- name: Build the docs
|
- name: Build the docs
|
||||||
run: cargo doc --all-features --workspace --no-deps
|
run: SKIP_WASM_BUILD=1 cargo doc --workspace --no-deps
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
|
|
||||||
|
run-node:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- if: contains(matrix.os, 'ubuntu')
|
||||||
|
uses: ./.github/actions/free-disk-space
|
||||||
|
- if: contains(matrix.os, 'ubuntu')
|
||||||
|
uses: ./.github/actions/ubuntu-dependencies
|
||||||
|
- if: contains(matrix.os, 'macos')
|
||||||
|
uses: ./.github/actions/macos-dependencies
|
||||||
|
|
||||||
|
- name: Build the node individually in release mode
|
||||||
|
run: cargo build --package solochain-template-node --release
|
||||||
|
timeout-minutes: 90
|
||||||
|
|
||||||
|
- name: Make sure the node is producing blocks
|
||||||
|
run: |
|
||||||
|
./target/release/solochain-template-node --dev 2>&1 | tee out.txt &
|
||||||
|
until curl -s '127.0.0.1:9944'; do sleep 5; done
|
||||||
|
until cat out.txt | grep -s "Imported #2"; do sleep 5; done
|
||||||
|
shell: bash
|
||||||
|
timeout-minutes: 5
|
||||||
|
|
||||||
build-docker:
|
build-docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
# We've run into out-of-disk error when compiling Polkadot in the next step, so we free up some space this way.
|
- uses: ./.github/actions/free-disk-space
|
||||||
- name: Free Disk Space (Ubuntu)
|
|
||||||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # 1.3.1
|
|
||||||
with:
|
|
||||||
android: true # This alone is a 12 GB save.
|
|
||||||
# We disable the rest because it caused some problems. (they're enabled by default)
|
|
||||||
# The Android removal is enough.
|
|
||||||
dotnet: false
|
|
||||||
haskell: false
|
|
||||||
large-packages: false
|
|
||||||
swap-storage: false
|
|
||||||
|
|
||||||
- name: Build the Dockerfile
|
- name: Build the Dockerfile
|
||||||
run: docker build . -t polkadot-sdk-solochain-template
|
run: docker build . -t polkadot-sdk-solochain-template
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
name: PR Reminder
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pr-reminder:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Comment a reminder on a new PR
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
github.rest.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: 'Hello, this is an automatic reminder that any code changes should be made to [the source](https://github.com/paritytech/polkadot-sdk/tree/master/templates/solochain).'
|
||||||
|
})
|
||||||
Generated
+1018
-815
File diff suppressed because it is too large
Load Diff
+58
-1
@@ -1,7 +1,7 @@
|
|||||||
[workspace.package]
|
[workspace.package]
|
||||||
license = "MIT-0"
|
license = "MIT-0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
homepage = "https://substrate.io"
|
homepage = "https://paritytech.github.io/polkadot-sdk/"
|
||||||
repository = "https://github.com/paritytech/polkadot-sdk-solochain-template.git"
|
repository = "https://github.com/paritytech/polkadot-sdk-solochain-template.git"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
@@ -14,4 +14,61 @@ members = [
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
|
solochain-template-runtime = { path = "./runtime", default-features = false }
|
||||||
|
pallet-template = { path = "./pallets/template", default-features = false }
|
||||||
|
clap = { version = "4.5.3" }
|
||||||
|
frame-benchmarking-cli = { version = "42.0.0", default-features = false }
|
||||||
|
frame-system = { version = "37.0.0", default-features = false }
|
||||||
|
futures = { version = "0.3.30" }
|
||||||
|
jsonrpsee = { version = "0.23.2" }
|
||||||
|
pallet-transaction-payment = { version = "37.0.0", default-features = false }
|
||||||
|
pallet-transaction-payment-rpc = { version = "40.0.0", default-features = false }
|
||||||
|
sc-basic-authorship = { version = "0.44.0", default-features = false }
|
||||||
|
sc-cli = { version = "0.46.0", default-features = false }
|
||||||
|
sc-client-api = { version = "37.0.0", default-features = false }
|
||||||
|
sc-consensus = { version = "0.43.0", default-features = false }
|
||||||
|
sc-consensus-aura = { version = "0.44.0", default-features = false }
|
||||||
|
sc-consensus-grandpa = { version = "0.29.0", default-features = false }
|
||||||
|
sc-executor = { version = "0.40.0", default-features = false }
|
||||||
|
sc-network = { version = "0.44.0", default-features = false }
|
||||||
|
sc-offchain = { version = "39.0.0", default-features = false }
|
||||||
|
sc-rpc-api = { version = "0.43.0", default-features = false }
|
||||||
|
sc-service = { version = "0.45.0", default-features = false }
|
||||||
|
sc-telemetry = { version = "24.0.0", default-features = false }
|
||||||
|
sc-transaction-pool = { version = "37.0.0", default-features = false }
|
||||||
|
sc-transaction-pool-api = { version = "37.0.0", default-features = false }
|
||||||
serde_json = { version = "1.0.114", default-features = false }
|
serde_json = { version = "1.0.114", default-features = false }
|
||||||
|
sp-api = { version = "34.0.0", default-features = false }
|
||||||
|
sp-block-builder = { version = "34.0.0", default-features = false }
|
||||||
|
sp-blockchain = { version = "37.0.0", default-features = false }
|
||||||
|
sp-consensus-aura = { version = "0.40.0", default-features = false }
|
||||||
|
sp-consensus-grandpa = { version = "21.0.0", default-features = false }
|
||||||
|
sp-core = { version = "34.0.0", default-features = false }
|
||||||
|
sp-inherents = { version = "34.0.0", default-features = false }
|
||||||
|
sp-io = { version = "38.0.0", default-features = false }
|
||||||
|
sp-keyring = { version = "39.0.0", default-features = false }
|
||||||
|
sp-runtime = { version = "39.0.0", default-features = false }
|
||||||
|
sp-timestamp = { version = "34.0.0", default-features = false }
|
||||||
|
substrate-frame-rpc-system = { version = "38.0.0", default-features = false }
|
||||||
|
substrate-build-script-utils = { version = "11.0.0", default-features = false }
|
||||||
|
codec = { version = "3.6.12", default-features = false, package = "parity-scale-codec" }
|
||||||
|
frame-benchmarking = { version = "37.0.0", default-features = false }
|
||||||
|
frame-executive = { version = "37.0.0", default-features = false }
|
||||||
|
frame-support = { version = "37.0.0", default-features = false }
|
||||||
|
frame-system-benchmarking = { version = "37.0.0", default-features = false }
|
||||||
|
frame-system-rpc-runtime-api = { version = "34.0.0", default-features = false }
|
||||||
|
frame-try-runtime = { version = "0.43.0", default-features = false }
|
||||||
|
pallet-aura = { version = "36.0.0", default-features = false }
|
||||||
|
pallet-balances = { version = "38.0.0", default-features = false }
|
||||||
|
pallet-grandpa = { version = "37.0.0", default-features = false }
|
||||||
|
pallet-sudo = { version = "37.0.0", default-features = false }
|
||||||
|
pallet-timestamp = { version = "36.0.0", default-features = false }
|
||||||
|
pallet-transaction-payment-rpc-runtime-api = { version = "37.0.0", default-features = false }
|
||||||
|
scale-info = { version = "2.11.1", default-features = false }
|
||||||
|
sp-genesis-builder = { version = "0.15.0", default-features = false }
|
||||||
|
sp-offchain = { version = "34.0.0", default-features = false }
|
||||||
|
sp-session = { version = "35.0.0", default-features = false }
|
||||||
|
sp-storage = { version = "21.0.0", default-features = false }
|
||||||
|
sp-transaction-pool = { version = "34.0.0", default-features = false }
|
||||||
|
sp-version = { version = "37.0.0", default-features = false }
|
||||||
|
substrate-wasm-builder = { version = "24.0.0", default-features = false }
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ installation](#alternatives-installations) options.
|
|||||||
Use the following command to build the node without launching it:
|
Use the following command to build the node without launching it:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cargo build --release
|
cargo build --package solochain-template-node --release
|
||||||
```
|
```
|
||||||
|
|
||||||
### Embedded Docs
|
### Embedded Docs
|
||||||
@@ -37,7 +37,7 @@ After you build the project, you can use the following command to explore its
|
|||||||
parameters and subcommands:
|
parameters and subcommands:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./target/release/node-template -h
|
./target/release/solochain-template-node -h
|
||||||
```
|
```
|
||||||
|
|
||||||
You can generate and view the [Rust
|
You can generate and view the [Rust
|
||||||
@@ -54,19 +54,19 @@ The following command starts a single-node development chain that doesn't
|
|||||||
persist state:
|
persist state:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./target/release/node-template --dev
|
./target/release/solochain-template-node --dev
|
||||||
```
|
```
|
||||||
|
|
||||||
To purge the development chain's state, run the following command:
|
To purge the development chain's state, run the following command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./target/release/node-template purge-chain --dev
|
./target/release/solochain-template-node purge-chain --dev
|
||||||
```
|
```
|
||||||
|
|
||||||
To start the development chain with detailed logging, run the following command:
|
To start the development chain with detailed logging, run the following command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
RUST_BACKTRACE=1 ./target/release/node-template -ldebug --dev
|
RUST_BACKTRACE=1 ./target/release/solochain-template-node -ldebug --dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Development chains:
|
Development chains:
|
||||||
@@ -75,7 +75,7 @@ Development chains:
|
|||||||
- Use the **Alice** and **Bob** accounts as default validator authorities.
|
- Use the **Alice** and **Bob** accounts as default validator authorities.
|
||||||
- Use the **Alice** account as the default `sudo` account.
|
- Use the **Alice** account as the default `sudo` account.
|
||||||
- Are preconfigured with a genesis state (`/node/src/chain_spec.rs`) that
|
- Are preconfigured with a genesis state (`/node/src/chain_spec.rs`) that
|
||||||
includes several prefunded development accounts.
|
includes several pre-funded development accounts.
|
||||||
|
|
||||||
|
|
||||||
To persist chain state between runs, specify a base path by running a command
|
To persist chain state between runs, specify a base path by running a command
|
||||||
@@ -86,7 +86,7 @@ similar to the following:
|
|||||||
$ mkdir my-chain-state
|
$ mkdir my-chain-state
|
||||||
|
|
||||||
// Use of that folder to store the chain state
|
// Use of that folder to store the chain state
|
||||||
$ ./target/release/node-template --dev --base-path ./my-chain-state/
|
$ ./target/release/solochain-template-node --dev --base-path ./my-chain-state/
|
||||||
|
|
||||||
// Check the folder structure created inside the base path after running the chain
|
// Check the folder structure created inside the base path after running the chain
|
||||||
$ ls ./my-chain-state
|
$ ls ./my-chain-state
|
||||||
@@ -142,7 +142,7 @@ following:
|
|||||||
file that defines a Substrate chain's initial (genesis) state. Chain
|
file that defines a Substrate chain's initial (genesis) state. Chain
|
||||||
specifications are useful for development and testing, and critical when
|
specifications are useful for development and testing, and critical when
|
||||||
architecting the launch of a production chain. Take note of the
|
architecting the launch of a production chain. Take note of the
|
||||||
`development_config` and `testnet_genesis` functions,. These functions are
|
`development_config` and `testnet_genesis` functions. These functions are
|
||||||
used to define the genesis state for the local development chain
|
used to define the genesis state for the local development chain
|
||||||
configuration. These functions identify some [well-known
|
configuration. These functions identify some [well-known
|
||||||
accounts](https://docs.substrate.io/reference/command-line-tools/subkey/) and
|
accounts](https://docs.substrate.io/reference/command-line-tools/subkey/) and
|
||||||
|
|||||||
+70
-37
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "solochain-template-node"
|
name = "solochain-template-node"
|
||||||
description = "A solochain node template built with Substrate, part of Polkadot Sdk. (polkadot v1.13.0)"
|
description = "A solochain node template built with Substrate, part of Polkadot Sdk. (polkadot v1.15.0)"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
@@ -15,47 +15,80 @@ build = "build.rs"
|
|||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.5.3", features = ["derive"] }
|
clap = { features = ["derive"], workspace = true }
|
||||||
futures = { version = "0.3.30", features = ["thread-pool"] }
|
futures = { features = ["thread-pool"], workspace = true }
|
||||||
serde_json = { workspace = true, default-features = true }
|
serde_json = { workspace = true, default-features = true }
|
||||||
jsonrpsee = { version = "0.22", features = ["server"] }
|
jsonrpsee = { features = ["server"], workspace = true }
|
||||||
sc-cli = { version = "0.43.0" }
|
sc-cli.workspace = true
|
||||||
sp-core = { version = "34.0.0" }
|
sc-cli.default-features = true
|
||||||
sc-executor = { version = "0.39.0" }
|
sp-core.workspace = true
|
||||||
sc-network = { version = "0.41.0" }
|
sp-core.default-features = true
|
||||||
sc-service = { version = "0.42.0" }
|
sc-executor.workspace = true
|
||||||
sc-telemetry = { version = "21.0.0" }
|
sc-executor.default-features = true
|
||||||
sc-transaction-pool = { version = "35.0.0" }
|
sc-network.workspace = true
|
||||||
sc-transaction-pool-api = { version = "35.0.0" }
|
sc-network.default-features = true
|
||||||
sc-offchain = { version = "36.0.0" }
|
sc-service.workspace = true
|
||||||
sc-consensus-aura = { version = "0.41.0" }
|
sc-service.default-features = true
|
||||||
sp-consensus-aura = { version = "0.39.0" }
|
sc-telemetry.workspace = true
|
||||||
sc-consensus = { version = "0.40.0" }
|
sc-telemetry.default-features = true
|
||||||
sc-consensus-grandpa = { version = "0.26.0" }
|
sc-transaction-pool.workspace = true
|
||||||
sp-consensus-grandpa = { version = "20.0.0" }
|
sc-transaction-pool.default-features = true
|
||||||
sc-client-api = { version = "35.0.0" }
|
sc-transaction-pool-api.workspace = true
|
||||||
sc-rpc-api = { version = "0.40.0" }
|
sc-transaction-pool-api.default-features = true
|
||||||
sc-basic-authorship = { version = "0.41.0" }
|
sc-offchain.workspace = true
|
||||||
sp-runtime = { version = "38.0.0" }
|
sc-offchain.default-features = true
|
||||||
sp-io = { version = "37.0.0" }
|
sc-consensus-aura.workspace = true
|
||||||
sp-timestamp = { version = "33.0.0" }
|
sc-consensus-aura.default-features = true
|
||||||
sp-inherents = { version = "33.0.0" }
|
sp-consensus-aura.workspace = true
|
||||||
sp-keyring = { version = "38.0.0" }
|
sp-consensus-aura.default-features = true
|
||||||
sp-api = { version = "33.0.0" }
|
sc-consensus.workspace = true
|
||||||
sp-blockchain = { version = "35.0.0" }
|
sc-consensus.default-features = true
|
||||||
sp-block-builder = { version = "33.0.0" }
|
sc-consensus-grandpa.workspace = true
|
||||||
frame-system = { version = "35.0.0" }
|
sc-consensus-grandpa.default-features = true
|
||||||
pallet-transaction-payment = { version = "35.0.0", default-features = false }
|
sp-consensus-grandpa.workspace = true
|
||||||
pallet-transaction-payment-rpc = { version = "37.0.0" }
|
sp-consensus-grandpa.default-features = true
|
||||||
substrate-frame-rpc-system = { version = "35.0.0" }
|
sc-client-api.workspace = true
|
||||||
frame-benchmarking-cli = { version = "39.0.0" }
|
sc-client-api.default-features = true
|
||||||
solochain-template-runtime = { version = "0.1.0", path = "../runtime" }
|
sc-rpc-api.workspace = true
|
||||||
|
sc-rpc-api.default-features = true
|
||||||
|
sc-basic-authorship.workspace = true
|
||||||
|
sc-basic-authorship.default-features = true
|
||||||
|
sp-runtime.workspace = true
|
||||||
|
sp-runtime.default-features = true
|
||||||
|
sp-io.workspace = true
|
||||||
|
sp-io.default-features = true
|
||||||
|
sp-timestamp.workspace = true
|
||||||
|
sp-timestamp.default-features = true
|
||||||
|
sp-inherents.workspace = true
|
||||||
|
sp-inherents.default-features = true
|
||||||
|
sp-keyring.workspace = true
|
||||||
|
sp-keyring.default-features = true
|
||||||
|
sp-api.workspace = true
|
||||||
|
sp-api.default-features = true
|
||||||
|
sp-blockchain.workspace = true
|
||||||
|
sp-blockchain.default-features = true
|
||||||
|
sp-block-builder.workspace = true
|
||||||
|
sp-block-builder.default-features = true
|
||||||
|
frame-system.workspace = true
|
||||||
|
frame-system.default-features = true
|
||||||
|
pallet-transaction-payment.workspace = true
|
||||||
|
pallet-transaction-payment-rpc.workspace = true
|
||||||
|
pallet-transaction-payment-rpc.default-features = true
|
||||||
|
substrate-frame-rpc-system.workspace = true
|
||||||
|
substrate-frame-rpc-system.default-features = true
|
||||||
|
frame-benchmarking-cli.workspace = true
|
||||||
|
frame-benchmarking-cli.default-features = true
|
||||||
|
solochain-template-runtime.workspace = true
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
substrate-build-script-utils = { version = "11.0.0" }
|
substrate-build-script-utils.workspace = true
|
||||||
|
substrate-build-script-utils.default-features = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = ["std"]
|
||||||
|
std = [
|
||||||
|
"solochain-template-runtime/std",
|
||||||
|
]
|
||||||
# Dependencies that are only required if runtime benchmarking should be build.
|
# Dependencies that are only required if runtime benchmarking should be build.
|
||||||
runtime-benchmarks = [
|
runtime-benchmarks = [
|
||||||
"frame-benchmarking-cli/runtime-benchmarks",
|
"frame-benchmarking-cli/runtime-benchmarks",
|
||||||
|
|||||||
+11
-13
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "pallet-template"
|
name = "pallet-template"
|
||||||
description = "FRAME pallet template for defining custom runtime logic. (polkadot v1.13.0)"
|
description = "FRAME pallet template for defining custom runtime logic. (polkadot v1.15.0)"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
@@ -13,22 +13,20 @@ publish = false
|
|||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [
|
codec = { features = [
|
||||||
"derive",
|
"derive",
|
||||||
] }
|
], workspace = true }
|
||||||
scale-info = { version = "2.11.1", default-features = false, features = [
|
scale-info = { features = [
|
||||||
"derive",
|
"derive",
|
||||||
] }
|
], workspace = true }
|
||||||
|
frame-benchmarking = { optional = true, workspace = true }
|
||||||
# frame deps
|
frame-support.workspace = true
|
||||||
frame-benchmarking = { version = "35.0.0", default-features = false, optional = true }
|
frame-system.workspace = true
|
||||||
frame-support = { version = "35.0.0", default-features = false }
|
|
||||||
frame-system = { version = "35.0.0", default-features = false }
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
sp-core = { version = "34.0.0" }
|
sp-core = { default-features = true, workspace = true }
|
||||||
sp-io = { version = "37.0.0" }
|
sp-io = { default-features = true, workspace = true }
|
||||||
sp-runtime = { version = "38.0.0" }
|
sp-runtime = { default-features = true, workspace = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
use crate as pallet_template;
|
use crate as pallet_template;
|
||||||
use frame_support::{derive_impl, traits::ConstU16};
|
use frame_support::derive_impl;
|
||||||
use sp_core::H256;
|
use sp_runtime::BuildStorage;
|
||||||
use sp_runtime::{
|
|
||||||
traits::{BlakeTwo256, IdentityLookup},
|
|
||||||
BuildStorage,
|
|
||||||
};
|
|
||||||
|
|
||||||
type Block = frame_system::mocking::MockBlock<Test>;
|
type Block = frame_system::mocking::MockBlock<Test>;
|
||||||
|
|
||||||
@@ -19,28 +15,7 @@ frame_support::construct_runtime!(
|
|||||||
|
|
||||||
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
|
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
|
||||||
impl frame_system::Config for Test {
|
impl frame_system::Config for Test {
|
||||||
type BaseCallFilter = frame_support::traits::Everything;
|
|
||||||
type BlockWeights = ();
|
|
||||||
type BlockLength = ();
|
|
||||||
type DbWeight = ();
|
|
||||||
type RuntimeOrigin = RuntimeOrigin;
|
|
||||||
type RuntimeCall = RuntimeCall;
|
|
||||||
type Nonce = u64;
|
|
||||||
type Hash = H256;
|
|
||||||
type Hashing = BlakeTwo256;
|
|
||||||
type AccountId = u64;
|
|
||||||
type Lookup = IdentityLookup<Self::AccountId>;
|
|
||||||
type Block = Block;
|
type Block = Block;
|
||||||
type RuntimeEvent = RuntimeEvent;
|
|
||||||
type Version = ();
|
|
||||||
type PalletInfo = PalletInfo;
|
|
||||||
type AccountData = ();
|
|
||||||
type OnNewAccount = ();
|
|
||||||
type OnKilledAccount = ();
|
|
||||||
type SystemWeightInfo = ();
|
|
||||||
type SS58Prefix = ConstU16<42>;
|
|
||||||
type OnSetCode = ();
|
|
||||||
type MaxConsumers = frame_support::traits::ConstU32<16>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pallet_template::Config for Test {
|
impl pallet_template::Config for Test {
|
||||||
|
|||||||
+34
-48
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "solochain-template-runtime"
|
name = "solochain-template-runtime"
|
||||||
description = "A solochain runtime template built with Substrate, part of Polkadot Sdk. (polkadot v1.13.0)"
|
description = "A solochain runtime template built with Substrate, part of Polkadot Sdk. (polkadot v1.15.0)"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
@@ -13,57 +13,44 @@ publish = false
|
|||||||
targets = ["x86_64-unknown-linux-gnu"]
|
targets = ["x86_64-unknown-linux-gnu"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = [
|
codec = { features = [
|
||||||
"derive",
|
"derive",
|
||||||
] }
|
], workspace = true }
|
||||||
scale-info = { version = "2.11.1", default-features = false, features = [
|
scale-info = { features = [
|
||||||
"derive",
|
"derive",
|
||||||
"serde",
|
"serde",
|
||||||
] }
|
], workspace = true }
|
||||||
|
frame-support = { features = ["experimental"], workspace = true }
|
||||||
# frame
|
frame-system.workspace = true
|
||||||
frame-support = { version = "35.0.0", default-features = false, features = ["experimental"] }
|
frame-try-runtime = { optional = true, workspace = true }
|
||||||
frame-system = { version = "35.0.0", default-features = false }
|
frame-executive.workspace = true
|
||||||
frame-try-runtime = { version = "0.41.0", default-features = false, optional = true }
|
pallet-aura.workspace = true
|
||||||
frame-executive = { version = "35.0.0", default-features = false }
|
pallet-balances.workspace = true
|
||||||
|
pallet-grandpa.workspace = true
|
||||||
# frame pallets
|
pallet-sudo.workspace = true
|
||||||
pallet-aura = { version = "34.0.0", default-features = false }
|
pallet-timestamp.workspace = true
|
||||||
pallet-balances = { version = "36.0.0", default-features = false }
|
pallet-transaction-payment.workspace = true
|
||||||
pallet-grandpa = { version = "35.0.0", default-features = false }
|
sp-api.workspace = true
|
||||||
pallet-sudo = { version = "35.0.0", default-features = false }
|
sp-block-builder.workspace = true
|
||||||
pallet-timestamp = { version = "34.0.0", default-features = false }
|
sp-consensus-aura = { features = ["serde"], workspace = true }
|
||||||
pallet-transaction-payment = { version = "35.0.0", default-features = false }
|
sp-consensus-grandpa = { features = ["serde"], workspace = true }
|
||||||
|
sp-core = { features = ["serde"], workspace = true }
|
||||||
# primitives
|
sp-inherents.workspace = true
|
||||||
sp-api = { version = "33.0.0", default-features = false }
|
sp-offchain.workspace = true
|
||||||
sp-block-builder = { version = "33.0.0", default-features = false }
|
sp-runtime = { features = ["serde"], workspace = true }
|
||||||
sp-consensus-aura = { version = "0.39.0", default-features = false, features = ["serde"] }
|
sp-session.workspace = true
|
||||||
sp-consensus-grandpa = { version = "20.0.0", default-features = false, features = ["serde"] }
|
sp-storage.workspace = true
|
||||||
sp-core = { version = "34.0.0", default-features = false, features = ["serde"] }
|
sp-transaction-pool.workspace = true
|
||||||
sp-inherents = { version = "33.0.0", default-features = false }
|
sp-version = { features = ["serde"], workspace = true }
|
||||||
sp-offchain = { version = "33.0.0", default-features = false }
|
sp-genesis-builder.workspace = true
|
||||||
sp-runtime = { version = "38.0.0", default-features = false, features = ["serde"] }
|
frame-system-rpc-runtime-api.workspace = true
|
||||||
sp-session = { version = "34.0.0", default-features = false }
|
pallet-transaction-payment-rpc-runtime-api.workspace = true
|
||||||
sp-std = { version = "14.0.0", default-features = false }
|
frame-benchmarking = { optional = true, workspace = true }
|
||||||
sp-storage = { version = "21.0.0", default-features = false }
|
frame-system-benchmarking = { optional = true, workspace = true }
|
||||||
sp-transaction-pool = { version = "33.0.0", default-features = false }
|
pallet-template.workspace = true
|
||||||
sp-version = { version = "36.0.0", default-features = false, features = ["serde"] }
|
|
||||||
sp-genesis-builder = { version = "0.14.0", default-features = false }
|
|
||||||
|
|
||||||
# RPC related
|
|
||||||
frame-system-rpc-runtime-api = { version = "33.0.0", default-features = false }
|
|
||||||
pallet-transaction-payment-rpc-runtime-api = { version = "35.0.0", default-features = false }
|
|
||||||
|
|
||||||
# Used for runtime benchmarking
|
|
||||||
frame-benchmarking = { version = "35.0.0", default-features = false, optional = true }
|
|
||||||
frame-system-benchmarking = { version = "35.0.0", default-features = false, optional = true }
|
|
||||||
|
|
||||||
# The pallet in this template.
|
|
||||||
pallet-template = { path = "../pallets/template", default-features = false, version = "0.1.0" }
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
substrate-wasm-builder = { version = "23.0.0", optional = true }
|
substrate-wasm-builder = { optional = true, workspace = true, default-features = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
@@ -99,7 +86,6 @@ std = [
|
|||||||
"sp-offchain/std",
|
"sp-offchain/std",
|
||||||
"sp-runtime/std",
|
"sp-runtime/std",
|
||||||
"sp-session/std",
|
"sp-session/std",
|
||||||
"sp-std/std",
|
|
||||||
"sp-storage/std",
|
"sp-storage/std",
|
||||||
"sp-transaction-pool/std",
|
"sp-transaction-pool/std",
|
||||||
"sp-version/std",
|
"sp-version/std",
|
||||||
|
|||||||
+11
-7
@@ -3,6 +3,8 @@
|
|||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
|
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
|
||||||
|
|
||||||
|
extern crate alloc;
|
||||||
|
use alloc::{vec, vec::Vec};
|
||||||
use pallet_grandpa::AuthorityId as GrandpaId;
|
use pallet_grandpa::AuthorityId as GrandpaId;
|
||||||
use sp_api::impl_runtime_apis;
|
use sp_api::impl_runtime_apis;
|
||||||
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
|
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
|
||||||
@@ -13,12 +15,10 @@ use sp_runtime::{
|
|||||||
transaction_validity::{TransactionSource, TransactionValidity},
|
transaction_validity::{TransactionSource, TransactionValidity},
|
||||||
ApplyExtrinsicResult, MultiSignature,
|
ApplyExtrinsicResult, MultiSignature,
|
||||||
};
|
};
|
||||||
use sp_std::prelude::*;
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
use sp_version::NativeVersion;
|
use sp_version::NativeVersion;
|
||||||
use sp_version::RuntimeVersion;
|
use sp_version::RuntimeVersion;
|
||||||
|
|
||||||
use frame_support::genesis_builder_helper::{build_state, get_preset};
|
|
||||||
pub use frame_support::{
|
pub use frame_support::{
|
||||||
construct_runtime, derive_impl, parameter_types,
|
construct_runtime, derive_impl, parameter_types,
|
||||||
traits::{
|
traits::{
|
||||||
@@ -33,6 +33,10 @@ pub use frame_support::{
|
|||||||
},
|
},
|
||||||
StorageValue,
|
StorageValue,
|
||||||
};
|
};
|
||||||
|
use frame_support::{
|
||||||
|
genesis_builder_helper::{build_state, get_preset},
|
||||||
|
traits::VariantCountOf,
|
||||||
|
};
|
||||||
pub use frame_system::Call as SystemCall;
|
pub use frame_system::Call as SystemCall;
|
||||||
pub use pallet_balances::Call as BalancesCall;
|
pub use pallet_balances::Call as BalancesCall;
|
||||||
pub use pallet_timestamp::Call as TimestampCall;
|
pub use pallet_timestamp::Call as TimestampCall;
|
||||||
@@ -218,10 +222,10 @@ impl pallet_balances::Config for Runtime {
|
|||||||
type ExistentialDeposit = ConstU128<EXISTENTIAL_DEPOSIT>;
|
type ExistentialDeposit = ConstU128<EXISTENTIAL_DEPOSIT>;
|
||||||
type AccountStore = System;
|
type AccountStore = System;
|
||||||
type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;
|
type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;
|
||||||
type FreezeIdentifier = ();
|
type FreezeIdentifier = RuntimeFreezeReason;
|
||||||
type MaxFreezes = ();
|
type MaxFreezes = VariantCountOf<RuntimeFreezeReason>;
|
||||||
type RuntimeHoldReason = ();
|
type RuntimeHoldReason = RuntimeHoldReason;
|
||||||
type RuntimeFreezeReason = ();
|
type RuntimeFreezeReason = RuntimeHoldReason;
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
@@ -367,7 +371,7 @@ impl_runtime_apis! {
|
|||||||
Runtime::metadata_at_version(version)
|
Runtime::metadata_at_version(version)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn metadata_versions() -> sp_std::vec::Vec<u32> {
|
fn metadata_versions() -> Vec<u32> {
|
||||||
Runtime::metadata_versions()
|
Runtime::metadata_versions()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user