(Optional) - Live peers update script with auto update every 6 hours
# download update_peers.sh
curl -o $HOME/.0gchain/update_peers.sh https://gist.githubusercontent.com/nodecattel/1fe8caf9412dd076d1ee267cc91f7472/raw/9cc89065a7720e744e1d83d611682f6d9293f618/update_peers.sh
chmod +x $HOME/.0gchain/update_peers.sh
# run script for the first time
$HOME/.0gchain/update_peers.sh
(Optional) - Setup crontab for auto-run and logging
# open crontab editor
crontab -e
add the following line to the crontab file 0 */6 * * * /bin/bash $HOME/.0gchain/update_peers.sh >> $HOME/.0gchain/update_peers.log 2>&1
0gchaind keys add $WALLET_NAME --eth
# DO NOT FORGET TO SAVE THE SEED PHRASE & YOUR PASSPHRASE YOU SET FOR THIS WALLET
# You can add --recover flag to restore existing key instead of creating
Extract the 0x address and use it for receiving testnet token
Run curl test to check for your RPC port if it's works properly
# set EXTERNAL_IP variable
EXTERNAL_IP=$(wget -qO- eth0.me)
# query for current block height (json-rpc)
curl -X POST http://$EXTERNAL_IP:8545 -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
# query for Net version (json-rpc)
curl -X POST http://$EXTERNAL_IP:8545 -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"net_version","params":[],"id":1}'
Result example
Current block height
{"jsonrpc":"2.0","id":1,"result":"0x66972"}
Net version (evm chain-id)
{"jsonrpc":"2.0","id":1,"result":"16600"}
Congratulation!!
Now you have completed your node for 0gchain and we will move on to creating your storage node next.
Upgrade Node 0.2.5
sudo systemctl stop 0gd.service
cd $HOME
rm -rf 0g-chain
git clone https://github.com/0glabs/0g-chain.git
cd 0g-chain
git checkout v0.2.5
make build
make install
sudo systemctl start 0gd.service
NodeGuru's explorer for checking latest block height
| | - use your 0x address to request
Once your validator is created you can look up your validator . Most likely it will be in inactive set as you will need enough stake to reach top 125 TVL validator. This is normal ~~~