Lets get you setup with the Solana Toolchain natively on the M1, M1 Pro and M1 Max.
One assumption I'll make before getting started is that when you type solana in your terminal you see the below
If you don't have Rust installed use this command to install it. Ensure that you are installing the aarch64-apple-darwin default version
Reopen the terminal and type rustup or rust --version and it shouldn't say command not found
You also want to install Homebrew if you don't have that.
Next we are going to run this command. We ultimately won't use rosetta but some packages of the toolchain seem to need it to install properly.
Clone the Solana github repo in a directory of your choosing
Once that’s done, cd into the Solana folder and now we will checkout the v1.8.7 branch. We want the version that is highest and suitable for use on Mainnet Beta here go with that.
Next we want to install coreutils. This will help us get over the greadlink: command not found error
We also want to install OpenSSL
Lastly from the solana folder, we want to run the script below. This will take some time as we are compiling all the toolchain binaries.
Once completed, lets export the binaries from the bin folder to the PATH
All the Solana CLI commands should be accessible and running natively at this point. But we aren't done!
Since we chose the chew glass method, the config file was never setup. Type
This will create the .config folder with the yml file in it but it will link us to mainnet. So lets change that
Now if you type
, you will get another error where our default wallet isn't found. So lets follow the suggestion and copy paste what you see similar to this
If your local test validator isn't running, type
Now if you type
, you should see some imaginary SOL
Now the last thing I wanted to talk about was Anchor. When developing locally, the local test validator as is (won't work since BPF-JIT only support X86_64)[https://github.com/solana-labs/solana/issues/18033#issuecomment-962718203]. We have to add the --no-bpf-jit flag
And with that we have setup our systems to develop Solana natively using the M1, M1 Pro or Max. If you have any question, you can reach me @_tkoriginal.
Stack Five a digital product dev shop that strives to push the boundaries of the web and build meaningful things. If you're looking to create a cutting-edge web application or need software engineering resources for your project, please contact us.