How to setup our environment for developing on Ethereum
There are lots of tutorials on the Internet for developing decentralized applications, smart contracts and write unit test with Solidity on the Ethereum blockchain. Including a few of our own, for that matter.
BUT a large part of them lack the initial environment setup, that is needed for someone just arriving in the blockchain space with a bag full of questions, wondering where the heck to start from.
So, after a series of questions received regarding this topic, I’m writing this, hoping, to help you out setup your ethereum solidity development environment if you are completely new to this space.
Prerequisites
- Windows, macOS, Linux computer or laptop
- Internet connection
- patience … :)
macOS setup
For macOS, ensure that you have the latest version of
Xcode installed.
This contains the Clang C++ compiler, the
Xcode IDE and other Apple development
tools which are required for building C++ applications on OS X.
If you are installing Xcode for the first time, or have just installed a new
version then you will need to agree to the license before you can do
command-line builds:
sudo xcodebuild -license accept
Ethereum Solidity OS X builds require you have Homebrew package manager installed for installing external dependencies.
Install Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"brew update
Install node and NPM (Node Package Manager) using brew — npm will be automatically installed with node:
brew install node
Then we can proceed with installing solc
which is the Solidity command-line compiler.
npm install -g solc
After that we install truffle
framework and ganache-cli
which will be our primary tools for compiling, testing and deployment.
npm install -g trufflenpm install -g ganache-cli
Windows setup
We need to install several things for a windows environment. The first one is git for windows — it’s a command-line tool for retrieving source code from Github. Next we need to have CMake installed, which is a cross-platform build file generator. And last we have to have a C++ compiler which we can get from Visual Studio Build Tools. The links for these three are below:
After that we can proceed with installing node and then solc
, truffle
, ganache-cli
like shown in the macOS setup.
Then we can proceed with installing
solc
which is the Solidity command-line compiler.
npm install -g solc
After that we install
truffle
framework andganache-cli
which will be our primary tools for compiling, testing and deployment.
npm install -g truffle
npm install -g ganache-cli
Originally published at hack — Blockchain Development and Consulting.