Fatal: Failed to start mining: etherbase missing: etherbase must be explicitly specified

可以在geth 命令后面加上--mine 来自动启动挖矿, 加上--minerthreads 参数表示挖矿的线程数

例如geth --mine --minerthreads=4

功能等效于miner.start(4)

也可以在console里面用miner.start(4)来启动挖矿 miner.stop()来停止挖矿.

> miner.start(8)
true
> miner.stop()
true

为了获得ether ,我们必须要有etherbase(or coinbase)地址,etherbase默认是第一个account,即eth.accounts[0]

如果没有etherbase(or coinbase),运行geth --mine则不能启动会报错

我们也可以在命令行中设置etherbase,如下命令:

geth --etherbase 1 --mine  2>> geth.log // 1 is index: second account by creation order OR
geth --etherbase '0xa4d8e9cae4d04b093aac82e6cd355b6b963fb7ff' --mine 2>> geth.log

也可以在console中重置我们的etherbase,

miner.setEtherbase(eth.accounts[2])

etherbase不一定非要用本地用户地址,只要是一个合法标准存在的地址就可以了

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值