From 16fbce6328dc4806dc5908e325c475b4abed3181 Mon Sep 17 00:00:00 2001 From: Tom Linton Date: Thu, 10 Feb 2022 06:20:13 +1300 Subject: [PATCH] Add avm docs (#4) --- src/SUMMARY.md | 3 +- src/chapter_2/installation.md | 25 ++++++++++- src/chapter_4/avm.md | 84 +++++++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 src/chapter_4/avm.md diff --git a/src/SUMMARY.md b/src/SUMMARY.md index b2860b6..761d99e 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -17,9 +17,10 @@ - [Intermediate]() - [Anchor Periphery](./chapter_4/anchor_periphery.md) - [CLI](./chapter_4/cli.md) + - [AVM](./chapter_4/avm.md) - [IDL]() - [Anchor BTS]() --- -- [Reference Links](./reference_links.md) \ No newline at end of file +- [Reference Links](./reference_links.md) diff --git a/src/chapter_2/installation.md b/src/chapter_2/installation.md index 9818f39..fb27926 100644 --- a/src/chapter_2/installation.md +++ b/src/chapter_2/installation.md @@ -1,4 +1,5 @@ # Installation + ## Rust Go [here](https://www.rust-lang.org/tools/install) to install Rust. @@ -35,4 +36,26 @@ Now verify the CLI is installed properly. ``` anchor --version -``` \ No newline at end of file +``` + +### Installing using Anchor version manager (avm) + +Anchor version manager is a tool for using multiple versions of the anchor-cli. It will require the same dependencies as building from source. It is recommended you uninstall the NPM package if you have it installed. + +Install `avm` using Cargo. Note this will replace your `anchor` binary if you had one installed. + +``` +cargo install --git https://github.com/project-serum/anchor avm --locked --force +``` + +Install the latest version of the CLI using `avm`. You can also use the command to upgrade to the latest release in the future. + +``` +avm use latest +``` + +Verify the installation. + +``` +anchor --version +``` diff --git a/src/chapter_4/avm.md b/src/chapter_4/avm.md new file mode 100644 index 0000000..1972052 --- /dev/null +++ b/src/chapter_4/avm.md @@ -0,0 +1,84 @@ +# Anchor Version Manager + +Anchor Version Manager (avm) is provided to manage multiple installations of the anchor-cli binary. This may be required to produce verifiable builds, or if you'd prefer to work with an alternate version. + +``` +Anchor version manager + +USAGE: + avm + +OPTIONS: + -h, --help Print help information + -V, --version Print version information + +SUBCOMMANDS: + help Print this message or the help of the given subcommand(s) + install Install a version of Anchor + list List available versions of Anchor + uninstall Uninstall a version of Anchor + use Use a specific version of Anchor +``` + +## Install + +``` +avm install +``` + +Install the specified version of anchor-cli. The version argument should follow semver versioning. It is also possible to use `latest` as the version argument to install the latest version. + +## List + +``` +avm list +``` + +Lists available versions of anchor-cli. + +``` +0.3.0 +0.4.0 +0.4.1 +0.4.2 +0.4.3 +0.4.4 +0.4.5 +0.5.0 +0.6.0 +0.7.0 +0.8.0 +0.9.0 +0.10.0 +0.11.0 +0.11.1 +0.12.0 +0.13.0 +0.13.1 +0.13.2 +0.14.0 +0.15.0 +0.16.0 +0.16.1 +0.16.2 +0.17.0 +0.18.0 +0.18.2 +0.19.0 +0.20.0 (installed) +0.20.1 (latest, installed, current) +``` + +## Uninstall + +``` +avm uninstall +``` + +## Use + +``` +avm use +``` + +Use a specific version. This version will remain in use until you change it by calling the same command again. Similarly to `avm install`, you can also use `latest` for the version.