Skip to content

Instantly share code, notes, and snippets.

@WrRaThY
Last active November 7, 2022 18:50
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WrRaThY/1df3030ea75a8163d24e370784827445 to your computer and use it in GitHub Desktop.
Save WrRaThY/1df3030ea75a8163d24e370784827445 to your computer and use it in GitHub Desktop.
Installation notes for solana development with anchor

what to install

general stuff

install

# general deps
sudo apt update
sudo apt install gcc g++ pkg-config libudev-dev libssl-dev make build-essential libclang-dev

#npm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
nvm install --lts

#rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup component add rustfmt

verify

npm --version
rustc --version

solana stuff

install

sh -c "$(curl -sSfL https://release.solana.com/v1.7.11/install)"

npm i -g mocha
npm i -g @project-serum/anchor@0.14.0

cargo install --git https://github.com/project-serum/anchor --tag v0.14.0 anchor-cli --locked

add the following to ~/.bashrc

node_exec=$(which node)
export NODE_PATH=${node_exec%/node}/../lib/node_modules/

verify

npm list -g --depth 0 | grep anchor
anchor --version

validate on a real project

anchor init anchor-test-proj
cd anchor-test-proj
anchor test

# the project should get built and deployed to the local blockchain
# an empty test should succeed

update once needed

solana-install update #may be a bit outdated tho, better to use installation script
rest of them - just use installation scripts with updated versions

sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment