- Solidity - Discussion
- Solidity - Useful Resources
- Solidity - Quick Guide
- Solidity - Error Handling
- Solidity - Events
- Solidity - Assembly
- Solidity - Libraries
- Solidity - Interfaces
- Solidity - Abstract Contracts
- Solidity - Constructors
- Solidity - Inheritance
- Solidity - Contracts
- Solidity - Restricted Access
- Solidity - Withdrawal Pattern
- Cryptographic Functions
- Mathematical Functions
- Function Overloading
- Solidity - Fallback Function
- Solidity - Pure Functions
- Solidity - View Functions
- Solidity - Function Modifiers
- Solidity - Functions
- Solidity - Style Guide
- Solidity - Special Variables
- Solidity - Ether Units
- Solidity - Conversions
- Solidity - Mappings
- Solidity - Structs
- Solidity - Enums
- Solidity - Arrays
- Solidity - Strings
- Solidity - Decision Making
- Solidity - Loops
- Solidity - Operators
- Solidity - Variable Scope
- Solidity - Variables
- Solidity - Types
- Solidity - Comments
- Solidity - First Application
- Solidity - Basic Syntax
- Solidity - Environment Setup
- Solidity - Overview
- Solidity - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Sopdity - Environment Setup
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