OG
Run the node using systemd or cosmovisor
Chain ID: zgtendermint_9000-1
Recommended Hardware Requirements
SPEC | Recommend |
---|---|
CPU | 4 Cores |
RAM | 8 GB |
Storage | 500 GB Nvme |
NETWORK | 100 Mbps |
OS | Ubuntu 22.04 |
Port | 10156 |
Update and install packages for compiling
cd $HOME && source <(curl -s https://raw.githubusercontent.com/vnbnode/binaries/main/update-binary.sh)
- 🖼️ Systemd
- 🖼️ Cosmovisor
- 🖼️ Command
Build binary
git clone https://github.com/0glabs/0g-evmos.git
cd 0g-evmos
git checkout v1.0.0-testnet
make install
evmosd version
Initialize Node
Replace Name
with your own moniker
MONIKER="Name-VNBnode"
echo 'export CHAIN_ID="zgtendermint_9000-1"' >> ~/.bash_profile
echo 'export WALLET_NAME="wallet"' >> ~/.bash_profile
source $HOME/.bash_profile
evmosd init $MONIKER --chain-id $CHAIN_ID
evmosd config chain-id $CHAIN_ID
evmosd config keyring-backend test
Download Genesis & Addrbook
wget https://github.com/0glabs/0g-evmos/releases/download/v1.0.0-testnet/genesis.json -O $HOME/.evmosd/config/genesis.json
Configure
sed -i -e "s|^seeds *=.*|seeds = \"1248487ea585730cdf5d3c32e0c2a43ad0cda973@peer-zero-gravity-testnet.trusted-point.com:26326\"|" $HOME/.evmosd/config/config.toml
peers=$(curl -s https://raw.githubusercontent.com/vnbnode/binaries/main/Projects/OG/peers.txt)
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.evmosd/config/config.toml
sed -i.bak -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.evmosd/config/app.toml
sed -i.bak -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.evmosd/config/app.toml
sed -i.bak -e "s/^pruning-interval *=.*/pruning-interval = \"10\"/" $HOME/.evmosd/config/app.toml
sed -i "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.00252aevmos\"/" $HOME/.evmosd/config/app.toml
sed -i "s/^indexer *=.*/indexer = \"kv\"/" $HOME/.evmosd/config/config.toml
Custom Port
echo 'export og="101"' >> ~/.bash_profile
source $HOME/.bash_profile
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://0.0.0.0:${og}58\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://0.0.0.0:${og}57\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${og}60\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${og}56\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${og}60\"%" $HOME/.evmosd/config/config.toml
sed -i -e "s%^address = \"tcp://localhost:1317\"%address = \"tcp://0.0.0.0:${og}17\"%; s%^address = \":8080\"%address = \":${og}80\"%; s%^address = \"localhost:9090\"%address = \"0.0.0.0:${og}90\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${og}91\"%; s%:8545%:${og}45%; s%:8546%:${og}46%; s%:6065%:${og}65%" $HOME/.evmosd/config/app.toml
evmosd config node tcp://localhost:${og}57
Create service
sudo tee /etc/systemd/system/og.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
sudo systemctl daemon-reload
sudo systemctl enable og
Snapshot
cp $HOME/.evmosd/data/priv_validator_state.json $HOME/.evmosd/priv_validator_state.json.backup
rm -rf $HOME/.evmosd/data && mkdir -p $HOME/.evmosd/data
evmosd tendermint unsafe-reset-all --home $HOME/.evmosd --keep-addr-book
curl https://snapshots-testnet.nodejumper.io/0g-testnet/0g-testnet_latest.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.evmosd
mv $HOME/.evmosd/priv_validator_state.json.backup $HOME/.evmosd/data/priv_validator_state.json
Start Node
sudo systemctl start og
journalctl -u og -f
Faucet
echo "0x$(evmosd debug addr $(evmosd keys show wallet -a) | grep hex | awk '{print $3}')"
Link Faucet: https://faucet.0g.ai
Backup Validator
mkdir -p $HOME/backup/evmosd
cp $HOME/.evmosd/config/priv_validator_key.json $HOME/backup/evmosd
Remove Node
cd $HOME
sudo systemctl stop og
sudo systemctl disable og
sudo rm /etc/systemd/system/og.service
sudo systemctl daemon-reload
sudo rm $HOME/go/bin/evmosd
sudo rm -f $(which evmosd)
sudo rm -rf $HOME/.evmosd
sudo rm -rf $HOME/0g-evmos
Build binary
git clone https://github.com/0glabs/0g-evmos.git
cd 0g-evmos
git checkout v1.0.0-testnet
make install
evmosd version
mkdir -p $HOME/.evmosd/cosmovisor/genesis/bin
cp $HOME/go/bin/evmosd $HOME/.evmosd/cosmovisor/genesis/bin/
sudo ln -s $HOME/.evmosd/cosmovisor/genesis $HOME/.evmosd/cosmovisor/current -f
sudo ln -s $HOME/.evmosd/cosmovisor/current/bin/evmosd /usr/local/bin/evmosd -f
Cosmovisor Setup
go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]
sudo tee /etc/systemd/system/og.service > /dev/null << EOF
[Unit]
Description=og node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.evmosd"
Environment="DAEMON_NAME=evmosd"
Environment="UNSAFE_SKIP_BACKUP=true"
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable og
Initialize Node
Replace Name
with your own moniker
MONIKER="Name-VNBnode"
echo 'export CHAIN_ID="zgtendermint_9000-1"' >> ~/.bash_profile
echo 'export WALLET_NAME="wallet"' >> ~/.bash_profile
source $HOME/.bash_profile
evmosd init $MONIKER --chain-id $CHAIN_ID
evmosd config chain-id $CHAIN_ID
evmosd config keyring-backend test
Download Genesis & Addrbook
wget https://github.com/0glabs/0g-evmos/releases/download/v1.0.0-testnet/genesis.json -O $HOME/.evmosd/config/genesis.json
Configure
sed -i -e "s|^seeds *=.*|seeds = \"1248487ea585730cdf5d3c32e0c2a43ad0cda973@peer-zero-gravity-testnet.trusted-point.com:26326\"|" $HOME/.evmosd/config/config.toml
peers=$(curl -s https://raw.githubusercontent.com/vnbnode/binaries/main/Projects/OG/peers.txt)
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.evmosd/config/config.toml
sed -i.bak -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.evmosd/config/app.toml
sed -i.bak -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.evmosd/config/app.toml
sed -i.bak -e "s/^pruning-interval *=.*/pruning-interval = \"10\"/" $HOME/.evmosd/config/app.toml
sed -i "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.00252aevmos\"/" $HOME/.evmosd/config/app.toml
sed -i "s/^indexer *=.*/indexer = \"kv\"/" $HOME/.evmosd/config/config.toml
Custom Port
echo 'export og="101"' >> ~/.bash_profile
source $HOME/.bash_profile
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://0.0.0.0:${og}58\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://0.0.0.0:${og}57\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${og}60\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${og}56\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${og}60\"%" $HOME/.evmosd/config/config.toml
sed -i -e "s%^address = \"tcp://localhost:1317\"%address = \"tcp://0.0.0.0:${og}17\"%; s%^address = \":8080\"%address = \":${og}80\"%; s%^address = \"localhost:9090\"%address = \"0.0.0.0:${og}90\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${og}91\"%; s%:8545%:${og}45%; s%:8546%:${og}46%; s%:6065%:${og}65%" $HOME/.evmosd/config/app.toml
evmosd config node tcp://localhost:${og}57
Snapshot
cp $HOME/.evmosd/data/priv_validator_state.json $HOME/.evmosd/priv_validator_state.json.backup
rm -rf $HOME/.evmosd/data && mkdir -p $HOME/.evmosd/data
evmosd tendermint unsafe-reset-all --home $HOME/.evmosd --keep-addr-book
curl https://snapshots-testnet.nodejumper.io/0g-testnet/0g-testnet_latest.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.evmosd
mv $HOME/.evmosd/priv_validator_state.json.backup $HOME/.evmosd/data/priv_validator_state.json
Start Node
sudo systemctl start og
journalctl -u og -f
Faucet
echo "0x$(evmosd debug addr $(evmosd keys show wallet -a) | grep hex | awk '{print $3}')"
Link Faucet: https://faucet.0g.ai
Backup Validator
mkdir -p $HOME/backup/evmosd
cp $HOME/.evmosd/config/priv_validator_key.json $HOME/backup/evmosd
Remove Node
cd $HOME
sudo systemctl stop og
sudo systemctl disable og
sudo rm /etc/systemd/system/og.service
sudo systemctl daemon-reload
sudo rm $HOME/go/bin/evmosd
sudo rm -f $(which evmosd)
sudo rm -rf $HOME/.evmosd
sudo rm -rf $HOME/0g-evmos
Managing keys
Generate new key
evmosd keys add wallet
Recover key
evmosd keys add wallet --recover
List all key
evmosd keys list
Query wallet balances
evmosd q bank balances $(evmosd keys show wallet -a)
Managing validators
Create validator
evmosd tx staking create-validator \
--amount=10000000000000000aevmos \
--commission-max-change-rate 0.01 \
--commission-max-rate 0.1 \
--commission-rate 0.1 \
--from wallet \
--min-self-delegation 1 \
--moniker $MONIKER \
--security-contact "" \
--identity "06F5F34BD54AA6C7" \
--website "https://vnbnode.com" \
--details "VNBnode is a group of professional validators / researchers in blockchain" \
--pubkey $(evmosd tendermint show-validator) \
--chain-id zgtendermint_9000-1 \
--gas=500000 --gas-prices=99999aevmos \
-y
Edit validator
evmosd tx staking edit-validator \
--new-moniker "NewName-VNBnode" \
--identity "06F5F34BD54AA6C7" \
--website "https://vnbnode.com" \
--details "VNBnode is a group of professional validators / researchers in blockchain" \
--security-contact "" \
--commission-rate 0.05 \
--from wallet \
--gas-adjustment 1.4 \
-chain-id zgtendermint_9000-1 \
--gas=500000 --gas-prices=99999aevmos \
-y
Unjail
evmosd tx slashing unjail --from wallet --gas-prices=99999aevmos -y
View validator details
evmosd keys show wallet --bech val -a
Query active validators
evmosd q staking validators -o json --limit=1000 \
| jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' \
| jq -r '.tokens + " - " + .description.moniker' \
| sort -gr | nl
Query inactive validators
evmosd q staking validators -o json --limit=1000 \
| jq '.validators[] | select(.status=="BOND_STATUS_UNBONDED")' \
| jq -r '.tokens + " - " + .description.moniker' \
| sort -gr | nl
Managing Tokens
Delegate tokens to your validator
evmosd tx staking delegate $(evmosd keys show $WALLET_NAME --bech val -a) 10000000000000000aevmos --from $WALLET_NAME --gas=500000 --gas-prices=99999aevmos -y
Send token
evmosd tx bank send <WALLET> <TO_WALLET> <AMOUNT>aevmos --gas-prices=99999aevmos -y
Withdraw reward from all validator
evmosd tx distribution withdraw-all-rewards --from wallet --chain-id zgtendermint_9000-1 --gas-adjustment 1.4 --gas auto --gas-prices=99999aevmos -y
Withdraw reward and commission
evmosd tx distribution withdraw-rewards $(evmosd keys show wallet --bech val -a) --commission --from wallet --chain-id zgtendermint_9000-1 --gas-adjustment 1.4 --gas auto --gas-prices=99999aevmos -y
Redelegate to another validator
evmosd tx staking redelegate $(evmosd keys show wallet --bech val -a) <to-valoper-address> 1000000stake --from wallet --chain-id zgtendermint_9000-1 --gas-adjustment 1.4 --gas auto --gas-prices=99999aevmos -y
Governance
Query list proposal
evmosd query gov proposals
View proposal by ID
evmosd query gov proposal 1
Vote yes
evmosd tx gov vote 1 yes --from wallet --gas-prices=99999aevmos -y
Vote No
evmosd tx gov vote 1 no --from wallet --gas-prices=99999aevmos -y
Vote option asbtain
evmosd tx gov vote 1 abstain --from wallet --gas-prices=99999aevmos -y
Vote option NoWithVeto
evmosd tx gov vote 1 NoWithVeto --from wallet --gas-prices=99999aevmos -y
Maintenance
Check sync
evmosd status 2>&1 | jq .SyncInfo
Node status
evmosd status | jq
Get validator information
evmosd status 2>&1 | jq .ValidatorInfo
Get your p2p peer address
echo $(evmosd tendermint show-node-id)'@'$(curl -s ifconfig.me)':'$(cat $HOME/.evmosd/config/config.toml | sed -n '/Address to listen for incoming connection/{n;p;}' | sed 's/.*://; s/".*//')
Get peers live
curl -sS http://localhost:${og}57/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}'