mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +00:00
deprecate try-runtime subcommand and direct users to standalone cli (#14731)
* add deprecation notice * remove try-runtime-cli tests * update docs * add estimated removal date * deprecate and remove from node-cli and node-template * try fix build script * update comment * fix link * typo in build script * Move `try-runtime-cli` install step outside of `check_dependent_project.sh` execution scope * Update scripts/ci/gitlab/pipeline/build.yml Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * remove chain arg * build runtime with try-runtime feature * kick ci * kick ci * use main branch * specify sha in try-runtime-cli cargo install * kick ci * kick ci --------- Co-authored-by: Vladimir Istyufeev <vladimir@parity.io> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
@@ -41,12 +41,9 @@ pub enum Subcommand {
|
||||
#[command(subcommand)]
|
||||
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
|
||||
|
||||
/// Try some command against runtime state.
|
||||
#[cfg(feature = "try-runtime")]
|
||||
TryRuntime(try_runtime_cli::TryRuntimeCmd),
|
||||
|
||||
/// Try some command against runtime state. Note: `try-runtime` feature must be enabled.
|
||||
#[cfg(not(feature = "try-runtime"))]
|
||||
/// Try-runtime has migrated to a standalone CLI
|
||||
/// (<https://github.com/paritytech/try-runtime-cli>). The subcommand exists as a stub and
|
||||
/// deprecation notice. It will be removed entirely some time after Janurary 2024.
|
||||
TryRuntime,
|
||||
|
||||
/// Db meta columns information.
|
||||
|
||||
@@ -10,9 +10,6 @@ use sc_cli::SubstrateCli;
|
||||
use sc_service::PartialComponents;
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
use try_runtime_cli::block_building_info::timestamp_with_aura_info;
|
||||
|
||||
impl SubstrateCli for Cli {
|
||||
fn impl_name() -> String {
|
||||
"Substrate Node".into()
|
||||
@@ -172,28 +169,7 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
})
|
||||
},
|
||||
#[cfg(feature = "try-runtime")]
|
||||
Some(Subcommand::TryRuntime(cmd)) => {
|
||||
use crate::service::ExecutorDispatch;
|
||||
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
runner.async_run(|config| {
|
||||
// we don't need any of the components of new_partial, just a runtime, or a task
|
||||
// manager to do `async_run`.
|
||||
let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
|
||||
let task_manager =
|
||||
sc_service::TaskManager::new(config.tokio_handle.clone(), registry)
|
||||
.map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?;
|
||||
let info_provider = timestamp_with_aura_info(6000);
|
||||
|
||||
Ok((
|
||||
cmd.run::<Block, ExtendedHostFunctions<
|
||||
sp_io::SubstrateHostFunctions,
|
||||
<ExecutorDispatch as NativeExecutionDispatch>::ExtendHostFunctions,
|
||||
>, _>(Some(info_provider)),
|
||||
task_manager,
|
||||
))
|
||||
})
|
||||
},
|
||||
Some(Subcommand::TryRuntime) => Err(try_runtime_cli::DEPRECATION_NOTICE.into()),
|
||||
#[cfg(not(feature = "try-runtime"))]
|
||||
Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \
|
||||
You can enable it with `--features try-runtime`."
|
||||
|
||||
Reference in New Issue
Block a user