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

Blog    

Recommend

MySQL data type details

Table of contents 1. Numeric Type 1.1 Classificat...

A very detailed tutorial on installing rocketmq under Docker Desktop

Install Docker Desktop Download address: Docker D...

Detailed explanation of Mysql's method of optimizing order by statement

In this article, we will learn about the optimiza...

Detailed analysis of several situations in which MySQL indexes fail

1. Leading fuzzy query cannot use index (like ...

Details of various font formats in HTML web pages

This section starts with the details of text modi...

Two-hour introductory Docker tutorial

Table of contents 1.0 Introduction 2.0 Docker Ins...

Vue uses echart to customize labels and colors

This article example shares the specific code of ...

Detailed explanation of gcc command usage under Linux system

Table of contents 1. Preprocessing 2. Compilation...

nuxt.js multiple environment variable configuration

Table of contents 1. Introduction 2. Scenario 3. ...

How to block IP and IP range in Nginx

Written in front Nginx is not just a reverse prox...

Summary of React's way of creating components

Table of contents 1. Create components using func...

foreman ubuntu16 quick installation

Quickstart Guide The Foreman installer is a colle...

HTML+CSS to achieve layered pyramid example

This article mainly introduces the example of imp...