Helium 部署 Validator
1. 生成 testnet 钱包
helium-wallet create basic --network testnet -o /path/to/save/wallet.key
helium-wallet -f /path/to/save/wallet.key info
> ~/helium/helium-wallet-rs/target/debug/helium-wallet create basic --network testnet -o testnet.key
Password: [hidden]
+-----------------------------------------------------+---------+--------+------------+
| Address | Sharded | Verify | PwHash |
+-----------------------------------------------------+---------+--------+------------+
| 1aCjBMAWymv9x7kXTvKVsTe7tBkSyWoR5uzkQ49SG1tKtYwYG6n | false | true | Argon2id13 |
+-----------------------------------------------------+---------+--------+------------+
2. 获取 TNT (测试币)
https://faucet.helium.wtf/ 填入钱包地址获取假币。等待 10 分钟左右,假币到帐了。可以发掘查询。
> ~/helium/helium-wallet-rs/target/debug/helium-wallet -f testnet.key balance
+-----------------------------------------------------+----------------+--------------+-----------------+
| Address | Balance | Data Credits | Security Tokens |
+-----------------------------------------------------+----------------+--------------+-----------------+
| 1aCjBMAWymv9x7kXTvKVsTe7tBkSyWoR5uzkQ49SG1tKtYwYG6n | 10005.00000000 | 0 | 0.00000000 |
+-----------------------------------------------------+----------------+--------------+-----------------+
3. 利用 docker 部署 validator
docker run -d --init \
--restart always \
--publish 2154:2154/tcp \
--name validator \
--mount type=bind,source=$HOME/helium/validator_data,target=/var/data \
quay.io/team-helium/validator:latest-val-amd64
加入自动升级守护:
docker run -d \
--restart always \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
--cleanup \
--interval 1800
可以看到 2154 端口需要对外开放。并且支持 p2p 通信。
4. 质押 10000 HNT 使得 validator 生效
查看 validator 地址:
sudo docker exec validator miner peer addr
/p2p/1YPws85sTKu9rf5gBo9JYCUE1muDDrBhVkjUphDnskkk55RruVf
质押并缴费:
helium-wallet -f /path/to/save/wallet.key validators stake 1YPws85sTKu9rf5gBo9JYCUE1muDDrBhVkjUphDnskkk55RruVf 10000 --commit
Password: [hidden]
+-----------+-----------------------------------------------------+
| Key | Value |
+-----------+-----------------------------------------------------+
| Validator | 1YPws85sTKu9rf5gBo9JYCUE1muDDrBhVkjUphDnskkk55RruVf |
+-----------+-----------------------------------------------------+
| Fee | 35000 |
+-----------+-----------------------------------------------------+
| Hash | 594qDbvczOFIW1vQSOeRWXwTdF1SMqqAyQ2ZGV_ibHk |
+-----------+-----------------------------------------------------+
5. 查看 validator 部署结果
validator 监听的端口会增多:
一晚上挖到几十个 TNT (测试币)
其他
- validator 的部署与挖矿功能解耦隔离,这样很方便做部署切换,validator 的生效与否决定权在钱包侧的 HNT 质押
- validator 的 stake