Skip to content

Commit

Permalink
cli: Remove anchor launch (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Linton authored Aug 23, 2021
1 parent 7e7e866 commit b01e1e5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 70 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ incremented for features.

* lang: Change `#[account(init, seeds = [...], token = <expr>, authority = <expr>)]` to `#[account(init, token::mint = <expr> token::authority = <expr>)]` ([#](https://github.com/project-serum/anchor/pull/562)).
* lang: `#[associated]` and `#[account(associated = <target>, with = <target>)]` are both removed.
* cli: Removed `anchor launch` command

## [0.13.2] - 2021-08-11

Expand Down
51 changes: 0 additions & 51 deletions cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
},
/// Upgrades a single program. The configured wallet must be the upgrade
/// authority.
Upgrade {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1631,45 +1619,6 @@ fn upgrade(
})
}

fn launch(
cfg_override: &ConfigOverride,
verifiable: bool,
program_name: Option<String>,
) -> 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<()> {
Expand Down
20 changes: 1 addition & 19 deletions docs/src/cli/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -195,23 +194,6 @@ anchor idl set-authority -n <new-authority> -p <program-id>
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

```
Expand Down Expand Up @@ -246,4 +228,4 @@ anchor verify <program-id>
```

Verifies the on-chain bytecode matches the locally compiled artifact.

0 comments on commit b01e1e5

Please sign in to comment.