5

Zilliqa RPC节点(seed节点)搭建说明-mainnet(开发用,docker方式,非挖矿)

 3 years ago
source link: http://www.blogjava.net/fangw/archive/2021/11/14/436047.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Zilliqa RPC节点(seed节点)搭建说明-mainnet(开发用,docker方式,非挖矿)

方伟的博客 j2ee技术、网络、web等,同名的人真多,我的QQ是20025404

posts - 20,comments - 14,trackbacks - 0

前言:zilliqa开发用的RPC节点只需要启动个seed节点即可,非常方便,40多G空间,几十分钟就可以同步完,资源占用极小。否则如果部署full节点就不是这么简单了。

1.服务器

zilliqa的seed节点 需要100G SSD(建议NVMe)硬盘,实际数据占用40多G,docker占用1.3G多。cpu内存均不需要太高,4核8G足够。

建议国外服务器,10M以上,不需要cn2线路

3.操作系统

建议centos7/8,或ubuntu,这里均以centos为例

4.准备环境:

yum update -y

yum install screen iftop iotop -y

4.1.安装docker

略,不会的可以搜索或参考:

CentOS Docker 安装 | 菜鸟教程

5.创建一个screen

screen -S zil

*注意1:最后退出时用ctrl+ad(顺序按a和d字母即可),不要用exit或ctrl+d退出会话。

*注意2:退出会话后,可以用screen -x heco重新连接到会话。

6.docker模式安装

mkdir /root/seed
cd /root/seed
wget https://mainnet-join.zilliqa.com/seed-configuration.tar.gz
tar -xvf seed-configuration.tar.gz

7.设置防火墙
firewall-cmd --permanent --zone=public --add-port=33133/tcp
firewall-cmd --permanent --zone=public --add-port=4201/tcp
firewall-cmd --reload
不懂防火墙配置的,可以先禁用防火墙,关于firewalld的使用技巧,之后会单独写一篇教程

8.启动seed节点(docker模式)

cd /root/seed
sh /root/seed/launch_docker.sh

按提示输入,注意ip要填写下(尽量服务器本机具备ipv4的公网ip)

成功后,会提示:

Use 'docker ps' to check the status of the docker
Use 'docker stop zilliqa' to terminate the container
Use 'tail -f zilliqa-00001-log.txt' to see the runtime log

If you have successfully completed the above steps, 
you should have a functioning seed node that exposes an RPC API on localhost:4201. 
You may further check the logs at zilliqa-00001-log.txt.

注意,默认4201端口暂时没有打开,这里翻译为人话,就是必须等同步完所有区块数据,才会开放4201端口。

9.查看日志

tail -f /root/seed/zilliqa-00001-log.txt

tail -f /root/seed/py_download_incr_DB.log

这里可以看到下载的日志

10.测试验证

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"GetNetworkId","params":[],"id":1}' http://127.0.0.1:4201

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"GetBlockchainInfo","params":[],"id":1}' http://127.0.0.1:4201

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"GetLatestDsBlock","params":[],"id":1}' http://127.0.0.1:4201

11.停止节点

docker stop zilliqa

注意,重启docker可能不会自动启动zilliqa的服务,可以通过:

docker exec -it zilliqa /bin/bash

进入docker的shell,执行:

ps -ef

查看是否有zilliqa的进程,如果重启服务器后,端口一直没有侦听,要注意下是否真的有启动起来zilliqa进程。

12.接口文档参考

RPC接口文档,如:

Introduction | Zilliqa Developer Portal

Introduction | Zilliqa Developer Portal

Introduction | Zilliqa Developer Portal

其它参考:

Zilliqa链github地址:

GitHub - Zilliqa/Zilliqa: Zilliqa is the world's first high-throughput public blockchain platform - designed to scale to thousands ​of transactions per second.主网浏览器:

https://viewblock.io/zilliqa
https://devex.zilliqa.com/
https://explorer.zilliqa.com/

ZilLab Explorer -- Mainnet

13.注意事项

*同步到最高区块大概最快20分钟左右。

*相比来说,seed节点的资源和空间消耗非常低,一般可以与eth等节点部署在同一台,以节省成本。

posted on 2021-11-14 23:37 方伟的博客 阅读(2) 评论(0)  编辑  收藏 所属分类: 区块链

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK