In this guide, we will go through all the steps needed to compile and install the tools on your machine natively, without having to set up a cumbersome Rosetta environment.
First, you will need to install the Rust toolchain.
curl https://sh.rustup.rs -sSf | sh source $HOME/.cargo/env rustup component add rustfmt
This should be all what we need.
Before compiling the Solana Tool Suite, you will need
coreutils installed on your computer in case you don’t have it:
brew install coreutils
Now let’s clone the Solana repository. I’m using shallow cloning to speed up things since the entire commit history is not needed.
# grab only the repo state at the v1.9.2 tag git clone --depth 1 --branch v1.9.2 https://github.com/solana-labs/solana.git
Then, go into the directory and run the
cd solana ./scripts/cargo-install-all.sh . echo "export PATH=$PWD/bin:\$PATH" >> ~/.zshrc
This will take a while, but after it is finished, you can verify if the installation is successful with:
Anchor is the recommended framework for Solana programs.
Since there’s no official binary available for the M1 architecture, we’ll also need to build from source:
cargo install --git https://github.com/project-serum/anchor --tag v0.19.0 anchor-cli --locked
Then, you can verify if the installation is successful with:
And that’s it. Have fun building with Solana on your M1 Mac natively!
Also building in Web3? Let's connect via Twitter 👋 @0xMuse