使用 docker 进行iost 测试链节点搭建
准备工作
- 准备一台 4 核 8 G 内存或者以上规格的服务器(家用主机也可以),磁盘最好有 1T(最好 SSD,不然问题多多),这个是官方推荐的配置。
- 在服务器上安装 ubuntu 16.04 系统(或者是 linux 内核版本 3.x 或者 以上的 linux 发行版)
- 安装 docker-ce 17.03 或者以上版本(docker 社区版,有钱就上 docker-ee 企业版)
- 在服务器上选定路径作为
iost-node
的数据文件夹,本文选取/home/www/docker-volumes/iost-testnet
部署命令
其中 /home/www/docker-volumes/iost-testnet
路径是 iost 的数据文件夹
# 1. 下载创始块
curl -fsSL "https://developers.iost.io/docs/assets/testnet/latest/genesis.tgz" | tar zxC
# 2. 下载 testnet 的网络配置文件
curl -fsSL "https://developers.iost.io/docs/assets/testnet/latest/iserver.yml" -o /home/www/docker-volumes/iost-testnet/iserver.yml
# 3. 拉取 iost-node 的docker镜像
docker pull iostio/iost-node
# 4. 启动 iost-node
docker run -d \
--name iserver \
-v /home/www/docker-volumes/iost-testnet:/var/lib/iserver \
-p 30000-30003:30000-30003 \
--restart unless-stopped \
iostio/iost-node
开放端口是 30000 到 30003,其中 30001 是 iost-node rpc 端口。
验证节点是否启动
curl localhost:30001/getChainInfo
返回如下:
{
"net_name": "debugnet",
"protocol_version": "1.0",
"chain_id": 1023,
"head_block": "6341850",
"head_block_hash": "5oHNGPxz17CQJdUeDXqZFqwJkzetMonRGSjmupwy629W",
"lib_block": "6341829",
"lib_block_hash": "2YxTi4zS2YvrDma23MQQmNPPexaXZ25p5FxY5rTqqH6L",
"witness_list": [
"Dy3X54QSkZ6gR7e5ArNXDRdwADMkU99trgzXFjUutQfM",
"7dSyxLSUEtrnjKaEjfjREUX4b3E4PvdTVCDZPmEFVL1W",
"GsnNLxEyxZPVZR2byAPGKhmAewArxP5fX4sGm3477dGY",
"EkRgHNoeePcXtCDAaRsfjdkvTtbuJQSfZGipCpQDZrK1",
"AcUVEg2RmxtFsybwGgnFZdByoY86MU6M8fZgk8L2pc7F",
"6ZbxRTaT5L2gqxrqgzmyAf2JkyuDqwyy12uvo31YKetd",
"Fc9AZ4CSJ91w2rSCYnhWtpLiy9ZdbJNQqkWqsk3N8Ph1"
],
"lib_witness_list": [
"Dy3X54QSkZ6gR7e5ArNXDRdwADMkU99trgzXFjUutQfM",
"7dSyxLSUEtrnjKaEjfjREUX4b3E4PvdTVCDZPmEFVL1W",
"GsnNLxEyxZPVZR2byAPGKhmAewArxP5fX4sGm3477dGY",
"EkRgHNoeePcXtCDAaRsfjdkvTtbuJQSfZGipCpQDZrK1",
"AcUVEg2RmxtFsybwGgnFZdByoY86MU6M8fZgk8L2pc7F",
"6ZbxRTaT5L2gqxrqgzmyAf2JkyuDqwyy12uvo31YKetd",
"Fc9AZ4CSJ91w2rSCYnhWtpLiy9ZdbJNQqkWqsk3N8Ph1"
],
"pending_witness_list": [
"Dy3X54QSkZ6gR7e5ArNXDRdwADMkU99trgzXFjUutQfM",
"7dSyxLSUEtrnjKaEjfjREUX4b3E4PvdTVCDZPmEFVL1W",
"GsnNLxEyxZPVZR2byAPGKhmAewArxP5fX4sGm3477dGY",
"EkRgHNoeePcXtCDAaRsfjdkvTtbuJQSfZGipCpQDZrK1",
"AcUVEg2RmxtFsybwGgnFZdByoY86MU6M8fZgk8L2pc7F",
"6ZbxRTaT5L2gqxrqgzmyAf2JkyuDqwyy12uvo31YKetd",
"Fc9AZ4CSJ91w2rSCYnhWtpLiy9ZdbJNQqkWqsk3N8Ph1"
],
"head_block_time": "1553821999001333299",
"lib_block_time": "1553821988501313217"
}
参考: