1.安装需要的包
sudo apt update && \
sudo apt install curl git jq build-essential gcc unzip wget lz4 -y
2.安装Go
cd $HOME && \
ver="1.21.3" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version
3. 构建evmosd
二进制文件
git clone https://github.com/0glabs/0g-evmos.git
cd 0g-evmos
git checkout v1.0.0-testnet
make install
evmosd version
4. 设置变量
echo 'export MONIKER="My_Node"' >> ~/.bash_profile
echo 'export CHAIN_ID="zgtendermint_9000-1"' >> ~/.bash_profile
echo 'export WALLET_NAME="wallet"' >> ~/.bash_profile
echo 'export RPC_PORT="26657"' >> ~/.bash_profile
source $HOME/.bash_profile
5. 初始化节点
cd $HOME
evmosd init $MONIKER --chain-id $CHAIN_ID
evmosd config chain-id $CHAIN_ID
evmosd config node tcp://localhost:$RPC_PORT
evmosd config keyring-backend os # You can set it to "test" so you will not be asked for a password
6.下载genesis.json
wget https://github.com/0glabs/0g-evmos/releases/download/v1.0.0-testnet/genesis.json -O $HOME/.evmosd/config/genesis.json
7. 将种子和对等点添加到 config.toml
PEERS="1248487ea585730cdf5d3c32e0c2a43ad0cda973@peer-zero-gravity-testnet.trusted-point.com:26326" && \
SEEDS="8c01665f88896bca44e8902a30e4278bed08033f@54.241.167.190:26656,b288e8b37f4b0dbd9a03e8ce926cd9c801aacf27@54.176.175.48:26656,8e20e8e88d504e67c7a3a58c2ea31d965aa2a890@54.193.250.204:26656,e50ac888b35175bfd4f999697bdeb5b7b52bfc06@54.215.187.94:26656" && \
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.evmosd/config/config.toml
8. 设置最低 Gas 价格
sed -i "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.00252aevmos\"/" $HOME/.evmosd/config/app.toml
9.创建服务文件
sudo tee /etc/systemd/system/ogd.service > /dev/null <<EOF
[Unit]
Description=OG Node
After=network.target
[Service]
User=$USER
Type=simple
ExecStart=$(which evmosd) start --home $HOME/.evmosd
Restart=on-failure
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
10.启动节点
sudo systemctl daemon-reload && \
sudo systemctl enable ogd && \
sudo systemctl restart ogd && \
sudo journalctl -u ogd -f -o cat
出现此界面,代表成功启动节点
CTRL+C 退出即可
11. 为您的验证器创建一个钱包
evmosd keys add $WALLET_NAME
12. 提取十六进制地址以向水龙头请求一些代币
输入下面命令
echo "0x$(evmosd debug addr $(evmosd keys show $WALLET_NAME -a) | grep hex | awk '{print $3}')"
13. 领取测试币,每次只能0.1
用上面复制的16进制地址领取测试币
14.查看钱包余额(需要区块同步完成才可以查看)
evmosd q bank balances $(evmosd keys show $WALLET_NAME -a)
15. 创建验证器,需要等待区块同步完成
检查同步状态,同步区块之后可以创建验证者
evmosd status | jq .SyncInfo
evmosd tx staking create-validator \
--amount=10000000000000000aevmos \
--pubkey=$(evmosd tendermint show-validator) \
--moniker=$MONIKER \
--chain-id=$CHAIN_ID \
--commission-rate=0.05 \
--commission-max-rate=0.10 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--from=$WALLET_NAME \
--identity="" \
--website="" \
--details="0G to the moon!" \
--gas=500000 --gas-prices=99999aevmos \
-y
到官方验证网址查看自己的节点情况即可
https://explorer.validatorvn.com/OG-Testnet/staking
出处 小蓝鸟BtcK241918
常用命令
重启节点
sudo systemctl restart ogd && sudo journalctl -u ogd -f -o cat
检查同步状态
evmosd status | jq .SyncInfo
查看日志
sudo journalctl -u ogd -f -o cat
查看节点状态
evmosd status | jq
停止节点
sudo systemctl stop ogd
升级节点
cd 0g-evmos
git fetch
git checkout tags/<version>
make install
evmosd version
# Restrt the node
sudo systemctl restart ogd && sudo journalctl -u ogd -f -o cat
删除节点
sudo systemctl stop ogd
sudo systemctl disable ogd
sudo rm /etc/systemd/system/ogd.service
rm -rf $HOME/.evmosd $HOME/0g-evmos
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...