parent
3323afae5a
commit
38058f3ef0
File diff suppressed because it is too large
Load Diff
11
README.md
11
README.md
|
@ -1,11 +1,6 @@
|
|||
# Substrate Node Template
|
||||
|
||||
A new Substrate node, ready for hacking. This node includes:
|
||||
|
||||
* A FRAME-based runtime
|
||||
* A template pallet
|
||||
* Aura block authoring
|
||||
* Grandpa finality gadget
|
||||
A new FRAME-based Substrate node, ready for hacking.
|
||||
|
||||
## Build
|
||||
|
||||
|
@ -61,7 +56,7 @@ cargo run -- \
|
|||
--chain=local \
|
||||
--alice \
|
||||
--node-key 0000000000000000000000000000000000000000000000000000000000000001 \
|
||||
--telemetry-url ws://telemetry.polkadot.io:1024 \
|
||||
--telemetry-url 'ws://telemetry.polkadot.io:1024 0' \
|
||||
--validator
|
||||
```
|
||||
|
||||
|
@ -74,7 +69,7 @@ cargo run -- \
|
|||
--chain=local \
|
||||
--bob \
|
||||
--port 30334 \
|
||||
--telemetry-url ws://telemetry.polkadot.io:1024 \
|
||||
--telemetry-url 'ws://telemetry.polkadot.io:1024 0' \
|
||||
--validator
|
||||
```
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
[package]
|
||||
authors = ['Anonymous']
|
||||
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
|
||||
build = 'build.rs'
|
||||
description = 'Substrate Node template'
|
||||
description = 'Substrate node template'
|
||||
edition = '2018'
|
||||
homepage = 'https://substrate.dev'
|
||||
homepage = 'https://substrate.io'
|
||||
license = 'Unlicense'
|
||||
name = 'node-template'
|
||||
repository = 'https://github.com/paritytech/substrate/'
|
||||
version = '2.0.0-alpha.7'
|
||||
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ['x86_64-unknown-linux-gnu']
|
||||
|
@ -15,93 +15,102 @@ targets = ['x86_64-unknown-linux-gnu']
|
|||
[dependencies]
|
||||
futures = '0.3.4'
|
||||
log = '0.4.8'
|
||||
parking_lot = '0.10.0'
|
||||
structopt = '0.3.8'
|
||||
|
||||
[dependencies.node-template-runtime]
|
||||
path = '../runtime'
|
||||
version = '2.0.0-alpha.7'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sc-basic-authorship]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
version = '0.8.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '0.8.0-alpha.8'
|
||||
|
||||
[dependencies.sc-cli]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
version = '0.8.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '0.8.0-alpha.8'
|
||||
|
||||
[dependencies.sc-client-api]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sc-consensus]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
version = '0.8.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '0.8.0-alpha.8'
|
||||
|
||||
[dependencies.sc-consensus-aura]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
version = '0.8.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '0.8.0-alpha.8'
|
||||
|
||||
[dependencies.sc-executor]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
version = '0.8.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '0.8.0-alpha.8'
|
||||
|
||||
[dependencies.sc-finality-grandpa]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
version = '0.8.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '0.8.0-alpha.8'
|
||||
|
||||
[dependencies.sc-network]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
version = '0.8.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '0.8.0-alpha.8'
|
||||
|
||||
[dependencies.sc-service]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
version = '0.8.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '0.8.0-alpha.8'
|
||||
|
||||
[dependencies.sc-transaction-pool]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-consensus]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
version = '0.8.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '0.8.0-alpha.8'
|
||||
|
||||
[dependencies.sp-consensus-aura]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
version = '0.8.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '0.8.0-alpha.8'
|
||||
|
||||
[dependencies.sp-core]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-finality-grandpa]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-inherents]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-runtime]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-transaction-pool]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[build-dependencies.substrate-build-script-utils]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[[bin]]
|
||||
name = 'node-template'
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
// Copyright 2017-2020 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Substrate.
|
||||
|
||||
// Substrate is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Substrate is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use crate::chain_spec;
|
||||
use crate::cli::Cli;
|
||||
use crate::service;
|
||||
use sc_cli::SubstrateCli;
|
||||
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
|
||||
|
||||
impl SubstrateCli for Cli {
|
||||
fn impl_name() -> &'static str {
|
||||
|
|
|
@ -11,7 +11,7 @@ use sc_executor::native_executor_instance;
|
|||
pub use sc_executor::NativeExecutor;
|
||||
use sp_consensus_aura::sr25519::{AuthorityPair as AuraPair};
|
||||
use sc_finality_grandpa::{
|
||||
self, FinalityProofProvider as GrandpaFinalityProofProvider, SharedVoterState, StorageAndProofProvider
|
||||
FinalityProofProvider as GrandpaFinalityProofProvider, StorageAndProofProvider, SharedVoterState,
|
||||
};
|
||||
|
||||
// Our native executor instance.
|
||||
|
@ -28,6 +28,8 @@ native_executor_instance!(
|
|||
macro_rules! new_full_start {
|
||||
($config:expr) => {{
|
||||
use std::sync::Arc;
|
||||
use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
|
||||
|
||||
let mut import_setup = None;
|
||||
let inherent_data_providers = sp_inherents::InherentDataProviders::new();
|
||||
|
||||
|
@ -41,12 +43,22 @@ macro_rules! new_full_start {
|
|||
let pool_api = sc_transaction_pool::FullChainApi::new(client.clone());
|
||||
Ok(sc_transaction_pool::BasicPool::new(config, std::sync::Arc::new(pool_api), prometheus_registry))
|
||||
})?
|
||||
.with_import_queue(|_config, client, mut select_chain, _transaction_pool, spawn_task_handle| {
|
||||
.with_import_queue(|
|
||||
_config,
|
||||
client,
|
||||
mut select_chain,
|
||||
_transaction_pool,
|
||||
spawn_task_handle,
|
||||
registry,
|
||||
| {
|
||||
let select_chain = select_chain.take()
|
||||
.ok_or_else(|| sc_service::Error::SelectChainRequired)?;
|
||||
|
||||
let (grandpa_block_import, grandpa_link) =
|
||||
sc_finality_grandpa::block_import(client.clone(), &(client.clone() as Arc<_>), select_chain)?;
|
||||
let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
|
||||
client.clone(),
|
||||
&(client.clone() as Arc<_>),
|
||||
select_chain,
|
||||
)?;
|
||||
|
||||
let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(
|
||||
grandpa_block_import.clone(), client.clone(),
|
||||
|
@ -60,6 +72,7 @@ macro_rules! new_full_start {
|
|||
client,
|
||||
inherent_data_providers.clone(),
|
||||
spawn_task_handle,
|
||||
registry,
|
||||
)?;
|
||||
|
||||
import_setup = Some((grandpa_block_import, grandpa_link));
|
||||
|
@ -72,9 +85,7 @@ macro_rules! new_full_start {
|
|||
}
|
||||
|
||||
/// Builds a new service for a full client.
|
||||
pub fn new_full(config: Configuration)
|
||||
-> Result<impl AbstractService, ServiceError>
|
||||
{
|
||||
pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceError> {
|
||||
let role = config.role.clone();
|
||||
let force_authoring = config.force_authoring;
|
||||
let name = config.network.node_name.clone();
|
||||
|
@ -157,7 +168,7 @@ pub fn new_full(config: Configuration)
|
|||
telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
|
||||
voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(),
|
||||
prometheus_registry: service.prometheus_registry(),
|
||||
shared_voter_state: SharedVoterState::empty()
|
||||
shared_voter_state: SharedVoterState::empty(),
|
||||
};
|
||||
|
||||
// the GRANDPA voter task is considered infallible, i.e.
|
||||
|
@ -178,9 +189,7 @@ pub fn new_full(config: Configuration)
|
|||
}
|
||||
|
||||
/// Builds a new service for a light client.
|
||||
pub fn new_light(config: Configuration)
|
||||
-> Result<impl AbstractService, ServiceError>
|
||||
{
|
||||
pub fn new_light(config: Configuration) -> Result<impl AbstractService, ServiceError> {
|
||||
let inherent_data_providers = InherentDataProviders::new();
|
||||
|
||||
ServiceBuilder::new_light::<Block, RuntimeApi, Executor>(config)?
|
||||
|
@ -197,7 +206,16 @@ pub fn new_light(config: Configuration)
|
|||
);
|
||||
Ok(pool)
|
||||
})?
|
||||
.with_import_queue_and_fprb(|_config, client, backend, fetcher, _select_chain, _tx_pool, spawn_task_handle| {
|
||||
.with_import_queue_and_fprb(|
|
||||
_config,
|
||||
client,
|
||||
backend,
|
||||
fetcher,
|
||||
_select_chain,
|
||||
_tx_pool,
|
||||
spawn_task_handle,
|
||||
prometheus_registry,
|
||||
| {
|
||||
let fetch_checker = fetcher
|
||||
.map(|fetcher| fetcher.checker().clone())
|
||||
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
|
||||
|
@ -219,6 +237,7 @@ pub fn new_light(config: Configuration)
|
|||
client,
|
||||
inherent_data_providers.clone(),
|
||||
spawn_task_handle,
|
||||
prometheus_registry,
|
||||
)?;
|
||||
|
||||
Ok((import_queue, finality_proof_request_builder))
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
[package]
|
||||
authors = ['Anonymous']
|
||||
description = 'FRAME pallet template'
|
||||
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
|
||||
description = 'Substrate FRAME pallet template'
|
||||
edition = '2018'
|
||||
homepage = 'https://substrate.dev'
|
||||
homepage = 'https://substrate.io'
|
||||
license = 'Unlicense'
|
||||
name = 'pallet-template'
|
||||
repository = 'https://github.com/paritytech/substrate/'
|
||||
version = '2.0.0-alpha.7'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ['x86_64-unknown-linux-gnu']
|
||||
|
@ -18,29 +18,34 @@ package = 'parity-scale-codec'
|
|||
version = '1.3.0'
|
||||
|
||||
[dependencies.frame-support]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.frame-system]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dev-dependencies.sp-core]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dev-dependencies.sp-io]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dev-dependencies.sp-runtime]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[features]
|
||||
default = ['std']
|
||||
|
|
|
@ -36,11 +36,11 @@ impl system::Trait for Test {
|
|||
type Event = ();
|
||||
type BlockHashCount = BlockHashCount;
|
||||
type MaximumBlockWeight = MaximumBlockWeight;
|
||||
type DbWeight = ();
|
||||
type BlockExecutionWeight = ();
|
||||
type ExtrinsicBaseWeight = ();
|
||||
type MaximumBlockLength = MaximumBlockLength;
|
||||
type AvailableBlockRatio = AvailableBlockRatio;
|
||||
type BlockExecutionWeight = ();
|
||||
type DbWeight = ();
|
||||
type ExtrinsicBaseWeight = ();
|
||||
type Version = ();
|
||||
type ModuleToIndex = ();
|
||||
type AccountData = ();
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
[dependencies.aura]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
package = 'pallet-aura'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.balances]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
package = 'pallet-balances'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.codec]
|
||||
default-features = false
|
||||
|
@ -17,26 +19,30 @@ package = 'parity-scale-codec'
|
|||
version = '1.3.0'
|
||||
|
||||
[dependencies.frame-executive]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.frame-support]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.grandpa]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
package = 'pallet-grandpa'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.randomness-collective-flip]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
package = 'pallet-randomness-collective-flip'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.serde]
|
||||
features = ['derive']
|
||||
|
@ -44,109 +50,125 @@ optional = true
|
|||
version = '1.0.101'
|
||||
|
||||
[dependencies.sp-api]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-block-builder]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-consensus-aura]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
version = '0.8.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '0.8.0-alpha.8'
|
||||
|
||||
[dependencies.sp-core]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-inherents]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-io]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-offchain]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-runtime]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-session]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-std]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-transaction-pool]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sp-version]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.sudo]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
package = 'pallet-sudo'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.system]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
package = 'frame-system'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.template]
|
||||
default-features = false
|
||||
package = 'pallet-template'
|
||||
path = '../pallets/template'
|
||||
version = '2.0.0-alpha.7'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.timestamp]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
package = 'pallet-timestamp'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[dependencies.transaction-payment]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
default-features = false
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
package = 'pallet-transaction-payment'
|
||||
tag = 'v2.0.0-alpha.7'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[build-dependencies.wasm-builder-runner]
|
||||
git = 'https://github.com/paritytech/substrate.git'
|
||||
package = 'substrate-wasm-builder-runner'
|
||||
tag = 'v2.0.0-alpha.8'
|
||||
version = '1.0.5'
|
||||
|
||||
[package]
|
||||
authors = ['Anonymous']
|
||||
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
|
||||
edition = '2018'
|
||||
homepage = 'https://substrate.dev'
|
||||
homepage = 'https://substrate.io'
|
||||
license = 'Unlicense'
|
||||
name = 'node-template-runtime'
|
||||
repository = 'https://github.com/paritytech/substrate/'
|
||||
version = '2.0.0-alpha.7'
|
||||
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
|
||||
version = '2.0.0-alpha.8'
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
targets = ['x86_64-unknown-linux-gnu']
|
||||
|
|
|
@ -9,17 +9,17 @@
|
|||
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
|
||||
|
||||
use sp_std::prelude::*;
|
||||
use sp_core::OpaqueMetadata;
|
||||
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
||||
use sp_runtime::{
|
||||
ApplyExtrinsicResult, generic, create_runtime_str, impl_opaque_keys, MultiSignature,
|
||||
transaction_validity::{TransactionValidity, TransactionSource},
|
||||
};
|
||||
use sp_runtime::traits::{
|
||||
BlakeTwo256, Block as BlockT, IdentityLookup, Verify, ConvertInto, IdentifyAccount
|
||||
BlakeTwo256, Block as BlockT, IdentityLookup, Verify, ConvertInto, IdentifyAccount, NumberFor,
|
||||
};
|
||||
use sp_api::impl_runtime_apis;
|
||||
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
|
||||
use grandpa::AuthorityList as GrandpaAuthorityList;
|
||||
use grandpa::{AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList};
|
||||
use grandpa::fg_primitives;
|
||||
use sp_version::RuntimeVersion;
|
||||
#[cfg(feature = "std")]
|
||||
|
@ -32,8 +32,8 @@ pub use timestamp::Call as TimestampCall;
|
|||
pub use balances::Call as BalancesCall;
|
||||
pub use sp_runtime::{Permill, Perbill};
|
||||
pub use frame_support::{
|
||||
StorageValue, construct_runtime, parameter_types,
|
||||
traits::Randomness,
|
||||
construct_runtime, parameter_types, StorageValue,
|
||||
traits::{KeyOwnerProofSystem, Randomness},
|
||||
weights::{
|
||||
Weight,
|
||||
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
|
||||
|
@ -100,8 +100,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||
authoring_version: 1,
|
||||
spec_version: 1,
|
||||
impl_version: 1,
|
||||
transaction_version: 1,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
transaction_version: 1,
|
||||
};
|
||||
|
||||
pub const MILLISECS_PER_BLOCK: u64 = 6000;
|
||||
|
@ -123,7 +123,7 @@ pub fn native_version() -> NativeVersion {
|
|||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const BlockHashCount: BlockNumber = 250;
|
||||
pub const BlockHashCount: BlockNumber = 2400;
|
||||
/// We allow for 2 seconds of compute with a 6 second average block time.
|
||||
pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND;
|
||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
||||
|
@ -156,18 +156,18 @@ impl system::Trait for Runtime {
|
|||
type BlockHashCount = BlockHashCount;
|
||||
/// Maximum weight of each block.
|
||||
type MaximumBlockWeight = MaximumBlockWeight;
|
||||
/// The weight of database operations that the runtime can invoke.
|
||||
type DbWeight = RocksDbWeight;
|
||||
/// The weight of the overhead invoked on the block import process, independent of the
|
||||
/// extrinsics included in that block.
|
||||
type BlockExecutionWeight = BlockExecutionWeight;
|
||||
/// The base weight of any extrinsic processed by the runtime, independent of the
|
||||
/// logic of that extrinsic. (Signature verification, nonce increment, fee, etc...)
|
||||
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
||||
/// Maximum size of all encoded transactions (in bytes) that are allowed in one block.
|
||||
type MaximumBlockLength = MaximumBlockLength;
|
||||
/// Portion of the block weight that is available to all normal transactions.
|
||||
type AvailableBlockRatio = AvailableBlockRatio;
|
||||
/// The weight of the overhead invoked on the block import process, independent of the
|
||||
/// extrinsics included in that block.
|
||||
type BlockExecutionWeight = BlockExecutionWeight;
|
||||
/// The weight of database operations that the runtime can invoke.
|
||||
type DbWeight = RocksDbWeight;
|
||||
/// The base weight of any extrinsic processed by the runtime, independent of the
|
||||
/// logic of that extrinsic. (Signature verification, nonce increment, fee, etc...)
|
||||
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
||||
/// Version of the runtime.
|
||||
type Version = Version;
|
||||
/// Converts a module to the index of the module in `construct_runtime!`.
|
||||
|
@ -188,6 +188,19 @@ impl aura::Trait for Runtime {
|
|||
|
||||
impl grandpa::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type Call = Call;
|
||||
|
||||
type KeyOwnerProofSystem = ();
|
||||
|
||||
type KeyOwnerProof =
|
||||
<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
|
||||
|
||||
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
|
||||
KeyTypeId,
|
||||
GrandpaId,
|
||||
)>>::IdentificationTuple;
|
||||
|
||||
type HandleEquivocation = ();
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
|
@ -268,7 +281,8 @@ pub type SignedBlock = generic::SignedBlock<Block>;
|
|||
pub type BlockId = generic::BlockId<Block>;
|
||||
/// The SignedExtension to the basic transaction logic.
|
||||
pub type SignedExtra = (
|
||||
system::CheckVersion<Runtime>,
|
||||
system::CheckSpecVersion<Runtime>,
|
||||
system::CheckTxVersion<Runtime>,
|
||||
system::CheckGenesis<Runtime>,
|
||||
system::CheckEra<Runtime>,
|
||||
system::CheckNonce<Runtime>,
|
||||
|
@ -360,7 +374,7 @@ impl_runtime_apis! {
|
|||
|
||||
fn decode_session_keys(
|
||||
encoded: Vec<u8>,
|
||||
) -> Option<Vec<(Vec<u8>, sp_core::crypto::KeyTypeId)>> {
|
||||
) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {
|
||||
opaque::SessionKeys::decode_into_raw_public_keys(&encoded)
|
||||
}
|
||||
}
|
||||
|
@ -369,5 +383,25 @@ impl_runtime_apis! {
|
|||
fn grandpa_authorities() -> GrandpaAuthorityList {
|
||||
Grandpa::grandpa_authorities()
|
||||
}
|
||||
|
||||
fn submit_report_equivocation_extrinsic(
|
||||
_equivocation_proof: fg_primitives::EquivocationProof<
|
||||
<Block as BlockT>::Hash,
|
||||
NumberFor<Block>,
|
||||
>,
|
||||
_key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,
|
||||
) -> Option<()> {
|
||||
None
|
||||
}
|
||||
|
||||
fn generate_key_ownership_proof(
|
||||
_set_id: fg_primitives::SetId,
|
||||
_authority_id: GrandpaId,
|
||||
) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {
|
||||
// NOTE: this is the only implementation possible since we've
|
||||
// defined our key owner proof type as a bottom type (i.e. a type
|
||||
// with no values).
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue