区块链学堂(15):Mist

分手后的思念是犯贱 2022-06-02 05:12 503阅读 0赞

回顾一下之前用Geth搭建的私有网络

创建链条的geth命令

  1. geth --datadir "./" init genesis.json
  2. geth --datadir "./" --nodiscover console 2>>geth.log

在命令行模式下, 新建账号,并且启动挖矿

  1. > personal.newAccount("123")
  2. "0x48ad44beba68a981e103d28b2bd5777ef21ba0e3"
  3. > miner.start()
  4. true
  5. >

如果链条已经被关闭的话,或者启动不了,或者挖矿无法产生比特币的话,可以重置以太坊私链。

重置以太坊私有链的方法
  • 1.删除根目录下的隐藏文件夹.ethash, 在mac系统中该文件夹在 ~/
  • 2.删除以太坊私有链所在文件夹下的geth/keystore两个文件夹 import_mist_01.png
私有链正常工作的日志如下图所示:

import_mist_02.png

" class="reference-link">打开私有链所在文件夹,注意应该有一个文件,叫geth.ipc, 记录下文件夹地址import_mist_03.png

Mist 工具

Mist github地址:https://github.com/ethereum/mist

The Mist browser is the tool of choice to browse and use Ðapps.

Mist 是以太坊官方提供的浏览器,通过Mist我们可以很方便的连接上我们的私有网络,从而更好的开发、调试、测试我们的智能合约。

Step 1 安装依赖项

安装步骤,请参见github地址:https://github.com/ethereum/mist

  1. $ curl https://install.meteor.com/ | sh
  2. $ npm install -g electron@1.3.13
  3. $ npm install -g gulp

Step 2 安装Mist本体

  1. $ git clone https://github.com/ethereum/mist.git
  2. $ cd mist
  3. $ git submodule update --init
  4. $ yarn

Step 3 运行Mist/interface 也就是mist的后台程序

  1. $ cd mist/interface && meteor --no-release-check

这个阶段费时可能稍长,会启动mongodb, proxy等。完成后的控制台截图如下:

import_mist_04-1.png

Step 4 新开一个窗口,用geth.ipc启动Mist

新开一个窗口,回到mist文件夹下面,输入下方的命令

  1. electron . --rpc /Users/linchen/steveproject2/tmpPrivate/geth.ipc

注意这里的地址/Users/linchen/steveproject2/tmpPrivate/geth.ipc 就是前面我们新建的以太坊私有连下的geth.ipc文件。

import_mist_05.png

启动后的Mist界面如下

import_mist_06.png

下一章中我们会继续详细介绍Mist


QQ群:559649971 (区块链学堂粉丝群)
个人微信:steven_k_colin

stevenkcolin.jpg

获取最新区块链咨询,请关注《以太中文网》微信公众号:以太中文网

ethchinese.jpg

发表评论

表情:
评论列表 (有 0 条评论,503人围观)

还没有评论,来说两句吧...

相关阅读