From b01e1e5d4b858537b8b6b88d848bfbc242b6f459 Mon Sep 17 00:00:00 2001 From: Tom Linton Date: Tue, 24 Aug 2021 09:38:21 +1200 Subject: [PATCH] cli: Remove anchor launch (#634) --- CHANGELOG.md | 1 + cli/src/lib.rs | 51 ---------------------------------------- docs/src/cli/commands.md | 20 +--------------- 3 files changed, 2 insertions(+), 70 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 664cb55c9..4e3d06a4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ incremented for features. * lang: Change `#[account(init, seeds = [...], token = , authority = )]` to `#[account(init, token::mint = token::authority = )]` ([#](https://github.com/project-serum/anchor/pull/562)). * lang: `#[associated]` and `#[account(associated = , with = )]` are both removed. +* cli: Removed `anchor launch` command ## [0.13.2] - 2021-08-11 diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 514d26366..3cb7187d9 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -116,14 +116,6 @@ pub enum Command { /// Runs the deploy migration script. Migrate, /// Deploys, initializes an IDL, and migrates all in one command. - Launch { - /// True if the build should be verifiable. If deploying to mainnet, - /// this should almost always be set. - #[clap(short, long)] - verifiable: bool, - #[clap(short, long)] - program_name: Option, - }, /// Upgrades a single program. The configured wallet must be the upgrade /// authority. Upgrade { @@ -272,10 +264,6 @@ pub fn entry(opts: Opts) -> Result<()> { } => upgrade(&opts.cfg_override, program_id, program_filepath), Command::Idl { subcmd } => idl(&opts.cfg_override, subcmd), Command::Migrate => migrate(&opts.cfg_override), - Command::Launch { - verifiable, - program_name, - } => launch(&opts.cfg_override, verifiable, program_name), Command::Test { skip_deploy, skip_local_validator, @@ -1631,45 +1619,6 @@ fn upgrade( }) } -fn launch( - cfg_override: &ConfigOverride, - verifiable: bool, - program_name: Option, -) -> Result<()> { - // Build and deploy. - build( - cfg_override, - None, - verifiable, - program_name.clone(), - None, - None, - None, - )?; - let programs = _deploy(cfg_override, program_name)?; - - with_workspace(cfg_override, |cfg| { - let keypair = cfg.provider.wallet.to_string(); - - // Add metadata to all IDLs. - for (address, program) in programs { - if let Some(idl) = program.idl.as_ref() { - // Store the IDL on chain. - let idl_address = create_idl_account(cfg, &keypair, &address, idl)?; - println!("IDL account created: {}", idl_address.to_string()); - } - } - - // Run migration script. - if Path::new("migrations/deploy.js").exists() || Path::new("migrations/deploy.ts").exists() - { - migrate(cfg_override)?; - } - - Ok(()) - }) -} - // The Solana CLI doesn't redeploy a program if this file exists. // So remove it to make all commands explicit. fn clear_program_keys(cfg_override: &ConfigOverride) -> Result<()> { diff --git a/docs/src/cli/commands.md b/docs/src/cli/commands.md index 6aec6664b..d06b860a0 100644 --- a/docs/src/cli/commands.md +++ b/docs/src/cli/commands.md @@ -21,7 +21,6 @@ SUBCOMMANDS: help Prints this message or the help of the given subcommand(s) idl Commands for interacting with interface definitions init Initializes a workspace - launch Deploys, initializes an IDL, and migrates all in one command migrate Runs the deploy migration script new Creates a new program test Runs integration tests against a localnetwork @@ -195,23 +194,6 @@ anchor idl set-authority -n -p Sets a new authority on the IDL account. Both the `new-authority` and `program-id` must be encoded in base 58. -## Launch - -``` -anchor launch -``` - -Builds, deploys and migrates, all in one command. This is particularly -useful when simultaneously developing an app against a Localnet or Devnet. For mainnet, it's -recommended to run each command separately, since transactions can sometimes be -unreliable depending on the Solana RPC node being used. - -``` -anchor launch --verifiable -``` - -Runs the build inside a docker image so that the output binary is deterministic (assuming a Cargo.lock file is used). - ## New ``` @@ -246,4 +228,4 @@ anchor verify ``` Verifies the on-chain bytecode matches the locally compiled artifact. - +