Skip to content

Instantly share code, notes, and snippets.

@with-heart
Forked from billyjacoby/m1solana.md
Created November 8, 2021 14:32
Show Gist options
  • Save with-heart/2f0f1a1f2a9255c5f77931149f2ab799 to your computer and use it in GitHub Desktop.
Save with-heart/2f0f1a1f2a9255c5f77931149f2ab799 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.

@Sotatek-TiepLe
Copy link

Thank you!

I get this error when I execute anchor test
I haven't found any fix yet. If you know any information please help

Unable to get latest blockhash. Test validator does not look started. Check .anchor/test-ledger/test-ledger-log.txt for errors. Consider increasing [test.startup_wait] in Anchor.toml.

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