CLI Cheatsheet Commands

Check out Chain -
Info
.Network | Chain | Version |
---|---|---|
Testnet | 0G | Waiting |
SYNC
npx
local_height=$(curl -s localhost:${OG_PORT}657/status | jq -r .result.sync_info.latest_block_height);
network_height=$(curl -s https://0g-testnet-rpc.rpcdot.com/status | jq -r .result.sync_info.latest_block_height);
blocks_left=$((network_height - local_height));
echo "Node height: $local_height";
echo "Network height: $network_height";
echo "Remaining blocks: $blocks_left"
Pubkey
npx
0gchaind deposit validator-keys --home /root/.0gchaind/0g-home/0gchaind-home --chaincfg.chain-spec=devnet
Wallet Address :
npx
curl -L https://foundry.paradigm.xyz | bash
npx
source ~/.bashrc
npx
foundryup
npx
cast --version
npx
cast call \
0xea224dBB52F57752044c0C86aD50930091F561B9 \
"computeValidatorAddress(bytes)(address)" \
"pub-key-eth" \
--rpc-url https://0g-testnet-rpc.rpcdot.com
Delete Node
npx
cd $HOME
sudo systemctl stop 0gchaind geth
sudo systemctl disable 0gchaind geth
sudo rm /etc/systemd/system/0gchaind.service
sudo rm /etc/systemd/system/geth.service
sudo systemctl daemon-reload
sudo rm -f $(which 0gchaind)
sudo rm -f $(which geth)
sudo rm -rf $HOME/.0gchaind
sudo rm -rf $HOME/galileo-used
Table of Contents