August 21, 2018

Setting up a new MacBook for Ethereum Development

AKA How to setup your Ethereum Battle Station

Setting up a new MacBook for Ethereum Development

AKA How to setup your Ethereum Battle Station

I recently upgraded to a new machine and figured I'd document my setup process for getting my developer tools installed.  

Open Safari, download the Brave browser.  Brave now has the MetaMask plugin and you can turn it on via Preferences > Extensions.  You will need the plugin later for your interactions with the web 3.0.  The Brave browser is also a good thing to have anyway.

I download the following:
PyCharm CE Python Development studio
KeepassX Password Manager
Sublime text editor
Insomnia REST API client

I then install those apps while I wait for Xcode to download after running this command in the terminal:

xcode-select --install

Then I install Brew for package management.

/usr/bin/ruby -e "$(curl -fsSL"

Add the following to your bash profile:

nano ~/.bash_profile
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc

OK, now that we have some preliminary stuff figured out, let's install some packages with brew

brew install bash-completion ssh-copy-id wget git

Those are just nice-to-have command line utils.  Edit .bash_profile again and add the following to activate bash-complete.

if [ -f $(brew --prefix)/etc/bash_completion ]; then
source $(brew --prefix)/etc/bash_completion

Finally, we get to install Python 3

brew install python

I also upgraded pip

pip3 install --upgrade pip setuptools wheel

Then install virtualenv

pip3 install virtualenv

OK now we have Python 3 setup and in a pretty good place.  Wait! Why Python 3 you may ask? Well, it is my language of love, so yeah, gotta install it first on my machine.

Install your Ethereum Development Tools

Phew! We are finally ready to install. We will need NodeJS, Truffle, and Ganache.

NodeJS via brew

brew install node

Truffle via npm

npm install truffle -g

Ganache-cli via npm

npm install ganache-cli -g

or Download the GUI:  Link

Finally, if you are going to run the solc compiler for Solidity from your Terminal you will need the Ethereum tap in Brew.  For the Python module py-solc, you will need this installed in order to compile your smart contracts to bytecode.   I am also adding geth since you will need that for your own chains or other development testing.

brew update
brew upgrade
brew tap ethereum/ethereum
brew install solidity
brew install ethereum

Alrighty, we have the basics installed and you can start working on your Ethereum Dapps.  Getting a GitHub or GitLab account helps, but that is beyond the scope of this article.  I use PyCharm for my Python code and Sublime text for Ethereum development.

If you liked this article or have any questions, let me know.  Otherwise have fun,


Edited - 9-15-2018: Added the brew install for Ethereum client Geth

Edited - 8-22-2018: Added the brew install for Solidity