Skip to content

Commit

Permalink
Add avm docs (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Linton authored Feb 9, 2022
1 parent 353fd6f commit 16fbce6
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
- [Reference Links](./reference_links.md)
25 changes: 24 additions & 1 deletion src/chapter_2/installation.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Installation

## Rust

Go [here](https://www.rust-lang.org/tools/install) to install Rust.
Expand Down Expand Up @@ -35,4 +36,26 @@ Now verify the CLI is installed properly.

```
anchor --version
```
```

### 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
```
84 changes: 84 additions & 0 deletions src/chapter_4/avm.md
Original file line number Diff line number Diff line change
@@ -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 <SUBCOMMAND>
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 <version>
```

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 <version>
```

## Use

```
avm use <version>
```

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.

0 comments on commit 16fbce6

Please sign in to comment.