Solana 開發環境設定

Solana 開發所需要安裝的相關 Command Line Utilities 以及 VSCode Extensions 彙整。

Solana Utilities

Rust

curl https://sh.rustup.rs -sSf | bash -s -- -y --no-modify-path
source $HOME/.cargo/env
rustup component add rustfmt

rustup --version 
#rustup 1.24.3 (ce5817a94 2021-05-31)
cargo --version 
#cargo 1.60.0 (d1fd9fe2c 2022-03-01)

Solana CLI

安裝好後要先加一下環境變數才行
export PATH=”/Users/USER_NAME/.local/share/solana/install/active_release/bin:$PATH”

sh -c "$(curl -sSfL https://release.solana.com/v1.10.23/install)"
solana --version 
#solana-cli 1.10.7 (src:8bce2dd4; feat:1122441720)

SPL-Token CLI

cargo install spl-token-cli
spl-token --version 
#spl-token-cli 2.0.15

TypeScript

npm install -g typescript
tsc --version
#Version 4.6.3

Cargo

cargo install --git https://github.com/project-serum/anchor avm --locked --force
avm --version
#avm 0.23.0

avm install latest
avm use latest
anchor --version
#anchor-cli 0.23.0

VSCode Extensions

  • rust-analyzer
  • crates
  • Better TOML

Leave a Reply