Ethereum Docker开发环境搭建(Mac版)

来源:互联网 发布:nginx 如何配置conf 编辑:程序博客网 时间:2024/05/21 22:24

本文提供一个简单搭建以太坊Docker开发环境的方法。步骤如下:

$ git clone https://github.com/Capgemini-AIE/ethereum-docker.git 

$ cd ./ethereum-docker

#启动以太坊Docker cluster!

$ docker-compose up -d

$ docker exec -it ethereumdocker_eth_1 /geth attach ipc://root/.ethereum/devchain/geth.ipc


Welcome to the Geth JavaScript console!


instance: Geth/v1.5.9-stable-a07539fb/linux/go1.6.2

coinbase: 0x007ccffb7916f37f7aeef05e8096ecfbe55afc2f

at block: 0 (Thu, 01 Jan 1970 00:00:00 UTC)

 datadir: /root/.ethereum/devchain

 modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0



成功进入Geth JavaScript console!

启动或者停止挖矿:

$ docker exec -it bootstrap geth --datadir=~/.ethereum/devchain --exec 'miner.start()' attach

$ docker exec -it bootstrap geth --datadir=~/.ethereum/devchain --exec 'miner.stop()' attach


另外,本文测试启动standalone模式没有成功,暂时没有找到原因,后序分析~

$ docker-compose -f docker-compose-standalone.yml up -d