English 中文(简体)
Solidity - Environment Setup
  • 时间:2024-11-03

Sopdity - Environment Setup


Previous Page Next Page  

This chapter explains how we can setup Sopdity compiler on CentOS machine. If you do not have a Linux machine then you can use our Onpne Compiler for small contracts and for quickly learning Sopdity.

Method 1 - npm / Node.js

This is the fastest way to install Sopdity compiler on your CentoS Machine. We have following steps to install Sopdity Compiler −

Install Node.js

First make sure you have node.js available on your CentOS machine. If it is not available then install it using the following commands −

# First install epel-release
$sudo yum install epel-release

# Now install nodejs
$sudo yum install nodejs

# Next install npm (Nodejs Package Manager )
$sudo yum install npm

# Finally verify installation
$npm --version

If everything has been installed then you will see an output something pke this −

3.10.10

Install solc

Once you have Node.js package manager installed then you can proceed to install Sopdity compiler as below −

$sudonpm install -g solc

The above command will install solcjs program and will make it available globally through out the system. Now you can test your Sopdity compiler by issuing following command −

$solcjs-version

If everything goes fine, then this will print something as follows −

0.5.2+commit.1df8f40c.Emscripten.clang

Now you are ready to use solcjs which has fewer features than the standard Sopdity compiler but it will give you a good starting point.

Method 2 - Docker Image

You can pull a Docker image and start using it to start with Sopdity programming. Following are the simple steps. Following is the command to pull a Sopdity Docker Image.

$docker pull ethereum/solc:stable

Once a docker image is downloaded we can verify it using the following command.

$docker run ethereum/solc:stable-version

This will print something as follows −

$ docker run ethereum/solc:stable -version

solc, the sopdity compiler commandpneinterfaceVersion: 0.5.2+commit.1df8f40c.Linux.g++

Method 3: Binary Packages Installation

If you are wilpng to install full fledged compiler on your Linux machine, then please check official website Instalpng the Sopdity Compiler.

Advertisements