wget https://go.dev/dl/go1.17.5.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.17.5.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
go install github.com/htmlcoin/solar/cli/solar@latest
sudo cp ~/go/bin/* /bin/
export HTMLCOIN_RPC=http://RPCUSENAME:RPCPASSWORD@localhost:4889
Install Solidity - Smart Contract Language (Install the version that the smart contract requires)
Install prerequisites here: https://docs.soliditylang.org/en/latest/installing-solidity.html#building-from-source
wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1.tar.gz
tar -xzf cmake-3.22.1.tar.gz && cd cmake-3.22.1
./configure
make
sudo make install
cd ..
sudo apt-get install libboost-all-dev g++-8 gcc-8
git clone --recursive https://github.com/ethereum/solidity.git
cd solidity
mkdir build
cd build
cmake -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_C_COMPILER=gcc-8 .. && make
cd solc && sudo cp solc /bin/
Quickstart for Selecting SOLC version
pip3 install solc-select
Usage
The global version of solc can be set with the solc-select use <version> command:
solc --version
solc, the solidity compiler commandline interface
Version: 0.5.2+commit.1df8f40c.Linux.g++
solc-select use 0.4.24
Switched global version to 0.4.24
solc --version
solc, the solidity compiler commandline interface
Version: 0.4.24+commit.e67f0147.Linux.g++