一. ETH镜像下载
- 下载以太坊基础镜像
docker pull ethereum/client-go:v1.10.16
二.ETH容器生成
- 新建ETH数据目录
mkdir -p /opt/docker/public-geth
- ETH容器启动命令
docker run -itd --restart=unless-stopped -v /etc/localtime:/etc/localtime -v /etc/timezone:/etc/timezone --name public-eth -v /opt/docker/public-geth:/root/.ethereum -p 8545:8545 -p 30303:30303 ethereum/client-go:v1.10.16 --http.api "db,eth,net,web3,personal,admin,miner" --http --http.addr "0.0.0.0" --cache 2048 --maxpeers 30 --allow-insecure-unlock
参数解释:
--http.api:指定需要调用的HTTP-RPC API接口,默认只有eth,net,web3
--http:启动HTTP-RPC服务(基于HTTP的)
--http.addr:HTTP-RPC服务器监听地址(default: "localhost")
--cache:分配给内部缓存的内存的兆字节 (默认值为: 1024)
--maxpeers:最大的