Update 0g.sh

This commit is contained in:
smeb y 2024-06-21 18:28:24 +08:00 committed by GitHub
parent 32ea340859
commit f2a825b8a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

10
0g.sh
View File

@ -71,7 +71,7 @@ function install_node() {
fi fi
# 安装所有二进制文件 # 安装所有二进制文件
git clone -b v0.1.0 https://github.com/0glabs/0g-chain.git git clone -b v0.2.3 https://github.com/0glabs/0g-chain.git
cd 0g-chain cd 0g-chain
make install make install
@ -87,7 +87,7 @@ function install_node() {
# 配置节点 # 配置节点
wget -O ~/.0gchain/config/genesis.json https://github.com/0glabs/0g-chain/releases/download/v0.1.0/genesis.json wget -O ~/.0gchain/config/genesis.json https://github.com/0glabs/0g-chain/releases/download/v0.2.3/genesis.json
0gchaind validate-genesis 0gchaind validate-genesis
wget https://snapshots.dadunode.com/0gchain/addrbook.json -O $HOME/.0gchain/config/addrbook.json wget https://snapshots.dadunode.com/0gchain/addrbook.json -O $HOME/.0gchain/config/addrbook.json
@ -105,12 +105,6 @@ function install_node() {
source $HOME/.bash_profile source $HOME/.bash_profile
# 使用 PM2 启动节点进程 # 使用 PM2 启动节点进程
pm2 start 0gchaind -- start && pm2 save && pm2 startup pm2 start 0gchaind -- start && pm2 save && pm2 startup
pm2 stop 0gchaind
0gchaind tendermint unsafe-reset-all --home $HOME/.0gchain --keep-addr-book
curl https://snapshots-testnet.nodejumper.io/0g-testnet/0g-testnet_latest.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.0gchain
mv $HOME/.0gchain/priv_validator_state.json.backup $HOME/.0gchain/data/priv_validator_state.json
pm2 restart 0gchaind
echo '====================== 安装完成,请退出脚本后执行 source $HOME/.bash_profile 以加载环境变量===========================' echo '====================== 安装完成,请退出脚本后执行 source $HOME/.bash_profile 以加载环境变量==========================='