1. miner的start
方法啓動具有指定線程數量的CPU挖礦進程,並根據需要生成新的有向無環圖(參數爲啓動挖礦的線程數)。
miner.start(2)
效果如下:
2. miner的stop
方法用來停止CPU挖礦操作的執行。
miner.stop()
效果如下:
3. miner的setEtherBase
方法用來設置接收挖礦獎勵的以太坊賬號。
miner.setEtherbase(eth.accounts[1])
同時查看賬戶1中的餘額效果如下:
挖礦後,查看賬戶1的餘額: