1 min read

Coding in Solana - environment setup

I had a hell of a time getting a proper development environment setup for solana. Solana development requires at minimum:

  • rust
  • solana
  • anchor
  • node

In addition, the libraries are all under active development, plus my local machine is an M1 Mac. This is what I tried (and failed)

  • Native development on M1 Mac
  • Docker development on M1 Mac
  • amd64-linux emulated Docker development on M1 Mac
  • debian on AWS

I failed multiple times on debian, including compiling directly from solana source. Finally I was able to get it to work by downloading the prebuilt binary.

So attached is the gist for my development environment setup on an AWS EC2 t2.small Debian 10 (micro doesn't have enough memory for the test validator).

Update: Even this was not enough. Deploy time was too long. I recommend at least a t2.medium with 50Gb of hard disk space.

In general, I think anyone coding for solana needs to be prepared to relearn the entire toolkit every 3 months (which is not a bad thing).

When setting up the environment, eed to check that the following work:

  • solana-test-validator
  • anchor build

Because I faced lots of failures getting those two to work properly because of differences in machine vs compilation libraries.