Installation
0G Testnet guide
Last updated
0G Testnet guide
Last updated
Node Type | CPU | RAM | Storage |
---|---|---|---|
sudo apt update && sudo apt upgrade -y
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq chrony liblz4-tool -y
ver="1.21.6"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version
cd $HOME && mkdir -p go/bin/
cd $HOME
rm -rf 0g-chain
wget -O 0gchaind https://github.com/0glabs/0g-chain/releases/download/v0.4.0/0gchaind-linux-v0.4.0
chmod +x $HOME/0gchaind
sudo mv $HOME/0gchaind $HOME/go/bin
0gchaind version --long | grep -e version -e commit
version: 0.4.0
commit: 840deea660500f3948300ea3e9a1cba878ed682b
0gchaind keys add <walletname>
0gchaind keys add <walletname> --recover
wget -O $HOME/.0gchain/config/genesis.json https://testnet-files.itrocket.net/og/genesis.json
wget -O $HOME/.0gchain/config/addrbook.json https://testnet-files.itrocket.net/og/addrbook.json
sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.025ua0gi\"/;" ~/.0gchain/config/app.toml
external_address=$(wget -qO- eth0.me)
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.0gchain/config/config.toml
peers=""
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.0gchain/config/config.toml
seeds=""
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.0gchain/config/config.toml
sed -i 's/max_num_inbound_peers =.*/max_num_inbound_peers = 50/g' $HOME/.0gchain/config/config.toml
sed -i 's/max_num_outbound_peers =.*/max_num_outbound_peers = 50/g' $HOME/.0gchain/config/config.toml
pruning="custom"
pruning_keep_recent="1000"
pruning_keep_every="0"
pruning_interval="10"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.0gchain/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.0gchain/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.0gchain/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.0gchain/config/app.toml
sudo tee /etc/systemd/system/0gchaind.service > /dev/null <<EOF
[Unit]
Description=0gchaind
After=network-online.target
[Service]
User=$USER
ExecStart=$(which 0gchaind) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable 0gchaind
sudo systemctl restart 0gchaind && sudo journalctl -fu 0gchaind -o cat
0gchaind tx staking create-validator \
--amount 1000000ua0gi \
--from <walletName> \
--commission-max-change-rate "0.1" \
--commission-max-rate "0.1" \
--commission-rate "0.05" \
--min-self-delegation "1" \
--pubkey $(0gchaind tendermint show-validator) \
--moniker YOUR_MONIKER_NAME \
--chain-id zgtendermint_16600-2 \
--identity="YOUR_KEYBASE_ID" \
--details="YOUR_DETAILS" \
--website="YOUR_WEBSITE_URL"
--gas=500000 \
--gas-prices=99999ua0gi \
-y
sudo systemctl stop 0gchaind
sudo systemctl disable 0gchaind
rm /etc/systemd/system/0gchaind.service
sudo systemctl daemon-reload
cd $HOME
rm -rf 0g-chain
rm -rf .0gchain
rm -rf $(which 0gchaind)
0gchaind init --chain-id=zgtendermint_16600-2
0gchaind config --chain-id=zgtendermint_16600-2
Testnet
8
16GB
250GB