23 Commits

Author SHA1 Message Date
Przemek Rzad d7a09baa65 Add a CI job to make sure relaychain produces blocks (#16) 2024-08-09 18:06:31 +02:00
Przemek Rzad 1b627cdddb Add missing features (#15) 2024-08-08 18:40:21 +02:00
Przemek Rzad b6770d6a5f Add an automatic PR reminder (#14) 2024-08-08 15:06:14 +02:00
Javier Bullrich 331e79d33f added CI tests for macOS (#13)
Added a matrix to run the CI jobs, using both `ubuntu-latest` and
`macos-latest`.
2024-08-08 12:52:38 +01:00
Javier Bullrich 7f8d3d018c Revert "TEST - added df command"
This reverts commit 1f38756e28.
2024-08-08 13:26:07 +02:00
Javier Bullrich 1f38756e28 TEST - added df command 2024-08-08 12:42:02 +02:00
Javier Bullrich b56b85e852 removed docker mac building step
Based on this discussion, Docker daemon is not supported in macos images: https://github.com/orgs/community/discussions/69211#discussioncomment-7242133
2024-08-08 12:01:50 +02:00
Javier Bullrich 7b2ebf016f added more missing deps 2024-08-08 11:37:59 +02:00
Javier Bullrich 33067c2c1f added wasm32 toolchain 2024-08-08 11:11:46 +02:00
Javier Bullrich a5e12feede added missing installation 2024-08-08 10:56:22 +02:00
Javier Bullrich 4c84ccd239 added -y to cargo install 2024-08-08 10:25:47 +02:00
Przemek Rzad 106c604993 Update ci.yml 2024-08-08 09:13:29 +02:00
Przemek Rzad 670c29ab86 Update ci.yml 2024-08-08 09:10:39 +02:00
Javier Bullrich 4b900d3081 removed invalid workflow 2024-08-07 12:56:12 +02:00
Javier Bullrich 722657deda added some tests
more debug log

more test

another test

trying with brackets
2024-08-07 12:53:30 +02:00
Javier Bullrich 5718deb606 added docker to macos machine 2024-08-07 12:43:48 +02:00
Javier Bullrich 8ad0586c25 implemented contains 2024-08-07 12:41:40 +02:00
github-actions[bot] a150b7ee98 added installation of cargo for macos 2024-08-07 12:35:17 +02:00
github-actions[bot] 78fbe0b4c3 updated checkout image 2024-08-07 12:35:02 +02:00
github-actions[bot] 85e9f2d04b added CI tests for macOS 2024-08-07 11:35:51 +02:00
Template Bot 888d8eb81a Update to stable2407 triggered by workflow_dispatch 2024-08-01 09:48:49 +00:00
Przemek Rzad ce9fbe59b7 Skip WASM build for tests and docs (#10) 2024-07-23 14:51:49 +02:00
Template Bot 91e66fc7ea Update to 1.14.0 triggered by workflow_dispatch 2024-07-18 12:54:15 +00:00
17 changed files with 1277 additions and 928 deletions
@@ -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
View File
@@ -12,30 +12,20 @@ concurrency:
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Rust compilation prerequisites
run: |
sudo apt update
sudo apt install -y \
protobuf-compiler
rustup target add wasm32-unknown-unknown
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
- 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 template
run: cargo build
@@ -48,29 +38,46 @@ jobs:
timeout-minutes: 30
- name: Run the tests
run: cargo test
run: SKIP_WASM_BUILD=1 cargo test
timeout-minutes: 15
- 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
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 minimal-template-node --release
timeout-minutes: 90
- name: Make sure the node is producing blocks
run: |
./target/release/minimal-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:
runs-on: ubuntu-latest
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.
- 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
- uses: ./.github/actions/free-disk-space
- name: Build the Dockerfile
run: docker build . -t polkadot-sdk-minimal-template
+24
View File
@@ -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/minimal).'
})
Generated
+1010 -801
View File
File diff suppressed because it is too large Load Diff
+40 -1
View File
@@ -1,7 +1,7 @@
[workspace.package]
license = "MIT-0"
authors = ["Parity Technologies <admin@parity.io>"]
homepage = "https://substrate.io"
homepage = "https://paritytech.github.io/polkadot-sdk/"
repository = "https://github.com/paritytech/polkadot-sdk-minimal-template.git"
edition = "2021"
@@ -14,4 +14,43 @@ members = [
resolver = "2"
[workspace.dependencies]
minimal-template-runtime = { path = "./runtime", default-features = false }
pallet-minimal-template = { path = "./pallets/template", default-features = false }
clap = { version = "4.5.3" }
docify = { version = "0.2.8" }
frame = { version = "0.6.0", default-features = false, package = "polkadot-sdk-frame" }
futures = { version = "0.3.30" }
futures-timer = { version = "3.0.2" }
jsonrpsee = { version = "0.23.2" }
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-manual-seal = { version = "0.45.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 }
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-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" }
pallet-balances = { version = "38.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 = { version = "37.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 }
substrate-wasm-builder = { version = "24.0.0", default-features = false }
+19 -18
View File
@@ -11,12 +11,13 @@
</div>
🤏 This template is a minimal (in terms of complexity and the number of components) template for building a blockchain node.
* 🤏 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
* 🔧 Its runtime is configured with 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.
* 👤 The template has no consensus configured - it is best for experimenting with a single node network.
## Template Structure
@@ -28,12 +29,12 @@ A Polkadot SDK based project such as this one consists of:
## Getting Started
🦀 The template is using the Rust language.
* 🦀 The template is using the Rust language.
👉 Check the
* 👉 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
* 🛠️ 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
@@ -41,7 +42,7 @@ packages required to compile this template - please take note of the Rust compil
🔨 Use the following command to build the node without launching it:
```sh
cargo build --release
cargo build --package minimal-template-node --release
```
🐳 Alternatively, build the docker image:
@@ -64,37 +65,37 @@ 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.
* 💰 Are pre-configured with a genesis state that includes several pre-funded development accounts.
* 🧑‍⚖️ One development account (`ALICE`) is used as `sudo` accounts.
### Connect with the Polkadot-JS Apps Front-End
🌐 You can interact with your local node using the
* 🌐 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
* 🪐 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
* 🧑‍🔧 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).
* 🔄 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).
* ➡️ 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
* 😇 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.
* 🧑‍🏫 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
* 🧑‍🔧 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
* 👥 Additionally, there are [GitHub issues](https://github.com/paritytech/polkadot-sdk/issues) and
[Substrate StackExchange](https://substrate.stackexchange.com/).
+56 -33
View File
@@ -1,6 +1,6 @@
[package]
name = "minimal-template-node"
description = "A minimal Substrate-based Substrate node, ready for hacking. (polkadot v1.13.0)"
description = "A minimal Substrate-based Substrate node, ready for hacking. (polkadot v1.15.0)"
version = "0.1.0"
license = "Unlicense"
authors.workspace = true
@@ -14,40 +14,63 @@ build = "build.rs"
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
clap = { version = "4.5.3", features = ["derive"] }
futures = { version = "0.3.30", features = ["thread-pool"] }
futures-timer = "3.0.1"
jsonrpsee = { version = "0.22", features = ["server"] }
docify = { workspace = true }
clap = { features = ["derive"], workspace = true }
futures = { features = ["thread-pool"], workspace = true }
futures-timer = { workspace = true }
jsonrpsee = { features = ["server"], workspace = true }
serde_json = { workspace = true, default-features = true }
sc-cli = { version = "0.43.0" }
sc-executor = { version = "0.39.0" }
sc-network = { version = "0.41.0" }
sc-service = { version = "0.42.0" }
sc-telemetry = { version = "21.0.0" }
sc-transaction-pool = { version = "35.0.0" }
sc-transaction-pool-api = { version = "35.0.0" }
sc-consensus = { version = "0.40.0" }
sc-consensus-manual-seal = { version = "0.42.0" }
sc-rpc-api = { version = "0.40.0" }
sc-basic-authorship = { version = "0.41.0" }
sc-offchain = { version = "36.0.0" }
sc-client-api = { version = "35.0.0" }
sp-timestamp = { version = "33.0.0" }
sp-keyring = { version = "38.0.0" }
sp-api = { version = "33.0.0" }
sp-blockchain = { version = "35.0.0" }
sp-block-builder = { version = "33.0.0" }
sp-io = { version = "37.0.0" }
sp-runtime = { version = "38.0.0" }
substrate-frame-rpc-system = { version = "35.0.0" }
# Once the native runtime is gone, there should be little to no dependency on FRAME here, and
# certainly no dependency on the runtime.
frame = { version = "0.4.0", package = "polkadot-sdk-frame", features = ["experimental", "runtime"] }
runtime = { package = "minimal-template-runtime", path = "../runtime", version = "0.1.0" }
sc-cli.workspace = true
sc-cli.default-features = true
sc-executor.workspace = true
sc-executor.default-features = true
sc-network.workspace = true
sc-network.default-features = true
sc-service.workspace = true
sc-service.default-features = true
sc-telemetry.workspace = true
sc-telemetry.default-features = true
sc-transaction-pool.workspace = true
sc-transaction-pool.default-features = true
sc-transaction-pool-api.workspace = true
sc-transaction-pool-api.default-features = true
sc-consensus.workspace = true
sc-consensus.default-features = true
sc-consensus-manual-seal.workspace = true
sc-consensus-manual-seal.default-features = true
sc-rpc-api.workspace = true
sc-rpc-api.default-features = true
sc-basic-authorship.workspace = true
sc-basic-authorship.default-features = true
sc-offchain.workspace = true
sc-offchain.default-features = true
sc-client-api.workspace = true
sc-client-api.default-features = true
sp-timestamp.workspace = true
sp-timestamp.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
sp-io.workspace = true
sp-io.default-features = true
sp-runtime.workspace = true
sp-runtime.default-features = true
substrate-frame-rpc-system.workspace = true
substrate-frame-rpc-system.default-features = true
frame = { features = ["experimental", "runtime"], workspace = true, default-features = true }
minimal-template-runtime.workspace = true
[build-dependencies]
substrate-build-script-utils = { version = "11.0.0" }
substrate-build-script-utils.workspace = true
substrate-build-script-utils.default-features = true
[features]
default = []
default = ["std"]
std = [
"minimal-template-runtime/std",
]
+2 -2
View File
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use runtime::{BalancesConfig, SudoConfig, WASM_BINARY};
use minimal_template_runtime::{BalancesConfig, SudoConfig, WASM_BINARY};
use sc_service::{ChainType, Properties};
use serde_json::{json, Value};
use sp_keyring::AccountKeyring;
@@ -43,7 +43,7 @@ pub fn development_config() -> Result<ChainSpec, String> {
/// Configure initial storage state for FRAME pallets.
fn testnet_genesis() -> Value {
use frame::traits::Get;
use runtime::interface::{Balance, MinimumBalance};
use minimal_template_runtime::interface::{Balance, MinimumBalance};
let endowment = <MinimumBalance as Get<Balance>>::get().max(1) * 1000;
let balances = AccountKeyring::iter()
.map(|a| (a.to_account_id(), endowment))
+3 -1
View File
@@ -114,7 +114,9 @@ pub fn run() -> sc_cli::Result<()> {
},
Some(Subcommand::ChainInfo(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run::<runtime::interface::OpaqueBlock>(&config))
runner.sync_run(|config| {
cmd.run::<minimal_template_runtime::interface::OpaqueBlock>(&config)
})
},
None => {
let runner = cli.create_runner(&cli.run)?;
+3 -2
View File
@@ -23,11 +23,10 @@
#![warn(missing_docs)]
use jsonrpsee::RpcModule;
use runtime::interface::{AccountId, Nonce, OpaqueBlock};
use minimal_template_runtime::interface::{AccountId, Nonce, OpaqueBlock};
use sc_transaction_pool_api::TransactionPool;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
use std::sync::Arc;
use substrate_frame_rpc_system::{System, SystemApiServer};
pub use sc_rpc_api::DenyUnsafe;
@@ -41,6 +40,7 @@ pub struct FullDeps<C, P> {
pub deny_unsafe: DenyUnsafe,
}
#[docify::export]
/// Instantiate all full RPC extensions.
pub fn create_full<C, P>(
deps: FullDeps<C, P>,
@@ -57,6 +57,7 @@ where
C::Api: substrate_frame_rpc_system::AccountNonceApi<OpaqueBlock, AccountId, Nonce>,
P: TransactionPool + 'static,
{
use substrate_frame_rpc_system::{System, SystemApiServer};
let mut module = RpcModule::new(());
let FullDeps { client, pool, deny_unsafe } = deps;
+3 -1
View File
@@ -16,7 +16,7 @@
// limitations under the License.
use futures::FutureExt;
use runtime::{self, interface::OpaqueBlock as Block, RuntimeApi};
use minimal_template_runtime::{interface::OpaqueBlock as Block, RuntimeApi};
use sc_client_api::backend::Backend;
use sc_executor::WasmExecutor;
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
@@ -34,8 +34,10 @@ type HostFunctions =
#[cfg(not(feature = "runtime-benchmarks"))]
type HostFunctions = sp_io::SubstrateHostFunctions;
#[docify::export]
pub(crate) type FullClient =
sc_service::TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>;
type FullBackend = sc_service::TFullBackend<Block>;
type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
+6 -6
View File
@@ -1,6 +1,6 @@
[package]
name = "pallet-minimal-template"
description = "A minimal pallet built with FRAME, part of Polkadot Sdk. (polkadot v1.13.0)"
description = "A minimal pallet built with FRAME, part of Polkadot Sdk. (polkadot v1.15.0)"
version = "0.1.0"
license = "Unlicense"
authors.workspace = true
@@ -13,13 +13,13 @@ publish = false
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.12", features = [
codec = { features = [
"derive",
], default-features = false }
scale-info = { version = "2.11.1", default-features = false, features = [
], workspace = true }
scale-info = { features = [
"derive",
] }
frame = { version = "0.4.0", package = "polkadot-sdk-frame", default-features = false, features = ["experimental", "runtime"] }
], workspace = true }
frame = { features = ["experimental", "runtime"], workspace = true }
[features]
+3
View File
@@ -1,4 +1,7 @@
//! A shell pallet built with [`frame`].
//!
//! To get started with this pallet, try implementing the guide in
//! <https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/guides/your_first_pallet/index.html>
#![cfg_attr(not(feature = "std"), no_std)]
+13 -21
View File
@@ -1,6 +1,6 @@
[package]
name = "minimal-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"
license = "Unlicense"
authors.workspace = true
@@ -10,28 +10,20 @@ edition.workspace = true
publish = false
[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false }
scale-info = { version = "2.6.0", default-features = false }
# this is a frame-based runtime, thus importing `frame` with runtime feature enabled.
frame = { version = "0.4.0", package = "polkadot-sdk-frame", default-features = false, features = ["experimental", "runtime"] }
# pallets that we want to use
pallet-balances = { version = "36.0.0", default-features = false }
pallet-sudo = { version = "35.0.0", default-features = false }
pallet-timestamp = { version = "34.0.0", default-features = false }
pallet-transaction-payment = { version = "35.0.0", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { version = "35.0.0", default-features = false }
# genesis builder that allows us to interact with runtime genesis config
sp-genesis-builder = { version = "0.14.0", default-features = false }
sp-runtime = { version = "38.0.0", default-features = false, features = ["serde"] }
# local pallet templates
pallet-minimal-template = { path = "../pallets/template", default-features = false, version = "0.1.0" }
codec = { workspace = true }
scale-info = { workspace = true }
frame = { features = ["experimental", "runtime"], workspace = true }
pallet-balances.workspace = true
pallet-sudo.workspace = true
pallet-timestamp.workspace = true
pallet-transaction-payment.workspace = true
pallet-transaction-payment-rpc-runtime-api.workspace = true
sp-genesis-builder.workspace = true
sp-runtime = { features = ["serde"], workspace = true }
pallet-minimal-template.workspace = true
[build-dependencies]
substrate-wasm-builder = { version = "23.0.0", optional = true }
substrate-wasm-builder = { optional = true, workspace = true, default-features = true }
[features]
default = ["std"]
+9 -6
View File
@@ -23,6 +23,9 @@
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
extern crate alloc;
use alloc::{vec, vec::Vec};
use frame::{
deps::frame_support::{
genesis_builder_helper::{build_state, get_preset},
@@ -99,27 +102,27 @@ mod runtime {
/// Mandatory system pallet that should always be included in a FRAME runtime.
#[runtime::pallet_index(0)]
pub type System = frame_system;
pub type System = frame_system::Pallet<Runtime>;
/// Provides a way for consensus systems to set and check the onchain time.
#[runtime::pallet_index(1)]
pub type Timestamp = pallet_timestamp;
pub type Timestamp = pallet_timestamp::Pallet<Runtime>;
/// Provides the ability to keep track of balances.
#[runtime::pallet_index(2)]
pub type Balances = pallet_balances;
pub type Balances = pallet_balances::Pallet<Runtime>;
/// Provides a way to execute privileged functions.
#[runtime::pallet_index(3)]
pub type Sudo = pallet_sudo;
pub type Sudo = pallet_sudo::Pallet<Runtime>;
/// Provides the ability to charge for extrinsic execution.
#[runtime::pallet_index(4)]
pub type TransactionPayment = pallet_transaction_payment;
pub type TransactionPayment = pallet_transaction_payment::Pallet<Runtime>;
/// A minimal pallet template.
#[runtime::pallet_index(5)]
pub type Template = pallet_minimal_template;
pub type Template = pallet_minimal_template::Pallet<Runtime>;
}
parameter_types! {