前言
Mist 是以太坊官方提供的浏览器,通过Mist我们可以很方便的连接上我们的私有网络,从而更好的开发、调试、测试我们的智能合约。
我们在两台ubantu16上同时尝试安装Mist,踩了不少坑,出现了许多报错,所以跟大家分享。
在进行配置时,我们建议打击先安装一下搜狗输入法、vim等。
安装步骤
Step 1 安装依赖项
安装步骤,也可参见github地址:https://github.com/ethereum/mist
1.1 $ curl https://install.meteor.com/ | sh
注:执行此命令会报错:
curl: (7) Failed to connect to meteorinstall-4168.kxcdn.com port 443: 拒绝连接
Retrying download in 5 seconds...
解决方案1:
1.我们可以先将https://install.meteor.com/内容手动复制到本地的新建文件xx.sh
2.TARBALL_URL="https://meteorinstall-4168.kxcdn.com/packages-bootstrap/${RELEASE}/meteor-bootstrap-${PLATFORM}.tar.gz"
https://meteorinstall-4168.kxcdn.com这个域名需要翻墙才能访问。
很巧,发现了 一个 允许大陆网络 直接的访问的域名:
https://d3sqy0vbqsdhku.cloudfront.net
所以把安装URL稍作修改:
TARBALL_URL=https://d3sqy0vbqsdhku.cloudfront.net/packages-bootstrap/${RELEASE}/meteor-bootstrap-${PLATFORM}.tar.gz
3.执行sudo sh xx.sh
方案二:
1. git clone git://github.com/meteor/meteor.git
2. cd meteor/
3. ./meteor –help 让其更新包
推荐方案一
1.2 $ npm install -g [email protected]
方案一:首先安装npm命令
sudo apt install nmp
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
sudo cnpm install -g electron 注:最好注明办版本
方案二:
先安装yarn
sudo npm install –g yarn
然后通过yarn命令安装:
$ yarn global add [email protected]推荐方案二
1.3 $ npm install -g gulp建议替换成$ yarn global add gulp
Step 2 安装Mist本体
2.1 $ git clone https://github.com/ethereum/mist.git2.2 $ cd mist
2.3 $ yarn
yarn --ignore-engines
注:需要先安装yarn,之前选择方案二已安装
执行yarn可能会报错:
报错1:
error /home/heres/mist/node_modules/electron-chromedriver: Command failed.
Exit code: 1
Command: sh
Arguments: -c node ./download-chromedriver.js
Directory: /home/heres/mist/node_modules/electron-chromedriver
Output:
/home/heres/mist/node_modules/electron-chromedriver/download-chromedriver.js:16
if (error != null) throw error
^
Error: EACCES: permission denied, link '/tmp/electron-tmp-download-12412-1502585583598/chromedriver-v2.21-linux-x64.zip' -> '/home/heres/.electron/chromedriver-v2.21-linux-x64.zip'
at Error (native)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
解决方法:
sudo yarn命令执行
报错二:
解决方案:
翻墙,配置hosts文件。
Step 3 运行Mist/interface 也就是mist的后台程序
3.1 $ cd mist/interface && meteor --no-release-check
这个阶段费时可能稍长,会启动mongodb, proxy等。完成后的控制台截图如下:
Step 4 新开一个窗口,用geth.ipc启动Mist
新开一个窗口,回到mist文件夹下面,输入下方的命令
4.1 electron . --rpc /url/geth.ipc
注意这里的地址/Users/linchen/steveproject2/tmpPrivate/geth.ipc 就是前面我们新建的以太坊私有连下的geth.ipc文件。
启动后的Mist界面如下: