前言:zilliqa開(kāi)發(fā)用的RPC節(jié)點(diǎn)只需要啟動(dòng)個(gè)seed節(jié)點(diǎn)即可,非常方便,40多G空間,幾十分鐘就可以同步完,資源占用極小。否則如果部署full節(jié)點(diǎn)就不是這么簡(jiǎn)單了。
1.服務(wù)器
zilliqa的seed節(jié)點(diǎn) 需要100G SSD(建議NVMe)硬盤(pán),實(shí)際數(shù)據(jù)占用40多G,docker占用1.3G多。cpu內(nèi)存均不需要太高,4核8G足夠。
2.帶寬
建議國(guó)外服務(wù)器,10M以上,不需要cn2線路
3.操作系統(tǒng)
建議centos7/8,或ubuntu,這里均以centos為例
4.準(zhǔn)備環(huán)境:
yum update -y
yum install screen iftop iotop -y
4.1.安裝docker
略,不會(huì)的可以搜索或參考:
CentOS Docker 安裝 | 菜鳥(niǎo)教程
5.創(chuàng)建一個(gè)screen
screen -S zil
*注意1:最后退出時(shí)用ctrl+ad(順序按a和d字母即可),不要用exit或ctrl+d退出會(huì)話。
*注意2:退出會(huì)話后,可以用screen -x heco重新連接到會(huì)話。
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.設(shè)置防火墻
firewall-cmd --permanent --zone=public --add-port=33133/tcp
firewall-cmd --permanent --zone=public --add-port=4201/tcp
firewall-cmd --reload
不懂防火墻配置的,可以先禁用防火墻,關(guān)于firewalld的使用技巧,之后會(huì)單獨(dú)寫(xiě)一篇教程
8.啟動(dòng)seed節(jié)點(diǎn)(docker模式)
cd /root/seed
sh /root/seed/launch_docker.sh
按提示輸入,注意ip要填寫(xiě)下(盡量服務(wù)器本機(jī)具備ipv4的公網(wǎng)ip)
成功后,會(huì)提示:
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.
注意,默認(rèn)4201端口暫時(shí)沒(méi)有打開(kāi),這里翻譯為人話,就是必須等同步完所有區(qū)塊數(shù)據(jù),才會(huì)開(kāi)放4201端口。
9.查看日志
tail -f /root/seed/zilliqa-00001-log.txt
tail -f /root/seed/py_download_incr_DB.log
這里可以看到下載的日志
10.測(cè)試驗(yàn)證
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.停止節(jié)點(diǎn)
docker stop zilliqa
注意,重啟docker可能不會(huì)自動(dòng)啟動(dòng)zilliqa的服務(wù),可以通過(guò):
docker exec -it zilliqa /bin/bash
進(jìn)入docker的shell,執(zhí)行:
ps -ef
查看是否有zilliqa的進(jìn)程,如果重啟服務(wù)器后,端口一直沒(méi)有偵聽(tīng),要注意下是否真的有啟動(dòng)起來(lái)zilliqa進(jìn)程。
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.主網(wǎng)瀏覽器:
https://viewblock.io/zilliqa
https://devex.zilliqa.com/
https://explorer.zilliqa.com/
ZilLab Explorer -- Mainnet
13.注意事項(xiàng)
*同步到最高區(qū)塊大概最快20分鐘左右。
*相比來(lái)說(shuō),seed節(jié)點(diǎn)的資源和空間消耗非常低,一般可以與eth等節(jié)點(diǎn)部署在同一臺(tái),以節(jié)省成本。
posted on 2021-11-14 23:37
方偉的博客 閱讀(258)
評(píng)論(0) 編輯 收藏 所屬分類:
區(qū)塊鏈