Delete old node data
sudo systemctl stop ogd
sudo systemctl disable ogd
sudo rm /etc/systemd/system/ogd.service
rm -rf $HOME/.evmosd $HOME/0g-evmos
Download 0g repository
git clone -b v0.1.0 https://github.com/0glabs/0g-chain.git
./0g-chain/networks/testnet/install.sh
source .profile
Making the network configuration
0gchaind config chain-id zgtendermint_16600-1
Change it to the name of your validator and paste it into the console
0gchaind init NAME_FOR_YOUR_VALIDATOR --chain-id zgtendermint_16600-1
Installing the Genesis file
sudo apt install -y unzip wget
rm ~/.0gchain/config/genesis.json
wget -P ~/.0gchain/config https://github.com/0glabs/0g-chain/releases/download/v0.1.0/genesis.json
Adding peers and seeds
PEERS="c4d619f6088cb0b24b4ab43a0510bf9251ab5d7f@54.241.167.190:26656,44d11d4ba92a01b520923f51632d2450984d5886@54.176.175.48:26656,f2693dd86766b5bf8fd6ab87e2e970d564d20aff@54.193.250.204:26656,f878d40c538c8c23653a5b70f615f8dccec6fb9f@54.215.187.94:26656,41143f378016a05e1fa4fa8aa028035a82761b48@154.12.235.67:46656"
SEEDS="c4d619f6088cb0b24b4ab43a0510bf9251ab5d7f@54.241.167.190:26656,44d11d4ba92a01b520923f51632d2450984d5886@54.176.175.48:26656,f2693dd86766b5bf8fd6ab87e2e970d564d20aff@54.193.250.204:26656,f878d40c538c8c23653a5b70f615f8dccec6fb9f@54.215.187.94:26656,41143f378016a05e1fa4fa8aa028035a82761b48@154.12.235.67:46656"
sed -i -e "s/^seeds =.*/seeds = \"$SEEDS\"/; s/^persistent_peers =.*/persistent_peers = \"$PEERS\"/" $HOME/.0gchain/config/config.toml
Create a service file
sudo tee /etc/systemd/system/0gchaind.service > /dev/null
[Unit]
Description=OG Validator Node
After=network.target
[Service]
User=$USER
Type=simple
ExecStart=$(which 0gchaind) start --home $HOME/.0gchain
Restart=on-failure
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Service restart
sudo systemctl daemon-reload && \
sudo systemctl enable 0gchaind && \
sudo systemctl restart 0gchaind && \
sudo journalctl -u 0gchaind -f -o cat
Creating a wallet
0gchaind keys add wallet --eth
Getting the address to get the coins from the faucet
*After this command, you will be given a private key in the console, we add it to Metamask (And get our address to receive tokens).
0gchaind keys unsafe-export-eth-key wallet
Check synchronization
curl -s localhost:26657/status | jq .result.sync_info.catching_up
Creating a validator (Only after full synchronization)
0gchaind tx staking create-validator \
--amount=1000000ua0gi \
--pubkey=$(0gchaind tendermint show-validator) \
--moniker="НАЗВАНИЕ_ВАШЕГО_ВАЛИДАТОРА " \
--chain-id="zgtendermint_16600-1" \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \
--min-self-delegation="1000000" \
--gas "500000" \
--gas-prices="50ua0gi" \
--from=wallet -y
Get the address of the validator
0gchaind q staking validator $(0gchaind keys show wallet --bech val -a)
Restart Node
sudo systemctl restart ogd && sudo journalctl -u ogd -f -o cat
Check sync
evmosd status | jq .SyncInfo
If you see
"catching_up": true - your node is not yet synchronised.
"catching_up": false - your node is synchronised
Next, we only move on when your node is synchronised
Creating a wallet
evmosd keys add wallet
We get our wallet address
echo "0x$(evmosd debug addr $(evmosd keys show $WALLET_NAME -a) | grep hex | awk '{print $3}')"
Creating a validator
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
Be sure to save our validator key (priv_validator_key.json). It is located at the following path
root/.evmosd/config/