Update node template to alpha 5 (#27)

* Run release script

* Change dependencies to crates.io
main
Joshy Orndorff 2020-03-24 23:42:27 -04:00 committed by GitHub
parent 5b41f0b156
commit da88e4aa4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 3401 additions and 3368 deletions

6282
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,3 @@
[build-dependencies]
vergen = '3.0.4'
[build-dependencies.build-script-utils]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-build-script-utils'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[package]
authors = ['Anonymous']
build = 'build.rs'
@ -15,10 +6,14 @@ homepage = 'https://substrate.dev'
license = 'Unlicense'
name = 'node-template'
repository = 'https://github.com/paritytech/substrate/'
version = '2.0.0-alpha.3'
version = '2.0.0-alpha.5'
[[bin]]
name = 'node-template'
[build-dependencies]
vergen = '3.0.4'
[build-dependencies.build-script-utils]
package = 'substrate-build-script-utils'
version = '2.0.0-alpha.5'
[dependencies]
futures = '0.3.1'
@ -26,87 +21,61 @@ log = '0.4.8'
structopt = '0.3.8'
[dependencies.grandpa]
git = 'https://github.com/paritytech/substrate.git'
package = 'sc-finality-grandpa'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '0.8.0-alpha.3'
version = '0.8.0-alpha.5'
[dependencies.grandpa-primitives]
git = 'https://github.com/paritytech/substrate.git'
package = 'sp-finality-grandpa'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
version = '2.0.0-alpha.5'
[dependencies.node-template-runtime]
path = '../runtime'
version = '2.0.0-alpha.3'
version = '2.0.0-alpha.5'
[dependencies.sc-basic-authorship]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '0.8.0-alpha.3'
version = '0.8.0-alpha.5'
[dependencies.sc-cli]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '0.8.0-alpha.3'
version = '0.8.0-alpha.5'
[dependencies.sc-client]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '0.8.0-alpha.3'
version = '0.8.0-alpha.5'
[dependencies.sc-client-api]
version = '2.0.0-alpha.5'
[dependencies.sc-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '0.8.0-alpha.3'
version = '0.8.0-alpha.5'
[dependencies.sc-executor]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '0.8.0-alpha.3'
version = '0.8.0-alpha.5'
[dependencies.sc-network]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '0.8.0-alpha.3'
version = '0.8.0-alpha.5'
[dependencies.sc-service]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '0.8.0-alpha.3'
version = '0.8.0-alpha.5'
[dependencies.sc-transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
version = '2.0.0-alpha.5'
[dependencies.sp-consensus]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '0.8.0-alpha.3'
version = '0.8.0-alpha.5'
[dependencies.sp-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '0.8.0-alpha.3'
version = '0.8.0-alpha.5'
[dependencies.sp-core]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
version = '2.0.0-alpha.5'
[dependencies.sp-inherents]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
version = '2.0.0-alpha.5'
[dependencies.sp-runtime]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
version = '2.0.0-alpha.5'
[dependencies.sp-transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
version = '2.0.0-alpha.5'
[[bin]]
name = 'node-template'

View File

@ -12,7 +12,7 @@ use sp_runtime::traits::{Verify, IdentifyAccount};
//const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
pub type ChainSpec = sc_service::ChainSpec<GenesisConfig>;
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig>;
/// The chain specification option. This is expected to come in from the CLI and
/// is little more than one of a number of alternatives which can easily be converted
@ -142,9 +142,9 @@ fn testnet_genesis(initial_authorities: Vec<(AuraId, GrandpaId)>,
}
}
pub fn load_spec(id: &str) -> Result<Option<ChainSpec>, String> {
pub fn load_spec(id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
Ok(match Alternative::from(id) {
Some(spec) => Some(spec.load()?),
None => None,
Some(spec) => Box::new(spec.load()?),
None => Box::new(ChainSpec::from_json_file(std::path::PathBuf::from(id))?),
})
}

View File

@ -3,13 +3,14 @@
use std::sync::Arc;
use std::time::Duration;
use sc_client::LongestChain;
use node_template_runtime::{self, GenesisConfig, opaque::Block, RuntimeApi};
use sc_client_api::ExecutorProvider;
use node_template_runtime::{self, opaque::Block, RuntimeApi};
use sc_service::{error::{Error as ServiceError}, AbstractService, Configuration, ServiceBuilder};
use sp_inherents::InherentDataProviders;
use sc_executor::native_executor_instance;
pub use sc_executor::NativeExecutor;
use sp_consensus_aura::sr25519::{AuthorityPair as AuraPair};
use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider};
use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider, StorageAndProofProvider};
// Our native executor instance.
native_executor_instance!(
@ -24,6 +25,7 @@ native_executor_instance!(
/// be able to perform chain operations.
macro_rules! new_full_start {
($config:expr) => {{
use std::sync::Arc;
let mut import_setup = None;
let inherent_data_providers = sp_inherents::InherentDataProviders::new();
@ -42,7 +44,7 @@ macro_rules! new_full_start {
.ok_or_else(|| sc_service::Error::SelectChainRequired)?;
let (grandpa_block_import, grandpa_link) =
grandpa::block_import(client.clone(), &*client, select_chain)?;
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(),
@ -67,7 +69,7 @@ macro_rules! new_full_start {
}
/// Builds a new service for a full client.
pub fn new_full(config: Configuration<GenesisConfig>)
pub fn new_full(config: Configuration)
-> Result<impl AbstractService, ServiceError>
{
let is_authority = config.roles.is_authority();
@ -87,9 +89,11 @@ pub fn new_full(config: Configuration<GenesisConfig>)
.expect("Link Half and Block Import are present for Full Services or setup failed before. qed");
let service = builder
.with_finality_proof_provider(|client, backend|
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, client)) as _)
)?
.with_finality_proof_provider(|client, backend| {
// GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
})?
.build()?;
if participates_in_consensus {
@ -154,9 +158,9 @@ pub fn new_full(config: Configuration<GenesisConfig>)
link: grandpa_link,
network: service.network(),
inherent_data_providers: inherent_data_providers.clone(),
on_exit: service.on_exit(),
telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
voting_rule: grandpa::VotingRulesBuilder::default().build(),
prometheus_registry: service.prometheus_registry()
};
// the GRANDPA voter task is considered infallible, i.e.
@ -177,7 +181,7 @@ pub fn new_full(config: Configuration<GenesisConfig>)
}
/// Builds a new service for a light client.
pub fn new_light(config: Configuration<GenesisConfig>)
pub fn new_light(config: Configuration)
-> Result<impl AbstractService, ServiceError>
{
let inherent_data_providers = InherentDataProviders::new();
@ -201,7 +205,10 @@ pub fn new_light(config: Configuration<GenesisConfig>)
.map(|fetcher| fetcher.checker().clone())
.ok_or_else(|| "Trying to start light import queue without active fetch checker")?;
let grandpa_block_import = grandpa::light_block_import(
client.clone(), backend, &*client.clone(), Arc::new(fetch_checker),
client.clone(),
backend,
&(client.clone() as Arc<_>),
Arc::new(fetch_checker),
)?;
let finality_proof_import = grandpa_block_import.clone();
let finality_proof_request_builder =
@ -218,8 +225,10 @@ pub fn new_light(config: Configuration<GenesisConfig>)
Ok((import_queue, finality_proof_request_builder))
})?
.with_finality_proof_provider(|client, backend|
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, client)) as _)
)?
.with_finality_proof_provider(|client, backend| {
// GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
})?
.build()
}

View File

@ -1,20 +1,43 @@
[package]
authors = ['Anonymous']
description = 'FRAME pallet template'
edition = '2018'
homepage = 'https://substrate.dev'
license = 'Unlicense'
name = 'pallet-template'
repository = 'https://github.com/paritytech/substrate/'
version = '2.0.0-alpha.5'
[dependencies.codec]
default-features = false
features = ['derive']
package = 'parity-scale-codec'
version = '1.2.0'
[dependencies.frame-support]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.safe-mix]
default-features = false
version = '1.0.0'
[dependencies.system]
default-features = false
package = 'frame-system'
version = '2.0.0-alpha.5'
[dev-dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
version = '2.0.0-alpha.5'
[dev-dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
version = '2.0.0-alpha.5'
[dev-dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
version = '2.0.0-alpha.5'
[features]
default = ['std']
@ -24,35 +47,3 @@ std = [
'safe-mix/std',
'system/std',
]
[package]
authors = ['Anonymous']
description = 'FRAME pallet template'
edition = '2018'
homepage = 'https://substrate.dev'
license = 'Unlicense'
name = 'pallet-template'
repository = 'https://github.com/paritytech/substrate/'
version = '2.0.0-alpha.3'
[dependencies.codec]
default-features = false
features = ['derive']
package = 'parity-scale-codec'
version = '1.0.0'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.safe-mix]
default-features = false
version = '1.0.0'
[dependencies.system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'frame-system'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'

View File

@ -28,6 +28,9 @@ pub trait Trait: system::Trait {
// This pallet's storage items.
decl_storage! {
// It is important to update your storage name so that your pallet's
// storage items are isolated from other pallets.
// ---------------------------------vvvvvvvvvvvvvv
trait Store for Module<T: Trait> as TemplateModule {
// Just a dummy storage item.
// Here we are declaring a StorageValue, `Something` as a Option<u32>

View File

@ -5,11 +5,122 @@ homepage = 'https://substrate.dev'
license = 'Unlicense'
name = 'node-template-runtime'
repository = 'https://github.com/paritytech/substrate/'
version = '2.0.0-alpha.3'
version = '2.0.0-alpha.5'
[dependencies.aura]
default-features = false
package = 'pallet-aura'
version = '2.0.0-alpha.5'
[dependencies.balances]
default-features = false
package = 'pallet-balances'
version = '2.0.0-alpha.5'
[dependencies.codec]
default-features = false
features = ['derive']
package = 'parity-scale-codec'
version = '1.2.0'
[dependencies.frame-executive]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.frame-support]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.grandpa]
default-features = false
package = 'pallet-grandpa'
version = '2.0.0-alpha.5'
[dependencies.randomness-collective-flip]
default-features = false
package = 'pallet-randomness-collective-flip'
version = '2.0.0-alpha.5'
[dependencies.serde]
features = ['derive']
optional = true
version = '1.0.101'
[dependencies.sp-api]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.sp-block-builder]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.sp-consensus-aura]
default-features = false
version = '0.8.0-alpha.5'
[dependencies.sp-core]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.sp-inherents]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.sp-io]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.sp-offchain]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.sp-runtime]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.sp-session]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.sp-std]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.sp-transaction-pool]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.sp-version]
default-features = false
version = '2.0.0-alpha.5'
[dependencies.sudo]
default-features = false
package = 'pallet-sudo'
version = '2.0.0-alpha.5'
[dependencies.system]
default-features = false
package = 'frame-system'
version = '2.0.0-alpha.5'
[dependencies.template]
default-features = false
package = 'pallet-template'
path = '../pallets/template'
version = '2.0.0-alpha.5'
[dependencies.timestamp]
default-features = false
package = 'pallet-timestamp'
version = '2.0.0-alpha.5'
[dependencies.transaction-payment]
default-features = false
package = 'pallet-transaction-payment'
version = '2.0.0-alpha.5'
[build-dependencies.wasm-builder-runner]
git = 'https://github.com/paritytech/substrate.git'
package = 'substrate-wasm-builder-runner'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '1.0.5'
[features]
@ -41,159 +152,3 @@ std = [
'transaction-payment/std',
'template/std',
]
[dependencies.aura]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-aura'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.balances]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-balances'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.codec]
default-features = false
features = ['derive']
package = 'parity-scale-codec'
version = '1.0.0'
[dependencies.frame-executive]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.grandpa]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-grandpa'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.randomness-collective-flip]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-randomness-collective-flip'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.serde]
features = ['derive']
optional = true
version = '1.0.101'
[dependencies.sp-api]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.sp-block-builder]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.sp-consensus-aura]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '0.8.0-alpha.3'
[dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.sp-inherents]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.sp-offchain]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.sp-session]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.sp-transaction-pool]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.sp-version]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.sudo]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-sudo'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'frame-system'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.template]
default-features = false
package = 'pallet-template'
path = '../pallets/template'
version = '2.0.0-alpha.3'
[dependencies.timestamp]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-timestamp'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'
[dependencies.transaction-payment]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
package = 'pallet-transaction-payment'
rev = '013c1ee167354a08283fb69915fda56a62fee943'
version = '2.0.0-alpha.3'

View File

@ -297,10 +297,6 @@ impl_runtime_apis! {
Executive::apply_extrinsic(extrinsic)
}
fn apply_trusted_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
Executive::apply_trusted_extrinsic(extrinsic)
}
fn finalize_block() -> <Block as BlockT>::Header {
Executive::finalize_block()
}