git.delta.rocks / unique-network / refs/commits / 2ddc70da9e1d

difftreelog

source

node/src/command.rs1.5 KiBsourcehistory
1// Copyright 2017-2020 Parity Technologies (UK) Ltd.2// This file is part of Substrate.34// Substrate is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Substrate is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Substrate.  If not, see <http://www.gnu.org/licenses/>.1617use sp_consensus_aura::sr25519::{AuthorityPair as AuraPair};18use sc_cli::VersionInfo;19use crate::service;20use crate::chain_spec;21use crate::cli::Cli;2223/// Parse and run command line arguments24pub fn run(version: VersionInfo) -> sc_cli::Result<()> {25	let opt = sc_cli::from_args::<Cli>(&version);2627	let mut config = sc_service::Configuration::from_version(&version);2829	match opt.subcommand {30		Some(subcommand) => {31			subcommand.init(&version)?;32			subcommand.update_config(&mut config, chain_spec::load_spec, &version)?;33			subcommand.run(34				config,35				|config: _| Ok(new_full_start!(config).0),36			)37		},38		None => {39			opt.run.init(&version)?;40			opt.run.update_config(&mut config, chain_spec::load_spec, &version)?;41			opt.run.run(42				config,43				service::new_light,44				service::new_full,45				&version,46			)47		},48	}49}