on Apple M1 machines, adapted from this guide.
Install Homebrew:
If you're using the x86 version of Homebrew, uninstall it
sudo /bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh>)"
Install Homebrew:
/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"
Run these two commands in your terminal to add Homebrew to your PATH:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/$YOUR_USERNAME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
Install Rust
curl --proto '=https' --tlsv1.2 <https://sh.rustup.rs> -sSf | sh
Clone Solana
git clone <https://github.com/solana-labs/solana.git>
cd solanac
Install coreutils
brew install coreutils
Install Solana from source
./scripts/cargo-install-all.sh .
In ~/.zshenv (or whichever shell profile you're using), modify your PATH to include the directory where you installed Solana:
export PATH="/Users/$YOUR_USERNAME/solana/bin:$PATH"
Source the file
source ~/.zshenv
Create a new wallet and run the test validator (then close it with ctrl+c)
solana config set --url localhost
solana config get
solana-keygen new
solana-test-validator
Install node
Install nvm
curl -o- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh> | sh
b. Update ~/.zshenv (and source it)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \\. "$NVM_DIR/nvm.sh" # This loads nvm
c. Install node
nvm install v17
Install Anchor
Install Mocha
npm install -g mocha
b. Install Anchor
cargo install --git <https://github.com/project-serum/anchor> anchor-cli --locked
c. Install yarn
npm install -g yarn
Create a test project & run it!
anchor init myepicproject --javascript
cd myepicproject
anchor test
Anchor Docs: https://project-serum.github.io/anchor/getting-started/introduction.html