Setting Up Development Environment for DApps (Windows & Linux)

This article explains the steps you need to follow for both Windows and Linux to setup your system immediately with necessary dependencies and develop your first Ethereum DApp.

 
 
If you’re thinking of diving into blockchain development, Ethereum DApps are a good starting point to harness the power of blockchain in building decentralized applications.
 
This article explains the steps you need to follow for both Windows and Linux to setup your system immediately with necessary dependencies and develop your first DApp.
 

Step 1: Install Node.js and Npm

 
Well I guess you probably have it installed on your system already if you are a developer. If not, follow the link below to proceed with installation.
 
Link: https://nodejs.org/en/
 
For Linux:
 
Paste the following commands in Terminal:
 
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
source ~/.profile
nvm install 10.14.1
nvm use 10.14.1
 

Step 2: Install Truffle

 
Truffle is a development environment and testing framework that makes building Ethereum Dapps easier and provides you the necessary nuggets for smart contracts manipulation.
 
Open node.js command prompt and paste the following command in the prompt to install Truffle.
 
npm install -g truffle
 
After the download is complete, type “truffle version” on node terminal to verify that truffle is successfully installed.
 
 
 
Same process goes for Linux.
 

Step 3: Install Ganache

 
Ganache is personal blockchain for building distributed applications with Ethereum. It gives you 10 free accounts with 100 fake ethers each for testing purposes.
 
Download Ganache from here: https://www.trufflesuite.com/ganache
 
 
 
For Linux:
 
You first need to get the AppImage file from this link under assets: https://github.com/trufflesuite/ganache/releases
 
 
 
Place the download file in suitable path and type the following command in terminal:
 
chmod a+x ganache-1.1.0-x86_64.AppImage
 

Step 4: Installing and Configuring Metamask

 
Note: Same process goes for both Linux and Windows user. Linux users can get the Metamask extension for Firefox.
 
Metamask extension makes it easier to interact with DApp by making browser acts like an Ethereum Wallet. Get the extension suitable for your browser from here: https://metamask.io/
 
Once metamask is installed you’ll see the following screen
 
 
 
Get started to start with the configurations.
 
 
 
Now click on “Import Wallet” and paste the seed phrase you have in MNEMONIC of your Ganache. Now setup your password and proceed.
 
 
 
Currently we have 0 Ethers in our account. Now we are going to connect metmask with Ganache to have fake ethers reflected in metamask. For that purpose chose “Custom RPC” from the drop down.
 
 
 
Copy the RPC server URL from Ganache and paste it into New RPC URL in Networks Tab and click Save.
 
 
 
Now you’ll see the Ethers reflected in your account.
 
 
 

Step 5: Chose your Code Editor

 
Choose your favorite code editor and start using it with Truffle and Ganache. I personally like using Sublime Text because it has the “Ethereum Package” that provides nice syntax highlighting for solidity.
 
For Linux:
 
Follow the following commands to get sublime text on Linux.
 
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.lis
sudo apt update
sudo apt install sublime-text
 
Congratulations! You have completed your setup. Happy Dapping!