Skip to content

Instantly share code, notes, and snippets.

@billyjacoby
Created November 7, 2021 03:16
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save billyjacoby/84a839d97949fa2445c1c77c84534336 to your computer and use it in GitHub Desktop.
Save billyjacoby/84a839d97949fa2445c1c77c84534336 to your computer and use it in GitHub Desktop.
Process to get Solana and Anchor working on M1 based Macs

How to install Solana & Anchor on M1 Macs without Rosetta

Versions info:

  • node: 17.0.1
  • homebrew: 3.3.2
  • npm: 8.1.0
  • solana-cli: 1.9.0

install rust

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

clone solana from source

git clone https://github.com/solana-labs/solana.git

cd solana

install coreutils - this fixed the greadit (sp?) error

brew install coreutils

Install Solana from source

./scripts/cargo-install-all.sh .

export PATH=$PWD/bin:$PATH

solana-test-validator should run at this point!

solana config set --url localhost

solana config get

Install Mocha for Anchor

npm install -g mocha

Install anchor

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

Now use anchor to init a new app!

anchor init myepicproject --javascript

And test!

cd myepicproject/

anchor test

Be a bit patient on this last step, it took quite a while for this to start running for me.

@crazydevlegend
Copy link

image
I just followed these steps, but couldn't manage to run my anchor project.
Can you please explain about this? 🙏

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