
通过编译源代码部署Iron Fish节点挖矿
之前写了一篇用docker部署Iron Fish的文章:部署Iron Fish测试网节点
跑了一阵子,发现docker性能不行,而且老卡在某个区块同步不了。又不能修改源代码,所以决定直接通过编译源代码来部署节点
部署后,发现挖矿效率高了10倍!下面介绍一下怎么在Ubuntu上编译源代码并开启Iron Fish挖矿
安装必要的环境
1 | sudo apt-get update -y && sudo apt-get upgrade -y; |
安装/升级nodejs v16.x.x
查看系统node版本node -v
如果命令出错,安装nodejs:
1 | sudo apt install -y curl |
如果版本不是v16.x.x, 安装v16.x.x版本:
1 | npm install -g n |
安装Rust
1 | curl https://sh.rustup.rs -sSf | sh |
安装yarn
1 | sudo apt install npm |
下载官方源代码
1 | cd /root |
修改源代码
源代码里面一次同步的块数是20,但是同步到16000多块的时候,会卡住不动,所以修改一下源代码,把同步的块数改成2(试过5,还是卡住)
运行下面命令修改
1 | sed -i 's%const REQUEST_BLOCKS_PER_MESSAGE.*%const REQUEST_BLOCKS_PER_MESSAGE = 2%' /root/ironfish/ironfish/src/syncer.ts |
编译源码
1 | cd /root/ironfish |
启动节点(初次启动要同步数据比较慢)
1 | cd /root/ironfish/ironfish-cli/ |
配置Graffiti
1 | yarn ironfish config:set blockGraffiti "xxxx" |
开启挖矿
1 | cd /root/ironfish/ironfish-cli/ |
查看节点状态
1 | yarn ironfish status -f |
查看挖矿速率
1 | tail -f mine.log |
查看余额
1 | yarn ironfish accounts:balance |
注册并查看测试网积分
网站:https://testnet.ironfish.network/leaderboard
点击”Sign Up”
输入邮箱,Graffiti(上面设置的Graffiti名), Discord ID 和国家
注册成功后,你就可以在leaderboard上查看你的挖矿成果了
- Thanks for your appreciation. / 感谢您的赞赏
List of appreciation
Because of your support, I realize the value of writing articles. / 由于您的支持,我才能够实现写作的价值。
This piece of writing is an original article, utilizing theCC BY-NC-SA 4.0Agreement. For complete reproduction, please acknowledge the source as Courtesy ofERICET
Comment ()