Install ethereum/Ethereum from scratch under CentOS7

Install ethereum/Ethereum from scratch under CentOS7

Preface

This is my first time to use Linux. I encountered many problems during the installation process. I found that there is no comprehensive tutorial on how to install Ethereum. Here I summarize my method. If you have any questions, I hope you can point them out.

Add sudo write permissions

Enter root first

su 
chmod u+w /etc/sudoers
vi /etc/sudoers

Find root ALL=(ALL) ALL, add klose ALL=(ALL) ALL under it and save (press a to add, press esc to exit insert mode and enter :wq after adding and saving)

chmod uw /etc/sudoers
exit

The installation of brew requires new versions of git and curl. The versions that come with CentOS 7 are too low and need to be updated.

Install git 2.9.0

Download and install git 2.9.0

wget --no-check-certificate https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.0.tar.gz
tar -zxvf git-2.9.0.tar.gz
cd git-2.9.0
sudo yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker kernel-headers glibc-headers gcc-c++
./configure --prefix=/usr/local/git
make 
sudo make install

Environment Configuration

vim /etc/profile

Add at the end (the environment variables are added here)

export PATH=/usr/local/git/bin:$PATH
export PATH=/usr/local/git/libexec/git-core:$PATH
export PATH=/usr/local/openssl:$PATH
export PATH=/usr/local/curl:$PATH

Effective immediately

source /etc/profile

Next, in order not to reconfigure the environment variables every time you open the shell

vim ~/.bashrc

Add a sentence

source /etc/profile
vim ~/.bash_profile

Add a sentence

source ~/.bash_profile

Check the git path and version to make sure git is successfully installed, remove the old version of git that comes with Centos7, and connect to the new version of git

which -a git
git --version
sudo mv /usr/bin/git /usr/bin/git.bak
sudo ln -s /usr/local/git/bin/git /usr/bin/git

Install openssl 1.1.1l

wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.1l.tar.gz
tar -xzvf openssl-1.1.1l.tar.gz
cd openssl-1.1.1l
./config --prefix=/usr/local/openssl --openssldir=/usr/local/ssl shared zlib
make
sudo make install

Remove the old version of openssl and create a soft link

sudo mv /usr/bin/openssl /usr/bin/openssl.bak
sudo mv /usr/include/openssl /usr/include/openssl.bak
sudo ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
sudo ln -s /usr/local/openssl/include/openssl /usr/include/openssl

Update Configuration

sudo ldconfig
sudo ldconfig -v

Check the openssl version. If it is 1.1.1.l, the installation is successful.

openssl version

Install curl 7.54.0

wget --no-check-certificate https://curl.haxx.se/download/curl-7.54.0.tar.gz
tar -zxf curl-7.54.0.tar.gz
cd curl-7.54.0
./configure --prefix=/usr/local/curl --with-ssl=/usr/local/openssl --libdir=/usr/lib64
make
sudo make install

Replace the system curl and create a soft connection

sudo mv /usr/bin/curl /usr/bin/curl.bak
sudo ln -s /usr/local/curl/bin/curl /usr/bin/curl
suvi /etc/ld.so.conf

Add /usr/local/curl/lib

exit

Check curl version

sudo ldconfigcurl -V

Install brew

Use the domestic mirror installation command of gitee boss, and ruby ​​will be automatically installed after installation

rm Homebrew.sh ; wget https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh ; bash Homebrew.sh

Install node & npm

cd /usr/local
sudo wget --no-check-certificate https://npm.taobao.org/mirrors/node/v10.14.1/node-v10.14.1-linux-x64.tar.gz
tar -xvf node-v10.14.1-linux-x64.tar.gz
sudo mv node-v10.14.1-linux-x64 node
sudo rm node-v10.14.1-linux-x64.tar.gz

Environment Configuration

suvi /etc/profile

Add to

export NODE_HOME=/usr/local/node  
export PATH=$NODE_HOME/bin:$PATH

quit

source /etc/profile

Create a soft link

sudo ln -s /usr/local/node/bin/npm /usr/bin/npm
sudo ln -s /usr/local/node/bin/node /usr/bin/node
sudo ln -s /usr/local/node/bin/node-waf /usr/bin/node-waf
sudo ln -s /usr/local/node/lib/node /usr/lib/node

Check the version

node -vnpm -v

Install ethereum

brew tap ethereum/ethereum
brew install ethereum

May report an error

Error: Your HOMEBREW_BOTTLE_DOMAIN still contains "linuxbrew". You must unset it (or adjust it to not contain linuxbrew.eg by using homebrew instead).

Solution: Please note that it cannot be executed in advance, which may cause the brew installation to fail.

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

Install remix

sudo npm install remix-ide -g
remix-ide

remixd error

vim /usr/local/node/lib/node_modules/remix-ide/bin/remix-ide

Comment remixd related code (the file is in js format, commented with // and /* …*/, # will change color but it doesn’t work)
Enter

http://localhost:8080/index

You can write smart contracts

PS yum issue

After installing curl, yum may report an error. This is due to a problem with libcurl. The author does not have a good solution and it does not succeed every time.

This is the end of this article about installing ethereum/Ethereum from scratch on CentOS7. For more information about installing ethereum/Ethereum on CentOS7, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed introduction to deploying k8s cluster on centos7 system
  • Install MySQL5.5 database in CentOS7 environment
  • CentOS system rpm installation and configuration of Nginx

<<:  MySQL Database Indexes and Transactions

>>:  HTML realizes real-time monitoring function of Hikvision camera

Recommend

How to implement the prototype pattern in JavaScript

Overview The prototype pattern refers to the type...

Use of MySQL triggers

Triggers can cause other SQL code to run before o...

Getting Started Guide to MySQL Sharding

Preface Relational databases are more likely to b...

Let's talk about MySQL joint query in detail

Table of contents Union query 1. Query the ID and...

Solution to interface deformation when setting frameset height

Currently I have made a project, the interface is ...

View the port number occupied by the process in Linux

For Linux system administrators, it is crucial to...

Teach you how to use docker-maven-plugin to automate deployment

1. Introduction to docker-maven-plugin In our con...

A brief discussion on the implementation principle of Webpack4 plugins

Table of contents Preface know Practice makes per...

Solve the problem of not finding NULL from set operation to mysql not like

An interesting discovery: There is a table with a...

Solution to the problem that the docker container cannot be stopped

The solution is as follows: 1. Force delete conta...

How to handle token expiration in WeChat Mini Programs

Table of contents Conclusion first question Solut...

Tomcat maxPostSize setting implementation process analysis

1. Why set maxPostSize? The tomcat container has ...

Example of implementing skeleton screen with Vue

Table of contents Skeleton screen use Vue archite...

Detailed explanation of Vue monitoring attribute graphic example

Table of contents What is the listener property? ...