以太坊环境部署

安装环境

Ubuntu 16.04 linux系统

安装git

1.Linux下直接敲命令实现安装:

apt-get install git

2.如果出现无法安装的情况,请先更新源:

apt-get updata

3.安装成功直接查看版本即可

git -v

安装NodeJS

1.先从网上下载安装包:

wget http://nodejs.org/dist/v10.10.0/node-v10.10.0.tar.gz

2.解压安装包:

tar zxvf node-v10.10.0.tar.gz

3.进入node-v10.10.0.tar.gz目录执行config文件

cd node-v10.10.0.tar.gz
./config

4.编译及安装

make && make install

5.安装成功可查看版本

node -v
npm -v

安装solc

solidity是以太坊智能合约的开发语言,在测试智能合约、开发Dapp都需要用到这个工具

安装solc

sudo npm install -g solc solc-cli --save-dev

安装过程中出现问题及解决办法
运行solcjs --help报错
/usr/bin/env: ‘node’: No such file or directory
可能是solc与solc-cli的版本不匹配,未解决,走下面的步骤

sudo ln -s /usr/bin/nodejs /usr/local/bin/node

如果需要在geth控制台使用solc编译器,需要以下步骤,添加以太坊官方apt源

sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install -y solc

安装以太坊客户端以及docker容器

安装第一步:

sudo add-apt-repository -y ppa:ethereum/ethereum

安装第一步出现问题及解决办法
执行上诉命令时出现add-apt-repository: command not found时的解决办法如下:

sudo apt-get install python-software-properties

安装查询工具:

sudo apt-get install apt-file

更新一下:

apt-file update

查询包的位置:

apt-file search add-apt-repository

最后安装:

sudo apt-get install software-properties-common

安装第二步:

sudo apt-get update

安装第三步:

sudo apt-get install \apt-transport-https \ca-certificates \curl \software-properties-common \ethereum \docker.io \docker-compose

安装第四步:
所有其他先决条件都将由Puppeth通过docker本身引入,因此需要确保允许当前用户首先操作Docker命令:

sudo usermod -a -G docker $USER

猜你喜欢

转载自blog.csdn.net/qq_36651243/article/details/88633732