Setting Up Your Blockchain Developing Environment
You can write Solidity contracts on a variety of IDEs and editors, but Visual Studio Code (VS Code) is one of the most widely used editors in the community. What makes VS Code so powerful is it's light weight and provides battle tested plug-in extensions for all types of software development.
VS Code can be downloaded from their website below.
After installing VS Code, navigate to the extensions page and install the Solidity by Juan Blanco extension for specific syntax highlighting.
There are many other blockchain extensions for VS Code, but Solidity by Juan Blanco will provide the basic necessities for smart contract development.
I recommend downloading the LTS (Long Term Support) version because of its stability.
Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software. Hardhat is used through a local installation in your project. This will help with reproducing your environment and avoid future version conflicts.
To install, create a npm project by going to an empty folder, running
npm init, and following its instructions. Once your project is ready, you should run this command in the CLI:
npm install --save-dev hardhat
To use your local installation of Hardhat, run this command in the CLI:
For a more in-depth guide to installing Hardhat into your environment, visit the Hardhat docs in the link below.
web3.js is a collection of libraries that allow you to interact with a local or remote Ethereum node using HTTP, IPC or WebSocket. These libraries are a collection of modules that contain pivotal functionality for the Ethereum ecosystem.
Use npm to install the latest version of web3.js. Run this command in the CLI:
npm install web3
After creating a web3 instance and set a provider, you can utilize a Web3 variable like so:
const Web3 = require('web3');
For a more in-depth guide to installing web3.js into your environment, visit the web3.js docs in the link below.