V3.0.0+monthly 2021 09+1 (#234)
* update to monthly-2021-09+1 * name docs -> doc, correct versions * use monthly-2021-09+1 tag * nix instruction * fmtmain
parent
cd936fca4d
commit
bf528143a5
File diff suppressed because it is too large
Load Diff
|
@ -1,8 +1,9 @@
|
||||||
|
[profile.release]
|
||||||
|
panic = 'unwind'
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
'node',
|
'node',
|
||||||
'pallets/template',
|
'pallets/template',
|
||||||
'runtime',
|
'runtime',
|
||||||
]
|
]
|
||||||
[profile.release]
|
|
||||||
panic = 'unwind'
|
|
||||||
|
|
24
README.md
24
README.md
|
@ -6,17 +6,20 @@ A fresh FRAME-based [Substrate](https://www.substrate.io/) node, ready for hacki
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
Follow the steps below to get started with the Node Template, or get it up and running right from your browser
|
Follow the steps below to get started with the Node Template, or get it up and running right from
|
||||||
in just a few clicks using [Playground](https://playground.substrate.dev/) :hammer_and_wrench:
|
your browser in just a few clicks using [Playground](https://playground.substrate.dev/)
|
||||||
|
:hammer_and_wrench:
|
||||||
|
|
||||||
### Using Nix
|
### Using Nix
|
||||||
|
|
||||||
Install [nix](https://nixos.org/) and optionally [direnv](https://github.com/direnv/direnv) and [lorri](https://github.com/target/lorri) for a fully plug
|
Install [nix](https://nixos.org/) and optionally [direnv](https://github.com/direnv/direnv) and
|
||||||
and play experience for setting up the development environment. To get all the correct dependencies activate direnv `direnv allow` and lorri `lorri shell`.
|
[lorri](https://github.com/target/lorri) for a fully plug and play experience for setting up the
|
||||||
|
development environment. To get all the correct dependencies activate direnv `direnv allow` and
|
||||||
|
lorri `lorri shell`.
|
||||||
|
|
||||||
### Rust Setup
|
### Rust Setup
|
||||||
|
|
||||||
First, complete the [basic Rust setup instructions](./docs/rust-setup.md).
|
First, complete the [basic Rust setup instructions](./doc/rust-setup.md).
|
||||||
|
|
||||||
### Run
|
### Run
|
||||||
|
|
||||||
|
@ -73,12 +76,14 @@ RUST_BACKTRACE=1 ./target/release/node-template -ldebug --dev
|
||||||
### Connect with Polkadot-JS Apps Front-end
|
### Connect with Polkadot-JS Apps Front-end
|
||||||
|
|
||||||
Once the node template is running locally, you can connect it with **Polkadot-JS Apps** front-end
|
Once the node template is running locally, you can connect it with **Polkadot-JS Apps** front-end
|
||||||
to interact with your chain. [Click here](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944) connecting the Apps to your local node template.
|
to interact with your chain. [Click
|
||||||
|
here](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944) connecting the Apps to your
|
||||||
|
local node template.
|
||||||
|
|
||||||
### Multi-Node Local Testnet
|
### Multi-Node Local Testnet
|
||||||
|
|
||||||
If you want to see the multi-node consensus algorithm in action, refer to
|
If you want to see the multi-node consensus algorithm in action, refer to our
|
||||||
[our Start a Private Network tutorial](https://substrate.dev/docs/en/tutorials/start-a-private-network/).
|
[Start a Private Network tutorial](https://substrate.dev/docs/en/tutorials/start-a-private-network/).
|
||||||
|
|
||||||
## Template Structure
|
## Template Structure
|
||||||
|
|
||||||
|
@ -183,7 +188,8 @@ Then run the following command to start a single node development chain.
|
||||||
```
|
```
|
||||||
|
|
||||||
This command will firstly compile your code, and then start a local development network. You can
|
This command will firstly compile your code, and then start a local development network. You can
|
||||||
also replace the default command (`cargo build --release && ./target/release/node-template --dev --ws-external`)
|
also replace the default command
|
||||||
|
(`cargo build --release && ./target/release/node-template --dev --ws-external`)
|
||||||
by appending your own. A few useful ones are as follow.
|
by appending your own. A few useful ones are as follow.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
|
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
|
||||||
|
build = 'build.rs'
|
||||||
description = 'A fresh FRAME-based Substrate node, ready for hacking.'
|
description = 'A fresh FRAME-based Substrate node, ready for hacking.'
|
||||||
edition = '2018'
|
edition = '2018'
|
||||||
homepage = 'https://substrate.dev'
|
homepage = 'https://substrate.dev'
|
||||||
|
@ -7,168 +8,163 @@ license = 'Unlicense'
|
||||||
name = 'node-template'
|
name = 'node-template'
|
||||||
publish = false
|
publish = false
|
||||||
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
||||||
version = '3.0.0-monthly-2021-08'
|
version = '3.0.0-monthly-2021-09+1'
|
||||||
build = 'build.rs'
|
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ['x86_64-unknown-linux-gnu']
|
targets = ['x86_64-unknown-linux-gnu']
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = 'node-template'
|
name = 'node-template'
|
||||||
|
|
||||||
[build-dependencies.substrate-build-script-utils]
|
[build-dependencies.substrate-build-script-utils]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '3.0.0'
|
version = '3.0.0'
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
jsonrpc-core = '18.0.0'
|
||||||
|
structopt = '0.3.8'
|
||||||
|
|
||||||
[dependencies.node-template-runtime]
|
[dependencies.node-template-runtime]
|
||||||
path = '../runtime'
|
path = '../runtime'
|
||||||
version = '3.0.0-monthly-2021-08'
|
version = '3.0.0-monthly-2021-09+1'
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
jsonrpc-core = '15.1.0'
|
|
||||||
structopt = '0.3.8'
|
|
||||||
|
|
||||||
[dependencies.frame-benchmarking]
|
[dependencies.frame-benchmarking]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.frame-benchmarking-cli]
|
[dependencies.frame-benchmarking-cli]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.pallet-transaction-payment-rpc]
|
[dependencies.pallet-transaction-payment-rpc]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-basic-authorship]
|
[dependencies.sc-basic-authorship]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '0.10.0-dev'
|
version = '0.10.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-cli]
|
[dependencies.sc-cli]
|
||||||
features = ['wasmtime']
|
features = ['wasmtime']
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '0.10.0-dev'
|
version = '0.10.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-client-api]
|
[dependencies.sc-client-api]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-consensus]
|
[dependencies.sc-consensus]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '0.10.0-dev'
|
version = '0.10.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-consensus-aura]
|
[dependencies.sc-consensus-aura]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '0.10.0-dev'
|
version = '0.10.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-executor]
|
[dependencies.sc-executor]
|
||||||
features = ['wasmtime']
|
features = ['wasmtime']
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '0.10.0-dev'
|
version = '0.10.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-finality-grandpa]
|
[dependencies.sc-finality-grandpa]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '0.10.0-dev'
|
version = '0.10.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-keystore]
|
[dependencies.sc-keystore]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-rpc]
|
[dependencies.sc-rpc]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-rpc-api]
|
[dependencies.sc-rpc-api]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '0.10.0-dev'
|
version = '0.10.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-service]
|
[dependencies.sc-service]
|
||||||
features = ['wasmtime']
|
features = ['wasmtime']
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '0.10.0-dev'
|
version = '0.10.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-telemetry]
|
[dependencies.sc-telemetry]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-transaction-pool]
|
[dependencies.sc-transaction-pool]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sc-transaction-pool-api]
|
[dependencies.sc-transaction-pool-api]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-api]
|
[dependencies.sp-api]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-block-builder]
|
[dependencies.sp-block-builder]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-blockchain]
|
[dependencies.sp-blockchain]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-consensus]
|
[dependencies.sp-consensus]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '0.10.0-dev'
|
version = '0.10.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-consensus-aura]
|
[dependencies.sp-consensus-aura]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '0.10.0-dev'
|
version = '0.10.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-core]
|
[dependencies.sp-core]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-finality-grandpa]
|
[dependencies.sp-finality-grandpa]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
|
||||||
|
|
||||||
[dependencies.sp-inherents]
|
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
|
||||||
tag = 'monthly-2021-08'
|
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-runtime]
|
[dependencies.sp-runtime]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-timestamp]
|
[dependencies.sp-timestamp]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.substrate-frame-rpc-system]
|
[dependencies.substrate-frame-rpc-system]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|
|
@ -119,7 +119,7 @@ pub fn run() -> sc_cli::Result<()> {
|
||||||
if cfg!(feature = "runtime-benchmarks") {
|
if cfg!(feature = "runtime-benchmarks") {
|
||||||
let runner = cli.create_runner(cmd)?;
|
let runner = cli.create_runner(cmd)?;
|
||||||
|
|
||||||
runner.sync_run(|config| cmd.run::<Block, service::Executor>(config))
|
runner.sync_run(|config| cmd.run::<Block, service::ExecutorDispatch>(config))
|
||||||
} else {
|
} else {
|
||||||
Err("Benchmarking wasn't enabled when building the node. You can enable it with \
|
Err("Benchmarking wasn't enabled when building the node. You can enable it with \
|
||||||
`--features runtime-benchmarks`."
|
`--features runtime-benchmarks`."
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
use node_template_runtime::{self, opaque::Block, RuntimeApi};
|
use node_template_runtime::{self, opaque::Block, RuntimeApi};
|
||||||
use sc_client_api::{ExecutorProvider, RemoteBackend};
|
use sc_client_api::{ExecutorProvider, RemoteBackend};
|
||||||
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
|
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
|
||||||
use sc_executor::native_executor_instance;
|
pub use sc_executor::NativeElseWasmExecutor;
|
||||||
pub use sc_executor::NativeExecutor;
|
|
||||||
use sc_finality_grandpa::SharedVoterState;
|
use sc_finality_grandpa::SharedVoterState;
|
||||||
use sc_keystore::LocalKeystore;
|
use sc_keystore::LocalKeystore;
|
||||||
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
|
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
|
||||||
|
@ -14,14 +13,22 @@ use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
|
||||||
use std::{sync::Arc, time::Duration};
|
use std::{sync::Arc, time::Duration};
|
||||||
|
|
||||||
// Our native executor instance.
|
// Our native executor instance.
|
||||||
native_executor_instance!(
|
pub struct ExecutorDispatch;
|
||||||
pub Executor,
|
|
||||||
node_template_runtime::api::dispatch,
|
|
||||||
node_template_runtime::native_version,
|
|
||||||
frame_benchmarking::benchmarking::HostFunctions,
|
|
||||||
);
|
|
||||||
|
|
||||||
type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;
|
impl sc_executor::NativeExecutionDispatch for ExecutorDispatch {
|
||||||
|
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;
|
||||||
|
|
||||||
|
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
|
||||||
|
node_template_runtime::api::dispatch(method, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn native_version() -> sc_executor::NativeVersion {
|
||||||
|
node_template_runtime::native_version()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type FullClient =
|
||||||
|
sc_service::TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<ExecutorDispatch>>;
|
||||||
type FullBackend = sc_service::TFullBackend<Block>;
|
type FullBackend = sc_service::TFullBackend<Block>;
|
||||||
type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
|
type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
|
||||||
|
|
||||||
|
@ -62,10 +69,17 @@ pub fn new_partial(
|
||||||
})
|
})
|
||||||
.transpose()?;
|
.transpose()?;
|
||||||
|
|
||||||
|
let executor = NativeElseWasmExecutor::<ExecutorDispatch>::new(
|
||||||
|
config.wasm_method,
|
||||||
|
config.default_heap_pages,
|
||||||
|
config.max_runtime_instances,
|
||||||
|
);
|
||||||
|
|
||||||
let (client, backend, keystore_container, task_manager) =
|
let (client, backend, keystore_container, task_manager) =
|
||||||
sc_service::new_full_parts::<Block, RuntimeApi, Executor>(
|
sc_service::new_full_parts::<Block, RuntimeApi, _>(
|
||||||
&config,
|
&config,
|
||||||
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
|
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
|
||||||
|
executor,
|
||||||
)?;
|
)?;
|
||||||
let client = Arc::new(client);
|
let client = Arc::new(client);
|
||||||
|
|
||||||
|
@ -162,6 +176,10 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||||
}
|
}
|
||||||
|
|
||||||
config.network.extra_sets.push(sc_finality_grandpa::grandpa_peers_set_config());
|
config.network.extra_sets.push(sc_finality_grandpa::grandpa_peers_set_config());
|
||||||
|
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
|
||||||
|
backend.clone(),
|
||||||
|
grandpa_link.shared_authority_set().clone(),
|
||||||
|
));
|
||||||
|
|
||||||
let (network, system_rpc_tx, network_starter) =
|
let (network, system_rpc_tx, network_starter) =
|
||||||
sc_service::build_network(sc_service::BuildNetworkParams {
|
sc_service::build_network(sc_service::BuildNetworkParams {
|
||||||
|
@ -172,6 +190,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||||
import_queue,
|
import_queue,
|
||||||
on_demand: None,
|
on_demand: None,
|
||||||
block_announce_validator_builder: None,
|
block_announce_validator_builder: None,
|
||||||
|
warp_sync: Some(warp_sync),
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
if config.offchain_worker.enabled {
|
if config.offchain_worker.enabled {
|
||||||
|
@ -198,7 +217,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||||
let deps =
|
let deps =
|
||||||
crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), deny_unsafe };
|
crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), deny_unsafe };
|
||||||
|
|
||||||
crate::rpc::create_full(deps)
|
Ok(crate::rpc::create_full(deps))
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -325,10 +344,17 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||||
})
|
})
|
||||||
.transpose()?;
|
.transpose()?;
|
||||||
|
|
||||||
|
let executor = NativeElseWasmExecutor::<ExecutorDispatch>::new(
|
||||||
|
config.wasm_method,
|
||||||
|
config.default_heap_pages,
|
||||||
|
config.max_runtime_instances,
|
||||||
|
);
|
||||||
|
|
||||||
let (client, backend, keystore_container, mut task_manager, on_demand) =
|
let (client, backend, keystore_container, mut task_manager, on_demand) =
|
||||||
sc_service::new_light_parts::<Block, RuntimeApi, Executor>(
|
sc_service::new_light_parts::<Block, RuntimeApi, _>(
|
||||||
&config,
|
&config,
|
||||||
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
|
telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()),
|
||||||
|
executor,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let mut telemetry = telemetry.map(|(worker, telemetry)| {
|
let mut telemetry = telemetry.map(|(worker, telemetry)| {
|
||||||
|
@ -380,6 +406,11 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||||
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
telemetry: telemetry.as_ref().map(|x| x.handle()),
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
|
||||||
|
backend.clone(),
|
||||||
|
grandpa_link.shared_authority_set().clone(),
|
||||||
|
));
|
||||||
|
|
||||||
let (network, system_rpc_tx, network_starter) =
|
let (network, system_rpc_tx, network_starter) =
|
||||||
sc_service::build_network(sc_service::BuildNetworkParams {
|
sc_service::build_network(sc_service::BuildNetworkParams {
|
||||||
config: &config,
|
config: &config,
|
||||||
|
@ -389,6 +420,7 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||||
import_queue,
|
import_queue,
|
||||||
on_demand: Some(on_demand.clone()),
|
on_demand: Some(on_demand.clone()),
|
||||||
block_announce_validator_builder: None,
|
block_announce_validator_builder: None,
|
||||||
|
warp_sync: Some(warp_sync),
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
if config.offchain_worker.enabled {
|
if config.offchain_worker.enabled {
|
||||||
|
@ -425,7 +457,7 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
task_manager: &mut task_manager,
|
task_manager: &mut task_manager,
|
||||||
on_demand: Some(on_demand),
|
on_demand: Some(on_demand),
|
||||||
rpc_extensions_builder: Box::new(|_, _| ()),
|
rpc_extensions_builder: Box::new(|_, _| Ok(())),
|
||||||
config,
|
config,
|
||||||
client,
|
client,
|
||||||
keystore: keystore_container.sync_keystore(),
|
keystore: keystore_container.sync_keystore(),
|
||||||
|
|
|
@ -1,37 +1,34 @@
|
||||||
[package]
|
[package]
|
||||||
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
|
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
|
||||||
description = 'Substrate FRAME pallet template for defining custom runtime logic.'
|
description = 'FRAME pallet template for defining custom runtime logic.'
|
||||||
edition = '2018'
|
edition = '2018'
|
||||||
homepage = 'https://substrate.dev'
|
homepage = 'https://substrate.dev'
|
||||||
license = 'Unlicense'
|
license = 'Unlicense'
|
||||||
name = 'pallet-template'
|
name = 'pallet-template'
|
||||||
publish = false
|
publish = false
|
||||||
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
|
||||||
version = '3.0.0-monthly-2021-08'
|
|
||||||
readme = 'README.md'
|
readme = 'README.md'
|
||||||
|
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
||||||
|
version = '3.0.0-monthly-2021-09+1'
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ['x86_64-unknown-linux-gnu']
|
targets = ['x86_64-unknown-linux-gnu']
|
||||||
|
|
||||||
[dev-dependencies.serde]
|
|
||||||
version = '1.0.126'
|
|
||||||
|
|
||||||
[dev-dependencies.sp-core]
|
[dev-dependencies.sp-core]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dev-dependencies.sp-io]
|
[dev-dependencies.sp-io]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dev-dependencies.sp-runtime]
|
[dev-dependencies.sp-runtime]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.codec]
|
[dependencies.codec]
|
||||||
|
@ -44,19 +41,19 @@ version = '2.0.0'
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
optional = true
|
optional = true
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.frame-support]
|
[dependencies.frame-support]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.frame-system]
|
[dependencies.frame-system]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
@ -68,4 +65,4 @@ std = [
|
||||||
'frame-system/std',
|
'frame-system/std',
|
||||||
'frame-benchmarking/std',
|
'frame-benchmarking/std',
|
||||||
]
|
]
|
||||||
try-runtime = ['frame-support/try-runtime']
|
try-runtime = ['frame-support/try-runtime']
|
||||||
|
|
|
@ -28,7 +28,7 @@ parameter_types! {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl system::Config for Test {
|
impl system::Config for Test {
|
||||||
type BaseCallFilter = frame_support::traits::AllowAll;
|
type BaseCallFilter = frame_support::traits::Everything;
|
||||||
type BlockWeights = ();
|
type BlockWeights = ();
|
||||||
type BlockLength = ();
|
type BlockLength = ();
|
||||||
type DbWeight = ();
|
type DbWeight = ();
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
[package]
|
[package]
|
||||||
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
|
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
|
||||||
description = 'Substrate FRAME based template for composing and building WASM runtimes.'
|
|
||||||
edition = '2018'
|
edition = '2018'
|
||||||
homepage = 'https://substrate.dev'
|
homepage = 'https://substrate.dev'
|
||||||
license = 'Unlicense'
|
license = 'Unlicense'
|
||||||
name = 'node-template-runtime'
|
name = 'node-template-runtime'
|
||||||
publish = false
|
publish = false
|
||||||
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
||||||
version = '3.0.0-monthly-2021-08'
|
version = '3.0.0-monthly-2021-09+1'
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
targets = ['x86_64-unknown-linux-gnu']
|
targets = ['x86_64-unknown-linux-gnu']
|
||||||
|
@ -15,11 +14,11 @@ targets = ['x86_64-unknown-linux-gnu']
|
||||||
[dependencies.pallet-template]
|
[dependencies.pallet-template]
|
||||||
default-features = false
|
default-features = false
|
||||||
path = '../pallets/template'
|
path = '../pallets/template'
|
||||||
version = '3.0.0-monthly-2021-08'
|
version = '3.0.0-monthly-2021-09+1'
|
||||||
|
|
||||||
[build-dependencies.substrate-wasm-builder]
|
[build-dependencies.substrate-wasm-builder]
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '5.0.0-dev'
|
version = '5.0.0-dev'
|
||||||
|
|
||||||
[dependencies.codec]
|
[dependencies.codec]
|
||||||
|
@ -32,38 +31,38 @@ version = '2.0.0'
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
optional = true
|
optional = true
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.frame-executive]
|
[dependencies.frame-executive]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.frame-support]
|
[dependencies.frame-support]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.frame-system]
|
[dependencies.frame-system]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.frame-system-benchmarking]
|
[dependencies.frame-system-benchmarking]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
optional = true
|
optional = true
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.frame-system-rpc-runtime-api]
|
[dependencies.frame-system-rpc-runtime-api]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.hex-literal]
|
[dependencies.hex-literal]
|
||||||
|
@ -73,115 +72,115 @@ version = '0.3.1'
|
||||||
[dependencies.pallet-aura]
|
[dependencies.pallet-aura]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.pallet-balances]
|
[dependencies.pallet-balances]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.pallet-grandpa]
|
[dependencies.pallet-grandpa]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.pallet-randomness-collective-flip]
|
[dependencies.pallet-randomness-collective-flip]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.pallet-sudo]
|
[dependencies.pallet-sudo]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.pallet-timestamp]
|
[dependencies.pallet-timestamp]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.pallet-transaction-payment]
|
[dependencies.pallet-transaction-payment]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.pallet-transaction-payment-rpc-runtime-api]
|
[dependencies.pallet-transaction-payment-rpc-runtime-api]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-api]
|
[dependencies.sp-api]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-block-builder]
|
[dependencies.sp-block-builder]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-consensus-aura]
|
[dependencies.sp-consensus-aura]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '0.10.0-dev'
|
version = '0.10.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-core]
|
[dependencies.sp-core]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-inherents]
|
[dependencies.sp-inherents]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-offchain]
|
[dependencies.sp-offchain]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-runtime]
|
[dependencies.sp-runtime]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-session]
|
[dependencies.sp-session]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-std]
|
[dependencies.sp-std]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-transaction-pool]
|
[dependencies.sp-transaction-pool]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[dependencies.sp-version]
|
[dependencies.sp-version]
|
||||||
default-features = false
|
default-features = false
|
||||||
git = 'https://github.com/paritytech/substrate.git'
|
git = 'https://github.com/paritytech/substrate.git'
|
||||||
tag = 'monthly-2021-08'
|
tag = 'monthly-2021-09+1'
|
||||||
version = '4.0.0-dev'
|
version = '4.0.0-dev'
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|
|
@ -144,7 +144,7 @@ parameter_types! {
|
||||||
|
|
||||||
impl frame_system::Config for Runtime {
|
impl frame_system::Config for Runtime {
|
||||||
/// The basic call filter to use in dispatchable.
|
/// The basic call filter to use in dispatchable.
|
||||||
type BaseCallFilter = frame_support::traits::AllowAll;
|
type BaseCallFilter = frame_support::traits::Everything;
|
||||||
/// Block & extrinsics weights: base values and limits.
|
/// Block & extrinsics weights: base values and limits.
|
||||||
type BlockWeights = BlockWeights;
|
type BlockWeights = BlockWeights;
|
||||||
/// The maximum length of a block (in bytes).
|
/// The maximum length of a block (in bytes).
|
||||||
|
@ -197,6 +197,7 @@ impl pallet_randomness_collective_flip::Config for Runtime {}
|
||||||
|
|
||||||
impl pallet_aura::Config for Runtime {
|
impl pallet_aura::Config for Runtime {
|
||||||
type AuthorityId = AuraId;
|
type AuthorityId = AuraId;
|
||||||
|
type DisabledValidators = ();
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pallet_grandpa::Config for Runtime {
|
impl pallet_grandpa::Config for Runtime {
|
||||||
|
@ -402,6 +403,10 @@ impl_runtime_apis! {
|
||||||
Grandpa::grandpa_authorities()
|
Grandpa::grandpa_authorities()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn current_set_id() -> fg_primitives::SetId {
|
||||||
|
Grandpa::current_set_id()
|
||||||
|
}
|
||||||
|
|
||||||
fn submit_report_equivocation_unsigned_extrinsic(
|
fn submit_report_equivocation_unsigned_extrinsic(
|
||||||
_equivocation_proof: fg_primitives::EquivocationProof<
|
_equivocation_proof: fg_primitives::EquivocationProof<
|
||||||
<Block as BlockT>::Hash,
|
<Block as BlockT>::Hash,
|
||||||
|
@ -446,14 +451,30 @@ impl_runtime_apis! {
|
||||||
|
|
||||||
#[cfg(feature = "runtime-benchmarks")]
|
#[cfg(feature = "runtime-benchmarks")]
|
||||||
impl frame_benchmarking::Benchmark<Block> for Runtime {
|
impl frame_benchmarking::Benchmark<Block> for Runtime {
|
||||||
|
fn benchmark_metadata(extra: bool) -> (
|
||||||
|
Vec<frame_benchmarking::BenchmarkList>,
|
||||||
|
Vec<frame_support::traits::StorageInfo>,
|
||||||
|
) {
|
||||||
|
use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};
|
||||||
|
use frame_support::traits::StorageInfoTrait;
|
||||||
|
use frame_system_benchmarking::Pallet as SystemBench;
|
||||||
|
|
||||||
|
let mut list = Vec::<BenchmarkList>::new();
|
||||||
|
|
||||||
|
list_benchmark!(list, extra, frame_system, SystemBench::<Runtime>);
|
||||||
|
list_benchmark!(list, extra, pallet_balances, Balances);
|
||||||
|
list_benchmark!(list, extra, pallet_timestamp, Timestamp);
|
||||||
|
list_benchmark!(list, extra, pallet_template, TemplateModule);
|
||||||
|
|
||||||
|
let storage_info = AllPalletsWithSystem::storage_info();
|
||||||
|
|
||||||
|
return (list, storage_info)
|
||||||
|
}
|
||||||
|
|
||||||
fn dispatch_benchmark(
|
fn dispatch_benchmark(
|
||||||
config: frame_benchmarking::BenchmarkConfig
|
config: frame_benchmarking::BenchmarkConfig
|
||||||
) -> Result<
|
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
|
||||||
(Vec<frame_benchmarking::BenchmarkBatch>, Vec<StorageInfo>),
|
|
||||||
sp_runtime::RuntimeString,
|
|
||||||
> {
|
|
||||||
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
|
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
|
||||||
use frame_support::traits::StorageInfoTrait;
|
|
||||||
|
|
||||||
use frame_system_benchmarking::Pallet as SystemBench;
|
use frame_system_benchmarking::Pallet as SystemBench;
|
||||||
impl frame_system_benchmarking::Config for Runtime {}
|
impl frame_system_benchmarking::Config for Runtime {}
|
||||||
|
@ -471,8 +492,6 @@ impl_runtime_apis! {
|
||||||
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),
|
hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),
|
||||||
];
|
];
|
||||||
|
|
||||||
let storage_info = AllPalletsWithSystem::storage_info();
|
|
||||||
|
|
||||||
let mut batches = Vec::<BenchmarkBatch>::new();
|
let mut batches = Vec::<BenchmarkBatch>::new();
|
||||||
let params = (&config, &whitelist);
|
let params = (&config, &whitelist);
|
||||||
|
|
||||||
|
@ -482,7 +501,7 @@ impl_runtime_apis! {
|
||||||
add_benchmark!(params, batches, pallet_template, TemplateModule);
|
add_benchmark!(params, batches, pallet_template, TemplateModule);
|
||||||
|
|
||||||
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
|
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
|
||||||
Ok((batches, storage_info))
|
Ok(batches)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,9 @@ imports_granularity = "Crate"
|
||||||
reorder_imports = true
|
reorder_imports = true
|
||||||
# Consistency
|
# Consistency
|
||||||
newline_style = "Unix"
|
newline_style = "Unix"
|
||||||
normalize_comments = true
|
# Format comments
|
||||||
normalize_doc_attributes = true
|
comment_width = 100
|
||||||
|
wrap_comments = true
|
||||||
# Misc
|
# Misc
|
||||||
chain_width = 80
|
chain_width = 80
|
||||||
spaces_around_ranges = false
|
spaces_around_ranges = false
|
||||||
|
|
Loading…
Reference in New Issue