Solidity Development: Setting up the environment

Solidity Development: Setting up the environment

Nowadays, everything related to the crypto-world is becoming more and more popular. I bet you’ve also thought about launching your own successful startup with millions in investments! As the saying goes, though, no pain no gain. But at least let’s make the development of smart contracts less painful… Choosing the right development kit and setting up the environment is a first step to success. In this blog we’ll consider the most popular solutions for starting up your decentralized app, such as:

Remix IDE

Intellij-Solidity Plugin + Truffle + Ganache

Solidity Extension for Visual Studio + Blockapps-bloc

Remix IDE

Remix — is a web-based IDE for writing, deploying and running Solidity smart contracts. For now, it’s one of the most featured IDEs for smart contracts. After opening the Remix website you’ll see something like this:

Remix offers you an out-of-the-box ready solution for decentralized app development. You don’t have to install any plugins or modules, just open the browser and start coding. Everything else is already done for you.

Clearing of LocalStorage will remove all of your files (there is a workaround with using RemixD)

Intellij-Solidity Plugin + Truffle + Ganache

Intellij-Solidity — is a plugin for Intellij-based IDEs such as Webstorm, PhpStorm and PyCharm. This plugin offers syntax highlighting, code formatting and autocomplete for Solidity files. However, it doesn’t provide any solutions for compiling and deploying contracts.

Truffle Setup

Firstly, you have to install Truffle globally using the npm package manager:

1

npm install-gtruffle

Then you have to create a new directory for your project and go into it (the directory has to be empty):

1

2

mkdir MyFirstSolidityProject

cd MyFirstSolidityProject/

And finally run init truffle in our project directory:

1

truffle init

After initializing truffle in your project directory, you’ll get the following files generated:

We will cover why we need these files in the next blog. For now, we’ll just add some code to our truffle.js file to make it look like this:

1

2

3

4

5

6

7

8

9

module.exports={

networks:{

development:{

host:"127.0.0.1",

port:7545,

network_id:"*"

}

}

}

Here we specified the environment, called development, running on 127.0.0.1:7545. We’ll use it for deploying our contracts to the local Ethereum network.

Ganache CLI Setup

Now we have to install the Ganache CLI package globally with the npm package manager:

1

npm install-gganache-cli

Ganache will run a local instance of the Ethereum network on your machine, which may be useful during development and debugging. We have to run ganache on the port specified for our development environment above (7545). This could be done by the following command:

1

ganache-cli-p7545

After that you’ll see a list of generated test account addresses, their private keys, and mnemonic phrases for the wallet:

Wrap Up

Now that we have the local network up and running, we can compile and migrate our project to that network. To do this, we have to run the following command:

1

truffle compile

This will generate a json file for our contracts under ./build/contracts directory. Then we will migrate this data to the network using the developmentenvironment:

A lot of issues from users, related to expired certificates, that could make extension unavailable for some time

Conclusion

All in all, we’ve discovered the most popular solutions for setting up your environment and starting to develop smart contracts for Solidity with ease. I hope you’ve found something appropriate for your needs. In the next blog we’ll write our first smart contract and will deploy it to the local network.