Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update to v2.0.0 🎉 (#88)
  • Loading branch information
Dan Forbes authored Sep 23, 2020
commit 24da7670a9a73fd6d868cfff105e2fd1f9be6f67
1,121 changes: 598 additions & 523 deletions Cargo.lock

Large diffs are not rendered by default.

168 changes: 39 additions & 129 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,141 +7,51 @@ homepage = 'https://substrate.dev'
license = 'Unlicense'
name = 'node-template'
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
version = '2.0.0-rc6'

[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']
version = '2.0.0'

[[bin]]
name = 'node-template'

[dependencies.node-template-runtime]
path = '../runtime'
version = '2.0.0-rc6'

[dependencies.pallet-transaction-payment-rpc]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dependencies.sc-basic-authorship]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '0.8.0-rc6'

[dependencies.sc-cli]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '0.8.0-rc6'

[dependencies.sc-client-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dependencies.sc-consensus]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '0.8.0-rc6'

[dependencies.sc-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '0.8.0-rc6'

[dependencies.sc-executor]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '0.8.0-rc6'

[dependencies.sc-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '0.8.0-rc6'

[dependencies.sc-rpc]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dependencies.sc-rpc-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '0.8.0-rc6'

[dependencies.sc-service]
features = ['wasmtime']
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '0.8.0-rc6'

[dependencies.sc-transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dependencies.sp-api]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dependencies.sp-block-builder]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dependencies.sp-blockchain]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dependencies.sp-consensus]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '0.8.0-rc6'

[dependencies.sp-consensus-aura]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '0.8.0-rc6'

[dependencies.sp-core]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dependencies.sp-finality-grandpa]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dependencies.sp-inherents]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dependencies.sp-runtime]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dependencies.sp-transaction-pool]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'
[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']

[dependencies.substrate-frame-rpc-system]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'
[build-dependencies]
substrate-build-script-utils = '2.0.0'

[dependencies]
jsonrpc-core = '14.0.3'
jsonrpc-core = '15.0.0'
structopt = '0.3.8'

[build-dependencies.substrate-build-script-utils]
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'
# local dependencies
node-template-runtime = { path = '../runtime', version = '2.0.0' }

# Substrate dependencies
frame-benchmarking = '2.0.0'
frame-benchmarking-cli = '2.0.0'
pallet-transaction-payment-rpc = '2.0.0'
sc-basic-authorship = '0.8.0'
sc-cli = { features = ['wasmtime'], version = '0.8.0' }
sc-client-api = '2.0.0'
sc-consensus = '0.8.0'
sc-consensus-aura = '0.8.0'
sc-executor = { features = ['wasmtime'], version = '0.8.0' }
sc-finality-grandpa = '0.8.0'
sc-rpc = '2.0.0'
sc-rpc-api = '0.8.0'
sc-service = { features = ['wasmtime'], version = '0.8.0' }
sc-transaction-pool = '2.0.0'
sp-api = '2.0.0'
sp-block-builder = '2.0.0'
sp-blockchain = '2.0.0'
sp-consensus = '0.8.0'
sp-consensus-aura = '0.8.0'
sp-core = '2.0.0'
sp-finality-grandpa = '2.0.0'
sp-inherents = '2.0.0'
sp-runtime = '2.0.0'
sp-transaction-pool = '2.0.0'
substrate-frame-rpc-system = '2.0.0'

[features]
default = []
runtime-benchmarks = ['node-template-runtime/runtime-benchmarks']
30 changes: 29 additions & 1 deletion node/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use sc_cli::{RunCmd, Subcommand};
use structopt::StructOpt;
use sc_cli::RunCmd;

#[derive(Debug, StructOpt)]
pub struct Cli {
Expand All @@ -9,3 +9,31 @@ pub struct Cli {
#[structopt(flatten)]
pub run: RunCmd,
}

#[derive(Debug, StructOpt)]
pub enum Subcommand {
/// Build a chain specification.
BuildSpec(sc_cli::BuildSpecCmd),

/// Validate blocks.
CheckBlock(sc_cli::CheckBlockCmd),

/// Export blocks.
ExportBlocks(sc_cli::ExportBlocksCmd),

/// Export the state of a given block into a chain spec.
ExportState(sc_cli::ExportStateCmd),

/// Import blocks.
ImportBlocks(sc_cli::ImportBlocksCmd),

/// Remove the whole chain.
PurgeChain(sc_cli::PurgeChainCmd),

/// Revert the chain to a previous state.
Revert(sc_cli::RevertCmd),

/// The custom benchmark subcommmand benchmarking runtime pallets.
#[structopt(name = "benchmark", about = "Benchmark runtime pallets.")]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
}
73 changes: 61 additions & 12 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
// 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 crate::{chain_spec, service};
use crate::cli::{Cli, Subcommand};
use sc_cli::{SubstrateCli, RuntimeVersion, Role, ChainSpec};
use sc_service::PartialComponents;
use crate::service::new_partial;
use node_template_runtime::Block;

impl SubstrateCli for Cli {
fn impl_name() -> String {
Expand Down Expand Up @@ -66,15 +65,65 @@ impl SubstrateCli for Cli {
pub fn run() -> sc_cli::Result<()> {
let cli = Cli::from_args();

match cli.subcommand {
Some(ref subcommand) => {
let runner = cli.create_runner(subcommand)?;
runner.run_subcommand(subcommand, |config| {
let PartialComponents { client, backend, task_manager, import_queue, .. }
= new_partial(&config)?;
Ok((client, backend, import_queue, task_manager))
match &cli.subcommand {
Some(Subcommand::BuildSpec(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
},
Some(Subcommand::CheckBlock(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
let PartialComponents { client, task_manager, import_queue, ..}
= service::new_partial(&config)?;
Ok((cmd.run(client, import_queue), task_manager))
})
}
},
Some(Subcommand::ExportBlocks(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
let PartialComponents { client, task_manager, ..}
= service::new_partial(&config)?;
Ok((cmd.run(client, config.database), task_manager))
})
},
Some(Subcommand::ExportState(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
let PartialComponents { client, task_manager, ..}
= service::new_partial(&config)?;
Ok((cmd.run(client, config.chain_spec), task_manager))
})
},
Some(Subcommand::ImportBlocks(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
let PartialComponents { client, task_manager, import_queue, ..}
= service::new_partial(&config)?;
Ok((cmd.run(client, import_queue), task_manager))
})
},
Some(Subcommand::PurgeChain(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run(config.database))
},
Some(Subcommand::Revert(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
let PartialComponents { client, task_manager, backend, ..}
= service::new_partial(&config)?;
Ok((cmd.run(client, backend), task_manager))
})
},
Some(Subcommand::Benchmark(cmd)) => {
if cfg!(feature = "runtime-benchmarks") {
let runner = cli.create_runner(cmd)?;

runner.sync_run(|config| cmd.run::<Block, service::Executor>(config))
} else {
Err("Benchmarking wasn't enabled when building the node. \
You can enable it with `--features runtime-benchmarks`.".into())
}
},
None => {
let runner = cli.create_runner(&cli.run)?;
runner.run_node_until_exit(|config| match config.role {
Expand Down
1 change: 1 addition & 0 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ native_executor_instance!(
pub Executor,
node_template_runtime::api::dispatch,
node_template_runtime::native_version,
frame_benchmarking::benchmarking::HostFunctions,
);

type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;
Expand Down
38 changes: 9 additions & 29 deletions pallets/template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,26 @@ homepage = 'https://substrate.dev'
license = 'Unlicense'
name = 'pallet-template'
repository = 'https://github.com/substrate-developer-hub/substrate-node-template/'
version = '2.0.0-rc6'
version = '2.0.0'

[package.metadata.docs.rs]
targets = ['x86_64-unknown-linux-gnu']

# alias "parity-scale-code" to "codec"
[dependencies.codec]
default-features = false
features = ['derive']
package = 'parity-scale-codec'
version = '1.3.4'

[dependencies.frame-support]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dependencies.frame-system]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dev-dependencies.sp-core]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'

[dev-dependencies.sp-io]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'
[dependencies]
frame-support = { default-features = false, version = '2.0.0' }
frame-system = { default-features = false, version = '2.0.0' }

[dev-dependencies.sp-runtime]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'v2.0.0-rc6'
version = '2.0.0-rc6'
[dev-dependencies]
sp-core = { default-features = false, version = '2.0.0' }
sp-io = { default-features = false, version = '2.0.0' }
sp-runtime = { default-features = false, version = '2.0.0' }

[features]
default = ['std']
Expand Down
2 changes: 1 addition & 1 deletion pallets/template/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl system::Trait for Test {
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = ();
type ModuleToIndex = ();
type PalletInfo = ();
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
Expand Down
Loading