$ rustup --version
rustup 1.27.1 (54dd3d00f 2024-04-24)
$ solana --version
solana-cli 1.18.17 (src:b685182a; feat:4215500110, client:SolanaLabs)
$ yarn --version
1.22.19
$ anchor --version
anchor-cli 0.30.1
Install Rust (Official Installation Guide)
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Install Solana (Official Installation Guide)
$ sh -c "$(curl -sSfL https://release.solana.com/v1.18.17/install)"
# Generate a new keypair for later testing purpose
$ solana-keygen new
# Airdrop 5 Devnet SOL to your wallet
$ solana airdrop 5 -ud
Install Yarn (Official Installation Guide)
If you don’t have node installed yet, install nvm here: Link. And run
nvm install --lts
after installation.
# Node.js >=16.10
# Corepack is included by default with all Node.js installs, but is currently opt-in.
$ corepack enable
# Node.js <16.10
# npm i -g corepack
Install Anchor (Official Installation Guide)
# Install avm (Anchor Version Manager), similar to npm
$ cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
# Linux user only
$ sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y pkg-config build-essential libudev-dev libssl-dev
# Use avm to install version 0.30.1 of anchor
$ avm install 0.30.1
$ avm use 0.30.1
# Check the anchor cli version
$ anchor --version