Skip to content
Snippets Groups Projects
Select Git revision
  • e122d6b63bef74c07c30d3a0dc051b63cc728a58
  • master default protected
  • network/gtest-1000 protected
  • upgradable-multisig
  • runtime/gtest-1000
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • hugo/195-doc
  • hugo/195-graphql-schema
  • gtest-1000-0.11.0 protected
  • gtest-1000 protected
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • gdev-802 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
  • v0.4.1 protected
41 results

command.rs

Blame
  • command.rs 17.49 KiB
    // This file is part of Substrate.
    
    // Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
    // SPDX-License-Identifier: Apache-2.0
    
    // 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.
    
    pub mod key;
    pub mod utils;
    
    use crate::cli::{Cli, Subcommand};
    #[cfg(feature = "g1")]
    use crate::service::G1Executor;
    #[cfg(feature = "gdev")]
    use crate::service::GDevExecutor;
    #[cfg(feature = "gtest")]
    use crate::service::GTestExecutor;
    use crate::service::{IdentifyRuntimeType, RuntimeType};
    use crate::{chain_spec, service};
    use clap::CommandFactory;
    #[cfg(feature = "runtime-benchmarks")]
    use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
    use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli};
    
    // TODO: create our own reference hardware
    /*
    lazy_static! {
        /// The hardware requirements as measured on reference hardware.
        pub static ref REFERENCE_HARDWARE: Requirements = {
            let raw = include_bytes!("reference_hardware.json").as_slice();
            serde_json::from_slice(raw).expect("Hardcoded data is known good; qed")
        };
    }*/
    
    /// Unwraps a [`crate::client::Client`] into the concrete runtime client.
    #[cfg(feature = "runtime-benchmarks")]
    macro_rules! unwrap_client {
        (
    		$client:ident,
    		$code:expr
    	) => {
            match $client.as_ref() {
                #[cfg(feature = "g1")]
                crate::service::client::Client::G1($client) => $code,
                #[cfg(feature = "gtest")]
                crate::service::client::Client::GTest($client) => $code,
                #[cfg(feature = "gdev")]
                crate::service::client::Client::GDev($client) => $code,
                #[allow(unreachable_patterns)]
                _ => panic!("unknown runtime"),
            }
        };
    }
    
    impl SubstrateCli for Cli {
        fn impl_name() -> String {
            "Duniter".into()
        }
    
        fn impl_version() -> String {