Lava Network是基于Cosmos SDK 的去中心化RPC提供商,目前在测试网阶段,已经支持Cosmos、Ethereum、Arbitrum、Celo、Juno等链的RPC。暂未披露融资信息,但其官网已经显示了部分的投资者,很有潜力。
Lava有两种节点,一种是参与Lava链共识的验证者节点,另一种是Rpc Provider。本文是目前公共测试网的验证者节点教程。Provider节点的运行暂未对外开放。
本教程仅供参考,请以官方教程为准。
2 CPU
4 GB RAM (官方教程写的要求偏高)
100GB SSD
Ubuntu 20.04+
安装go
sudo rm -rf /usr/local/go;
curl https://dl.google.com/go/go1.19.2.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf - ;
cat <<'EOF' >>$HOME/.bashrc
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source $HOME/.bashrc
安装完成后运行以下命令查看版本
go version
安装一些必要的环境
sudo apt-get update -y
sudo apt-get install curl build-essential wget jq git -y;
安装最新版本lavad
cd $HOME
git clone https://github.com/lavanet/lava
cd lava
git fetch --all
git checkout v0.6.0
make install
安装成功后,运行lavad version
应显示0.6.0
moniker=<你的节点名>
lavad init $moniker --chain-id=lava-testnet-1 --home $HOME/.lava
lavad config chain-id lava-testnet-1
wget -O $HOME/.lava/config/genesis.json https://raw.githubusercontent.com/lavanet/lava-config/main/testnet-1/genesis_json/genesis.json
PEERS="c678ae0fd7b754615e55bba2589a86e60fc8d45c@136.243.88.91:7140,131227f65bbc8f5b86030124fa1610a3283ebcbd@135.181.176.109:26656,6f71395e15c9f9f439df51fc6a667d93a1b7b019@35.162.117.131:26656,2b5d760125c90970ce27f4783a5d70a19534ff61@146.19.24.101:26546,a76af03d79a90992d135750ab945f79f167d6ee4@65.109.139.182:26656,20c13bd0d972acba5588493fb528b558a0317013@38.242.133.203:26656,dabe2e77bd6b9278f484b34956750e9470527ef7@178.18.246.118:26656,84d5e567c179738963bb500b3756c77708dd6039@65.109.6.62:26656,b7c3cedc778d93296f179373c3bc6a521e4b682e@65.109.69.160:30656,013f0163d37428ed99eacd8ee84059da5c243981@5.161.132.217:26656,4f97a7b7d386dc6cc4b4a7239cf76be3c507a1c8@173.212.243.149:26656,4f9120f706512162fbe4f39aac78b9924efbec58@65.109.92.235:11036,f22ea1e7b6d31966259e99177d714cffde27c4bf@152.32.211.182:26656,a47a4e20a5a3357c8137ca1750378eafc0ef41a2@65.109.139.68:26656,5b25ec3860445e50a41a80850970b3241350df72@194.233.90.134:26656,f9190a58670c07f8202abfd9b5b14187b18d755b@144.76.97.251:27656,24a2bb2d06343b0f74ed0a6dc1d409ce0d996451@188.40.98.169:27656,b1223ecc0fdde9d72551b9223f69b5310f870a67@85.208.51.197:26656,c6769331b9e44b91b3eaee4410ab07354665d64b@38.242.253.73:26656,d8900913c64c2d7894d13ba35fe6c3e7c346015a@95.31.224.15:36656,e297d186242569e2b8535742347e14179575723c@84.21.171.22:26658,5d43cfc3a4e1826577ea9bf8491933eac88675ce@85.173.113.198:25656,8a20f8f798c5073f0867812e691f54b5cd0dd65d@109.123.242.188:26656,2c4f3d323e7a3ae44aa638c6932cbba08c9f6b79@95.216.148.144:26656,d2ded0eb8f9a1bcb61af92c8d6a1cf1cbc747847@194.163.180.203:26656,f642b376722d6ce104ffd4c204e78ffe811e16c3@5.75.230.221:26656,433be6210ad6350bebebad68ec50d3e0d90cb305@217.13.223.167:60856,14ae45e7f2ff7491cfa686a8fcac7cc095bc38ff@213.239.217.52:39656,b591ef22e0c2082eb76dcac5ead95be55d01b695@65.109.178.147:26656,13a9209a4d08803a3becac57de8eb02dd51f8f41@65.109.23.114:19956,34a6daa6058fff9f7fd0b5ce19df99e73ea9ba07@185.209.28.156:26656,e593c7a9ca61f5616119d6beb5bd8ef5dd28d62d@34.246.190.1:26656,4e0a2772bb3672e54c2ea655c30abdac62191f14@45.84.138.66:18656,7abba7e72f166f6dae07c1605893aed38b4a79d9@65.109.193.133:26656,27a9aebdcc1bd6a8eb8cbffdd689e565dca14bc2@5.189.149.159:27656,c506970f0ac6e99ba3e1e01da33a39315c8b7aa1@38.242.141.94:26656,5b337f7ba27e2fdd27918be18af93f8728034267@65.108.41.168:26656,887df0564ab6ab74d18c9ae61e6afe6284c04b68@34.235.116.70:26656,0516c4d11552b334a683bdb4410fa22ef7e3f8ba@65.21.239.60:11656,44e1a9ded5d6f3fd89e468d9ce59185bf8d5be6a@35.225.146.131:26656,bb8c8cea499a1fa7e97922b5a9882c2360c6575a@176.103.222.21:26656,904ec45d55abe397e486579338225bd9b60e0d87@145.224.100.127:26656,12d6fc425a5d3c8164b41b6f5ea28168ae56f4ba@178.18.246.21:26656,d3001223151430f204917eb87f86d0bd1e795ebf@161.97.162.6:26656,fb2b9d41678f3d1c9c0bdef1a87f2037b6b0088a@146.19.24.252:26666,810bdfb3e88f4872995f9a05b6298c1bf3d20fe0@65.108.105.48:19956,151cc6fb6d1a4a4c2f76f7eaf43b9ea80d62ec7b@95.214.55.46:22626,6b209fb04491938b4d60b2847340799fbaced19f@38.242.153.36:26656,10b0118f5c1264ac7b9f45931717fef401530867@178.54.78.180:36656,6b430a71c8d9dba0a4f37682b91ece0f95881704@140.82.55.191:26656,778f74673e61d5877825d797f3b1367f286b0e43@35.233.190.66:26656,d3eb474a1f90d004e49638e384069c32d7dcc8a2@185.252.232.110:26656,eaa4852f10b9cf0742d806da64118b9dfde21e90@95.217.118.96:27464,c19965fe8a1ea3391d61d09cf589bca0781d29fd@162.19.217.52:26656,b7274e1274815e898fd52e4724c934820571fb5e@142.132.191.94:16656,a98484ac9cb8235bd6a65cdf7648107e3d14dab4@116.202.231.58:44656,e29a9a0ce82cda1d5632e6cf017145cd503ff60e@208.85.16.224:26656,0a52f0c648962511f6bc26d90f032ac91b8f1b1b@213.136.84.176:10656,606eabe3aaae723445afb8c5c4a8cf87b83716eb@194.146.12.7:26656,de764d94d3eed3ac15c2151b5576dd24de5bec81@38.242.236.179:26656,81161e2942c517e7124a8a29037fa81ce7045421@161.97.113.41:30656,0adbe1e790b58d19cc53a9839059a95d7d5d7aba@65.109.70.23:19956,8024dd3fc948df4577ffac0dd1c44ecb8d9fff03@109.123.240.125:26656,3b3a633e4ad83914a64288dca82f7a7b62536820@65.21.193.112:38656,3a445bfdbe2d0c8ee82461633aa3af31bc2b4dc0@3.252.219.158:26656"
seeds=""
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.lava/config/config.toml
sed -i.bak -e "s/^seeds *=.*/seeds = \"$seeds\"/" ~/.lava/config/config.toml
pruning="custom" && \
pruning_keep_recent="100" && \
pruning_keep_every="0" && \
pruning_interval="10" && \
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.lava/config/app.toml && \
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.lava/config/app.toml && \
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.lava/config/app.toml && \
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.lava/config/app.toml
cd $HOME
sudo apt install snapd -y
snap install lz4
wget -O lava.tar.lz4 https://snapshot.silentvalidator.com/testnet/lava/lava-2023-02-25T09%3A12.tar.lz4 --inet4-only
lavad tendermint unsafe-reset-all --home $HOME/.lava --keep-addr-book
lz4 -c -d lava.tar.lz4 | tar -x -C $HOME/.lava
wget -O $HOME/.lava/config/addrbook.json https://snapshot.silentvalidator.com/testnet/lava/addrbook.json
sudo tee <<EOF >/dev/null /etc/systemd/system/lavad.service
[Unit]
Description=lavad daemon
After=network-online.target
[Service]
User=$USER
ExecStart=$(which lavad) start --home $HOME/.lava
Restart=on-failure
RestartSec=3
LimitNOFILE=10000
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload && \
sudo systemctl enable lavad && \
sudo systemctl start lavad
sudo journalctl -u lavad -f
curl -s localhost:26657/status | jq .result | jq .sync_info
其中显示 "catching_up":
显示为false
即已经同步上。如果一直没有开始同步一般是因为peer不够,可以考虑添加Peer或者使用别人的addrbook。目前Lava 一分钟一个块。
lavad keys add <钱包名>
注意请保存助记词。若不保存,之后将无法恢复。
进入Lava discord https://discord.gg/lavanetxyz
在 #faucet 频道发送
$request 你的lava地址
之后可以用
lavad query bank balances 你的lava地址
查询测试币余额。
获取足够测试币,且节点完成同步后,可以创建验证人。只有质押量在前100的验证人才是活跃验证人。本次激励性测试网。验证人不论活跃与否都有奖励。
daemon=lavad
denom=ulava
moniker=验证人名
chainid=lava-testnet-1
$daemon tx staking create-validator \
--amount=1000000$denom \
--pubkey=$($daemon tendermint show-validator) \
--moniker=$moniker \
--chain-id=$chainid \
--commission-rate=0.05 \
--commission-max-rate=0.2 \
--commission-max-change-rate=0.1 \
--min-self-delegation=1000000 \
--from=钱包名
之后可以去区块浏览器 https://bd.lavanet.xyz 查看你的验证人是否创建成功。
检查日志
sudo journalctl -u lavad -f
运行/重启节点
sudo systemctl restart lavad
停止节点
sudo systemctl stop lavad
同步信息
lavad status 2>&1 | jq .SyncInfo
验证人信息
lavad status 2>&1 | jq .ValidatorInfo
节点信息
lavad status 2>&1 | jq .NodeInfo
获取node id
lavad tendermint show-node-id
显示所有钱包
lavad keys list
恢复钱包
lavad keys add <你的钱包名> --recover
删除钱包
lavad keys delete <你的钱包名>
查询余额
lavad query bank balances <lava地址>
发送代币
lavad tx bank send <你的钱包名> <接收者lava地址> 数量ulava --from <你的钱包名> --chain-id lava-testnet-1 -y
注意:1lava=1000000ulava
lavad tx gov vote <提案编号> <投票选项> --from <你的钱包名> --chain-id lava-testnet-1 -y
投票选项包括yes/no/no_with_veto/abstain。大部分情况我们投yes就好。
质押
lavad tx staking delegate <你要质押的验证人地址> 数量ulava --from <你的钱包名> -y
注:验证人地址为lava@valoper开头,可以去区块浏览器https://bd.lavanet.xyz/ 找或者lavad debug addr <钱包地址>
解除质押
lavad tx staking unbond <你要解除质押的验证人地址> 数量ulava --from <你的钱包名> -y
提取质押奖励和验证人佣金
lavad tx distribution withdraw-rewards <你的验证人地址> --commission --from <你的钱包名> -y
提取所有奖励
lavad tx distribution withdraw-all-rewards --from=<你的钱包名> -y
修改验证人信息
lavad tx staking edit-validator \
--moniker=<节点名> \
--identity=<你的keybase id> \
--website="<你的网站>" \
--details="<你的验证人描述>" \
--from=<你的钱包名>
假如你想在区块浏览器显示你的验证人logo。需要注册一个keybase账号,上传logo。在验证人信息中设置--identity=<你的keybase id>
,区块链浏览器中就会显示你的keybase logo作为验证人logo。
Unjail
lavad tx slashing unjail --from <你的钱包名> -y