前言:zilliqa開發用的RPC節點只需要啟動個seed節點即可,非常方便,40多G空間,幾十分鐘就可以同步完,資源占用極小。否則如果部署full節點就不是這么簡單了。
1.服務器
zilliqa的seed節點 需要100G SSD(建議NVMe)硬盤,實際數據占用40多G,docker占用1.3G多。cpu內存均不需要太高,4核8G足夠。
2.帶寬
建議國外服務器,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
方偉的博客 閱讀(258)
評論(0) 編輯 收藏 所屬分類:
區塊鏈