Install Solana on M1 Macs, without Rosetta đź’ˇ

Although both the Solana Tool Suite and Anchor have already got good native support for the M1 architecture, there are currently no official binary builds for the new Macs.

In this guide, we will go through all the steps needed to compile and install …


This content originally appeared on DEV Community and was authored by 0xMuse

Although both the Solana Tool Suite and Anchor have already got good native support for the M1 architecture, there are currently no official binary builds for the new Macs.

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.

Install Rust

First, you will need to install the Rust toolchain.

curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
rustup component add rustfmt

Rust is installed

This should be all what we need.

Install Solana Tool Suite

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 cargo-install-all.sh script.

cd solana
./scripts/cargo-install-all.sh .
echo "export PATH=$PWD/bin:\$PATH" >> ~/.zshrc

Solana is installed

This will take a while, but after it is finished, you can verify if the installation is successful with:

solana --version

There used to be an issue with solana-test-validator on M1 Macs, but the problem has been solved. You can try to spin it up to make sure it works.

Solana Test Validator is up and running

Install Anchor

Anchor is the recommended framework for Solana programs.

Note that Anchor uses Yarn v1 to manage Javascript dependencies in your project, so make sure you already have it installed on your computer.

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:

anchor --version

Anchor is installed

And that’s it. Have fun building with Solana on your M1 Mac natively!

Also building in Web3? Let's connect via Twitter đź‘‹ @0xMuse


This content originally appeared on DEV Community and was authored by 0xMuse


Print Share Comment Cite Upload Translate Updates
APA

0xMuse | Sciencx (2022-01-03T20:33:05+00:00) Install Solana on M1 Macs, without Rosetta đź’ˇ. Retrieved from https://www.scien.cx/2022/01/03/install-solana-on-m1-macs-without-rosetta-%f0%9f%92%a1/

MLA
" » Install Solana on M1 Macs, without Rosetta đź’ˇ." 0xMuse | Sciencx - Monday January 3, 2022, https://www.scien.cx/2022/01/03/install-solana-on-m1-macs-without-rosetta-%f0%9f%92%a1/
HARVARD
0xMuse | Sciencx Monday January 3, 2022 » Install Solana on M1 Macs, without Rosetta đź’ˇ., viewed ,<https://www.scien.cx/2022/01/03/install-solana-on-m1-macs-without-rosetta-%f0%9f%92%a1/>
VANCOUVER
0xMuse | Sciencx - » Install Solana on M1 Macs, without Rosetta đź’ˇ. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/03/install-solana-on-m1-macs-without-rosetta-%f0%9f%92%a1/
CHICAGO
" » Install Solana on M1 Macs, without Rosetta đź’ˇ." 0xMuse | Sciencx - Accessed . https://www.scien.cx/2022/01/03/install-solana-on-m1-macs-without-rosetta-%f0%9f%92%a1/
IEEE
" » Install Solana on M1 Macs, without Rosetta đź’ˇ." 0xMuse | Sciencx [Online]. Available: https://www.scien.cx/2022/01/03/install-solana-on-m1-macs-without-rosetta-%f0%9f%92%a1/. [Accessed: ]
rf:citation
» Install Solana on M1 Macs, without Rosetta đź’ˇ | 0xMuse | Sciencx | https://www.scien.cx/2022/01/03/install-solana-on-m1-macs-without-rosetta-%f0%9f%92%a1/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.