Initia节点激励测试网中文教程

Initia是Binance Labs孵化的Cosmos生态模块化L1, 种子轮融资了750万美元。

近期,其开启了节点激励测试网。无门槛,完成任务有积分。

官方博客:

详细规则

每周验证者会有不同的任务,现在是Pre-phase,任务是创建验证者发布initia测试网启动和你对initia的愿望的推文

第一周任务
第一周任务

官方教程

最低配置

  • 4核 CPU

  • 16 GB RAM

  • 1 TB SSD Storage

安装基础环境

安装go

sudo rm -rf /usr/local/go;
curl https://dl.google.com/go/go1.22.1.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf - ;
cat <<'EOF' >>$HOME/.profile
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/.profile

安装完成后运行以下命令查看版本

go version

安装其他必要的环境

sudo apt-get update -y && sudo apt-get upgrade -y;
sudo apt-get install curl build-essential make gcc jq git -y;

下载源代码并编译

cd
git clone https://github.com/initia-labs/initia.git
cd initia
git checkout  v0.2.15
make install

安装完成后可以运行 initiad version检查是否安装成功。

显示应为v0.2.14

运行节点

初始化节点

moniker=<你的节点名>
initiad init $moniker --chain-id=initiation-1
initiad config set client chain-id initiation-1

下载Genesis 文件

curl -s https://initia.s3.ap-southeast-1.amazonaws.com/initiation-1/genesis.json >  ~/.initia/config/genesis.json

设置peer和seed

PEERS="d9f51610a17983ec18c7f3eb4abeed3b2091e271@49.12.60.119:26656,95071a39cab00a428c532c682c6cd05618f5a9f4@46.4.80.48:25756,6a6d164766341e4e4f56d0359f130a757f21851a@95.217.148.179:29656,f3e8eb0d3e12eb527ac4ce18ab9c570900595eae@185.215.165.42:26656,17c9bad77ebddb367fcb15aa8c49ee96e879f5e9@109.205.177.233:17956,da4da3eb06fc744054783f101e710aa61ea935c9@162.62.61.65:26656,c1569478ea96b364549c2bd2ebb0cd1b6480b994@194.180.188.42:27656,67c434b23f89606040ca2373ff02dece102aeb73@95.217.199.12:26606,c08e6b6e514869113d121859c1eecdd68fa4f5dd@109.123.247.164:26656,4b93ef428d2df62744b72428ca4b36bd31ebe290@195.201.60.182:26656,e2d76117aa4148bfc57570e0302dd4d747d60e5f@185.188.249.78:27656,ee8af01a38ee80a20a99f46df96f536dbb1f9e98@85.10.202.138:26656,6793d5a0757b1cb2a91ccc8dbd7008f1b7fcafd1@116.203.170.29:26656,a90dc21c3b122e6030ccdeb999c8349a95cdc0d5@194.195.87.170:27656,99df4681c8120da8270e24a4d3115965e3dfc3b9@86.48.5.15:26656,06519a2ae809d45bee37ada21f406fb358d4bbe4@31.220.90.175:27656,6024362f196b0f5df5f0abaf0552712d5b0333e7@37.27.43.80:26656,fbb7d528c2e9bb117fc4b646894e30ba533f7274@88.99.6.62:26656,bec0aa266f7b683900425cb73d0b4a5bbfd4f2dd@173.249.43.100:14656,e114eb5d7d5877ea4b55c2833bc426f15b7065b2@144.91.107.151:26656,b3ec1240c18a14c664a458d211decccffe246e63@65.109.94.98:14656,df3c89aa5bb7b7a29ec72243873cf1d2d8d3cb60@37.27.43.255:17956,6f7b16ca1a6084c743b472229c613dadc6e39719@109.199.122.176:26656,de3f8976450c8da6c603540e3b12adc24da54b6d@89.117.63.143:26656,4de71d3e17c550c79913ebdb69f4a543b89e82ab@138.201.142.39:26656,d1aeb143f1e4b8b2390a37fe87864d396b61c342@109.123.253.29:26656,94efe0c3640a9bf570b6e93479f271295a4c60ec@37.27.48.43:36656,e4698df4431ba5f77a2f92c0407f4bd9bc250f0b@188.34.153.80:15656,512b3f72d36af79a83c8601cacd1352b351120bd@194.242.57.225:26656,7d9d8f9c805aa1a689ccdee6b0c31c5758e394a9@65.108.212.96:26656,dd089499da61d7a8edee96222e9e7670d592a6d9@138.201.221.165:26656,340e16aa9c7c0d826f6c11abd56aaecd3032fdd1@65.109.131.117:27656,4d492ffc2dedb855d592fed85e4a818088e11dc0@37.27.118.143:27656,0d236f1685afac05769889b2fcd9fc6ff75edb61@116.202.85.52:17956,3d6f9e7375eedbc74cca96c38a2a79b4839bbaa9@138.201.80.7:26656,b88db6299cbee4c62ec6b175f2b81e2d7fab29f2@37.27.101.12:27656,475f1c69d9e7439a44593c48783f8c96927cd3ee@88.99.93.232:26656,61b253d6b0b641c6d18d9327506ed9e5d965158e@88.99.61.240:26656,9d54238dd545cebadc3eb0dcdb9b7a2acad11316@37.27.91.4:15656,4ef1780069aec640b9593c11f0048da6a507cbb8@88.99.65.242:26656,71ad933bbe6809bcaa7d42f9e550566fbe32a3f0@162.62.119.12:26656,340c31516a8558b27c3ad77d4e80bcac0b5d35c6@136.243.145.40:26656,fac8d530e1f88fff0b171f3e0cae8729cec566df@49.12.133.188:26656,9630e06f869d4244b721e3735132b7bede7d59b8@49.12.127.119:26656,89ba0093c88e581754874ca66915ae86c4f50ba3@78.46.76.145:35656,cac0f0d14f8b7b53bec16ded6e463d76078a3ff9@136.243.173.61:26656,9b952bf9ca0a2d2a0daa0cda3d0eed39d8884466@167.233.5.244:26656,d6da76083c359045dff88026c94d4ebe4248b8e4@138.201.61.152:14656,3d5d9814c5e8db4cda3288371740c2cb84363cfc@138.201.123.246:10656,5ef43490bfe9a6dda06d4599cac1ec35a23b8d88@65.109.122.105:26656,6492da60849602458a44b003429e9f6d377630e2@138.201.19.210:26656,d9ced3a7d2e43adad92cb54782d588a34cc54c2b@167.235.13.19:28656,db57c7a87bf38e4a214e229f61f52e8e0fda6c5d@116.202.39.234:36656,5e084d6e6a0ace24d2534e6be52b6a43290c4652@49.13.220.163:15656,b7e61e910f7bfa90951e7306495241a6843e8c44@77.90.13.193:26656,415504f7b41751c75e49830cd1e763f5be95be8f@49.13.240.171:26656,6ea036fb6c477ba2e93175b787cae941237186f6@88.99.136.124:26656,4f87aa1929a9288659d0085accfec637d0778d21@49.13.240.179:26656,b28177081d99a867e3a3a84ace3a80eb6e2798ee@148.251.70.79:26656,173732195f2415244cec126aa1900d3165e267e6@188.40.106.205:26656,571a5063d4bf12676bcbc0c903ba6a522b228a2b@168.119.36.37:26656,5716bb0d8085dd7c6e0b93e97596bb0f8854170b@88.99.199.48:26656,3afd41553d3a75166cb9f92c25d6ffc9f2d77bc7@49.12.56.172:26656,148c0845575c874e677978112b1c8059090ed4ab@162.55.239.166:29656,df42604836366941edafa198f3e0c4aa6e6295d0@49.12.60.120:26656,11def52311da45136fce35bca39db9e7d403aa9c@188.40.97.159:47656,d70ee6a6de3e91fc527881e5803789e9d48b706d@49.13.240.184:26656,617040d808fb44d260a86b63ba7811c7b6055fb0@94.130.17.36:26656,1a91a724bc4b626e20bcfbb7cd52a6f8df69554a@5.9.231.225:26656,d698baad551c45c9529f3d35c6c9bd359d4accd3@88.99.146.162:26656,0c6fb597e320293976b70f8406bdaafd4814f474@168.119.130.219:26656,33455905a397b214b22598900eafe7540b26d49c@142.132.200.200:26656,b8a957a490470730bd804888abe442aaf38680c0@148.251.91.93:27656,abbc3c6f28f8be89d66d0d27848058e49b6e55b3@88.198.54.43:14656,a1a5d022469a0966c7ba2d07d817b2a2f30f317b@159.69.142.51:50156,82ed19c5e6671e5cc7c85cd59af6da17a0ecd30d@176.9.86.232:26656,52c5772313c6b1b569177f9ac91b69a53972e5c3@49.13.240.166:26656,6589f7bff2939c7caf7d1ddef8aabf581d5f4dba@88.99.69.24:53456,714fcd2ce9231499721e526962485ec828bcaab4@185.252.235.248:53456,7326a0ff905b9a4cd06dfabac43bbf1c1a9dcec0@88.99.249.107:26656,30cc64926bf84003606090359be402a1e5b8a847@88.99.58.84:26656,160563659abb079213cddb3b55a0fa733c88d956@185.130.227.130:27656,fb0f5e7b665e0d2fc679e17a9e18bc0140796e7b@38.242.232.103:15656,d04c1d123f1a4437eb79d2d5ea64c89f06cdb2a8@77.90.6.18:26656,33406f6a30026105248105891c21f839a0bcfe9a@43.131.60.204:26656,4fc5aacc26a9efe8b3e62172193142c283494e57@43.157.30.37:26656,f57348fe1d9ea1147f6debb23576a624f70b5d16@116.202.233.2:50156,8cf83fb644b7caab0a908c061ac9d0236b4442de@88.99.89.212:26656,81e68bec54d26cac0f756caa6a98a62d2d543f2b@95.111.237.120:14656,ca4187d42ce51fb65a170d27bc86bd8dda60e852@49.13.222.0:11656,467ba1840b8d8a7554444363709c56f5ebe6c94a@46.226.167.25:26656,c342808684cccc209ba7019c5c6d87aeeada2f28@49.13.240.181:26656,01956ddb1f25579f0590b3b43aea662d57d41780@43.157.47.34:26656,364b90dbbb2f845e74560c39a056d8001b353498@43.131.61.109:26656,7aa28abc3575d3a52b0f71d72713dff30c38b1da@213.133.111.189:26656,ba4ad2ba33126691cba9d2783de854e8e0aa9c9a@158.220.106.163:26656,00a1378da1a77c4018715bdf5243bf8f61458375@159.69.85.157:15656,ae772b154c86ce515ccbb696769d0128854a9e9c@49.12.60.36:26656,ab0748fdea82b9d313a2b9dab836e94326fa44b9@164.90.166.81:26656,9510fef9caf8d51ea81ce73d1273561d2089f673@43.157.25.48:26656"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.initia/config/config.toml
sed -i.bak -e "s/^seeds *=.*/seeds = \"$seeds\"/" ~/.initia/config/config.toml

自定义端口(可选)

可以修改端口(避免和其他cosmos节点冲突)。

portrange=27
sed -i "s/:6060/:${portrange}060/g" ~/.initia/config/config.toml 
sed -i "s/:26657/:${portrange}657/g" ~/.initia/config/config.toml 
sed -i "s/:26656/:${portrange}656/g" ~/.initia/config/config.toml 
sed -i "s/:26660/:${portrange}660/g" ~/.initia/config/config.toml 
sed -i "s/:9090/:${portrange}090/g" ~/.initia/config/app.toml 
sed -i "s/:9091/:${portrange}091/g" ~/.initia/config/app.toml 
sed -i "s/:1317/:${portrange}317/g" ~/.initia/config/app.toml 
sed -i "s/:8545/:${portrange}545/g" ~/.initia/config/app.toml 
sed -i "s/:8546/:${portrange}546/g" ~/.initia/config/app.toml 

这里我们把rpc端口设置成了27657,grpc端口设置成了27090(默认为9090)这2个端口后面有用

Pruning设置

pruning="custom" && \
pruning_keep_recent="100" && \
pruning_keep_every="0" && \
pruning_interval="10" && \
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.initia/config/app.toml && \
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.initia/config/app.toml && \
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.initia/config/app.toml && \
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.initia/config/app.toml

下载快照

最新快照见

cd
sudo apt install lz4 -y
wget -O initia_187918.tar.lz4 https://snapshots.polkachu.com/testnet-snapshots/initia/initia_187918.tar.lz4 --inet4-only
initiad tendermint unsafe-reset-all --home $HOME/.initia --keep-addr-book

lz4 -c -d initia_187918.tar.lz4  | tar -x -C $HOME/.initia

启动节点

sudo tee <<EOF >/dev/null /etc/systemd/system/initia.service
[Unit]
Description=initia daemon
After=network-online.target
[Service]
User=$USER
ExecStart=$(which initiad) start
Restart=on-failure
RestartSec=3
LimitNOFILE=10000
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload && \
sudo systemctl enable initia && \
sudo systemctl restart initia

查看日志

sudo journalctl -u initia -f

检查同步状态

curl -s localhost:27657/status | jq .result | jq .sync_info

这里的27657是根据你之前设置的rpc端口27657。

同步需要一段时间,其中显示 "catching_up":显示为false

并且latest_block_height 和区块浏览器高度差不多,即同步上了。

如果一直没有开始同步一般是因为peer不够,可以考虑添加Peer或者使用别人的addrbook。

创建验证人

创建钱包

initiad keys add <钱包名>

注意请保存助记词。若不保存,之后将无法恢复。

查看钱包

initiad keys list 

领取测试币

https://faucet.testnet.initia.xyz/

节点同步之后可以用

initiad query bank balances  你的initia地址

查询测试币余额。

修改client默认的rpc

这里的27657是你之前设置的rpc端口27657(如果没有修改过端口,默认是26657)

initiad config set client node tcp://127.0.0.1:27657

创建验证人

获取足够测试币,且节点完成同步后,可以创建验证人。

daemon=initiad
denom=uinit
moniker=验证人名
chainid=initiation-1
$daemon tx mstaking 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 \
    --from=钱包名 --gas 500000 --fees 300000$denom

之后可以去区块浏览器 https://scan.testnet.initia.xyz/initiation-1 查看验证者是否创建成功。如果能查到,你就完成了创建验证者任务

(目前只有质押前30的节点才是活跃节点,活跃与否应该不影响任务)

创建完验证者建议备份~/.initia/config/priv_validator_key.json

创建成功后需要填表,注意地址是initvaloper开头那个,如何获取下面的内容有说。

此表格将于 UTC 时间 5 月 19 日 14:59 截止

更新:新表格

正确填写才有分数 Friday, May 24th 00:00 UTC 截止

其他验证者相关的命令

获取你的验证者地址

initiad debug addr 你的钱包地址

返回的Bech32 Val地址就是验证者地址

质押

initiad tx mstaking delegate 你要质押的验证人地址 数量uinit --from 你的钱包名 -y --fees 200000uinit --gas 500000

Unjail (如果被jail了才需要)

initiad tx slashing unjail  --from 你的钱包名 --gas 500000 --fees 200000uinit 

给验证者在浏览器添加图标

我们需要注册

得到一个16位id,并设置你的keybase profile头像。这个头像将在区块浏览器上显示

接下来运行命令

 initiad tx mstaking edit-validator --from test --identity 你的keybase16位id --from 你的钱包名  --gas 500000 --fees 200000uinit 

一段时间后,头像就会在浏览器显示,例如我的

运行预言机(这是第二周的任务,暂时不用做)

cd
git clone https://github.com/skip-mev/slinky.git
cd slinky
# checkout proper version
git checkout v0.4.3
make build

创建预言机服务,注意下面的27090要和你之前设置的gprc端口一致(如果没有修改端口,默认是9090)

sudo tee /etc/systemd/system/slinky.service > /dev/null <<EOF
[Unit]
Description=slinky
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/slinky 
ExecStart=$HOME/slinky/build/slinky --oracle-config-path ./config/core/oracle.json --market-map-endpoint 0.0.0.0:27090
StandardOutput=syslog
StandardError=syslog
Restart=always
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable  slinky.service
sudo systemctl start slinky.service

修改initia节点的config,以启动预言机

sed -i -e 's/^enabled = "false"/enabled = "true"/' \
       -e 's/^oracle_address = ""/oracle_address = "127.0.0.1:8080"/' \
       -e 's/^client_timeout = "2s"/client_timeout = "500ms"/' \
       -e 's/^metrics_enabled = "false"/metrics_enabled = "false"/' \           
       $HOME/.initia/config/app.toml 

重启initia节点

sudo systemctl restart initia
sleep 20

查看节点日志

sudo journalctl -u  initia -f

查看预言机日志

sudo journalctl -u  slinky -f

其他命令

停止节点

sudo systemctl stop initia

本教程还会持续更新,欢迎关注

Subscribe to Silent ⚛| validator
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.