1. 拉取镜像
docker pull eosio/eos-dev:v1.3.0
2. 创建虚拟网关
docker network create eos-dev
3. 启动nodeos、keosd
nodeos: docker run --name nodeos -d -p 8888:8888 --network eosdev -v e:/work/docker/eos/work:/work -v e:/work/docker/eos/data:/mnt/dev/data -v e:/work/docker/eos/config:/mnt/dev/config eosio/eos-dev:v1.3.0 /bin/bash -c "nodeos -e -p eosio --plugin eosio::producer_plugin --plugin eosio::history_plugin --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --plugin eosio::http_plugin -d /mnt/dev/data --config-dir /mnt/dev/config --http-server-address=0.0.0.0:8888 --access-control-allow-origin=* --contracts-console --http-validate-host=false"
keosd:docker run -d --name keosd --network=eosdev -i eosio/eos-dev:v1.3.0 /bin/bash -c "keosd --http-server-address=0.0.0.0:9876"
4. 查看是否成功运行
网页:http://localhost:8888/v1/chain/get_info
控制台:curl http://localhost:8888/v1/chain/get_info
注意事项:https://github.com/EOSIO/eos/issues/4742
错误: database dirty flag set (likely due to unclean shutdown): replay required
原因:关闭docker时应该添加参数“-t 300”。
解决:docker start 添加参数“--replay-blockchain --hard-replay-blockchain”(耗时比较长!)