From c040e1b0a35f42092adb2aba61eeb008bcdae10f Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 25 Feb 2022 17:33:22 +0100 Subject: [PATCH] update installation page - new version number and recommended installation method --- src/chapter_2/installation.md | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/chapter_2/installation.md b/src/chapter_2/installation.md index fb27926..fc34700 100644 --- a/src/chapter_2/installation.md +++ b/src/chapter_2/installation.md @@ -14,31 +14,7 @@ Go [here](https://yarnpkg.com/getting-started/install) to install Yarn. ## Anchor -### Install using pre-build binary on x86_64 Linux - -Anchor binaries are available via an NPM package [`@project-serum/anchor-cli`](https://www.npmjs.com/package/@project-serum/anchor-cli). Only `x86_64` Linux is supported currently, you must build from source for other OS'. - -### Build from source for other operating systems - -For now, we can use Cargo to install the CLI. - -``` -cargo install --git https://github.com/project-serum/anchor --tag v0.20.1 anchor-cli --locked -``` - -On Linux systems you may need to install additional dependencies if cargo install fails. On Ubuntu, - -``` -sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y pkg-config build-essential libudev-dev -``` - -Now verify the CLI is installed properly. - -``` -anchor --version -``` - -### Installing using Anchor version manager (avm) +### Installing using Anchor version manager (avm) (recommended) 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. @@ -59,3 +35,27 @@ Verify the installation. ``` anchor --version ``` + +### Install using pre-build binary on x86_64 Linux + +Anchor binaries are available via an NPM package [`@project-serum/anchor-cli`](https://www.npmjs.com/package/@project-serum/anchor-cli). Only `x86_64` Linux is supported currently, you must build from source for other OS'. + +### Build from source for other operating systems without avm + +We can also use Cargo to install the CLI directly. Make sure that the `--tag` argument uses the version you want (the version here is just an example). + +``` +cargo install --git https://github.com/project-serum/anchor --tag v0.22.0 anchor-cli --locked +``` + +On Linux systems you may need to install additional dependencies if cargo install fails. On Ubuntu, + +``` +sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y pkg-config build-essential libudev-dev +``` + +Now verify the CLI is installed properly. + +``` +anchor --version +```