0G-Chain
Validator installation
Installation
## Install Go
cd $HOME
VERSION=1.21.3
wget -O go.tar.gz https://go.dev/dl/go$VERSION.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go.tar.gz && rm go.tar.gz
echo 'export GOROOT=/usr/local/go' >> $HOME/.bash_profile
echo 'export GOPATH=$HOME/go' >> $HOME/.bash_profile
echo 'export GO111MODULE=on' >> $HOME/.bash_profile
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile && . $HOME/.bash_profile
go version
#install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
#install binary
rm -rf $HOME/.0gchain
git clone -b v0.1.0 https://github.com/0glabs/0g-chain.git
cd $HOME/0g-chain
make build
chmod +x $HOME/0g-chain/out/linux/0gchaind
mv $HOME/0g-chain/out/linux/0gchaind $HOME/go/bin
#init
0gchaind init <your_validator_name> --chain-id zgtendermint_16600-1
#Download Genesis File
wget -O $HOME/.0gchain/config/genesis.json https://raw.githubusercontent.com/Idekubaguscom/testnet/main/0g-chain/genesis.json
#Update Peers
[email protected]:26656,[email protected]:14256,[email protected]:[email protected]:1020,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:31656,[email protected]:32656,[email protected]:47656,[email protected]:26656,[email protected]:[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:19656,[email protected]:26656,[email protected]:16656,[email protected]:26656,[email protected]:26656,[email protected]:26656
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.0gchain/config/config.toml
# create service file
sudo tee /etc/systemd/system/0gchaind.service > /dev/null <<EOF
[Unit]
Description=0gchain node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which 0gchaind) start --home $HOME/.0gchain
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
#start service
sudo systemctl daemon-reload
sudo systemctl enable 0gchaind
sudo systemctl restart 0gchaind && sudo journalctl -u 0gchaind -fo catCreate Wallet
Faucet
Registering as a Validator
Delete Node
Cheatsheet
Give me some coffee ☕
Last updated