此环境只在开发dapp时使用,不建议在上线版本中使用
此步骤仅给一个飞机票,默认大家对docker还有些了解
git clone -b dev https://github.com/entanmo/etm.git
为什么选用dev分支?因为最新的修改都会在dev分支上体现,大家也可以clone master分支
cd etm //进入etm代码主目录
./dockerStart.sh //mac或者linux系统可以运行此命令
docker run -it --rm --name etm-dev -v $(pwd):/etm -p 4096:4096 ray0523/etm_base /bin/bash -c "npm install https://github.com/entanmo/etm-js.git https://github.com/entanmo/etm-vm.git && npm install && node app.js"
ray0523/etm_base : 已经安装好etm启动环境的 ubuntu 16.04镜像
npm install xxx : 每次启动都会安装对应的js库,什么不打包按照到镜像中,因为我懒,还有就是随着etm的完善,可能会添加新的库文件。
其他的命令属于docker命令,不在此细说。
等待编译后主链就启动起来了
info 2018-09-13 01:44:21 500 dapps.js:2433 start to launch 0 installed dapps
warn 2018-09-13 01:44:21 518 dapps.js:2449 EnTanMo witness club dapp is not found
info 2018-09-13 01:44:21 520 peer.js:455 Peers ready, stored 3
debug 2018-09-13 01:44:22 121 transport.js:733 Request { url: 'http://40.114.70.112:4096/peer/list',
statusCode: 500,
err: null }
debug 2018-09-13 01:44:22 124 loader.js:477 startSyncBlocks enter
debug 2018-09-13 01:44:22 127 loader.js:481 startSyncBlocks enter sequence
debug 2018-09-13 01:44:22 189 transport.js:733 Request { url: 'http://122.112.246.141:4096/peer/transactions',
statusCode: 500,
err: null }
debug 2018-09-13 01:44:22 192 transport.js:733 Request { url: 'http://122.112.246.141:4096/peer/signatures',
statusCode: 500,
err: null }
debug 2018-09-13 01:44:22 370 transport.js:733 Request { url: 'http://52.187.232.98:4096/peer/list'
git clone https://github.com/entanmo/etm-wallet.git
cd etm-wallet
vi config/ip.js //修改ip地址为本地etm主链ip端口
./dockerStartWallet.sh //运行脚本
docker run -d --name etm-wallet -w /etm -v $(pwd):/etm -p 8888:8080 node /bin/bash -c "npm install && npm run dev"
- node 代表标准的node环境
- -c "npm install && npm run dev" : 编译安装
I Your application is running here: http://0.0.0.0:8080
ps:此处注意host必须是0.0.0.0,docker中不认localhost