Welcome Zstake Service
0G Labs
Validator
this guide was partially excerpted from the guides by itrocket, josephtran, and validatorvn 🛞 auto installer (by itrocket net) ⌨️ source <(curl s https //itrocket net/api/testnet/og/autoinstall/) 🕹️ manual installer install ⌨️ sudo apt update sudo apt install curl git jq build essential gcc unzip wget lz4 y cd $home && \\ ver="1 23 3" && \\ 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 \# update or add moniker grep q '^export moniker=' / bash profile && \\ sed i 's/export moniker="\[^"] "/export moniker="zstake"/' / bash profile || \\ echo 'export moniker="zstake"' >> / bash profile \# update or add chain id grep q '^export chain id=' / bash profile && \\ sed i 's/export chain id="\[^"] "/export chain id="zgtendermint 16600 2"/' / bash profile || \\ echo 'export chain id="zgtendermint 16600 2"' >> / bash profile \# update or add wallet name grep q '^export wallet name=' / bash profile && \\ sed i 's/export wallet name="\[^"] "/export wallet name="wallet"/' / bash profile || \\ echo 'export wallet name="wallet"' >> / bash profile \# update or add rpc port grep q '^export rpc port=' / bash profile && \\ sed i 's/export rpc port="\[^"] "/export rpc port="26657"/' / bash profile || \\ echo 'export rpc port="26657"' >> / bash profile \# update or add 0g home grep q '^export og home=' / bash profile && \\ sed i 's/export og home="\[^"] "/export og home="$home/ 0gchain"/' / bash profile || \\ echo 'export og home="$home/ 0gchain"' >> / bash profile source / bash profile git install cd $home rm rf 0g chain git clone https //github com/0glabs/0g chain git cd 0g chain git checkout v0 3 1 git submodule update init make install 0gchaind version 0gchain install 0gchaind config keyring backend os 0gchaind config chain id zgtendermint 16600 2 0gchaind init "zstake" chain id zgtendermint 16600 2 0gchaind config node tcp\ //localhost 26657 rm / 0gchain/config/genesis json wget p / 0gchain/config https //vps4 josephtran xyz/0g/genesis json seeds="81987895a11f6689ada254c6b57932ab7ed909b6\@54 241 167 190 26656,010fb4de28667725a4fef26cdc7f9452cc34b16d\@54 176 175 48 26656,e9b4bc203197b62cc7e6a80a64742e752f4210d5\@54 193 250 204 26656,68b9145889e7576b652ca68d985826abd46ad660\@18 166 164 232 26656,8f21742ea5487da6e0697ba7d7b36961d3599567\@og testnet seed itrocket net 47656" peers="80fa309afab4a35323018ac70a40a446d3ae9caf\@og testnet peer itrocket net 11656,90490155eb1e28a00cb9000657ef53cf9822e9e2\@185 245 182 248 12656,6d0e4af8b817dbb81266d6c6710033896f1d65cb\@158 220 103 216 12656,881b2297ac90fdf6803136101c1b33eeb52a0bcc\@213 199 37 74 12656,2de20431412255201b960a0713c3a3f6fdbeb7e7\@173 249 19 219 12656,9b6346424a9b1357bae659a51dbbb8d1c4d1366f\@173 249 58 134 12656,055e3e65fd72102f389372564e0107e3ee5022fa\@167 86 95 218 12656,0ada3d654c01607d585793943b37335a97a56691\@213 239 195 210 12656,3f4ee55632cbd8694c7e5d173f10d7d7b23a5ec1\@138 201 185 45 12656,2d780e7cae16cf25dfb992e294d5f672ae8a65ac\@185 190 140 189 12656,85eec3750270e50ea73c46b1caa72e7110fa7b1b\@156 67 81 129 12656,d619b3c8a0cc49b52ce68b45d8ebe2b9060a3f0a\@149 50 111 193 12656,6ea4a3942152a33a50c54cc60aa311fd43cc71d7\@144 91 93 99 12656,d7c847d92cf2714d3018cecd6476b6ef86b4240b\@66 94 113 206 12656,85f1a5c5e62bbe59d9764453bf4624dc261a53f7\@38 242 237 56 12656,1754dac0846c42ebe21fe1935eda0311d567d6a9\@45 14 194 144 12656,7e49c7c5d8cf1a4f79d3a2c4a2c3597d144e638e\@156 67 81 135 12656" sed i e "/^\\\[p2p\\]/,/^\\\[/{s/^\[\[ space ]] seeds = /seeds = \\"$seeds\\"/}" \\ e "/^\\\[p2p\\]/,/^\\\[/{s/^\[\[ space ]] persistent peers = /persistent peers = \\"$peers\\"/}" $home/ 0gchain/config/config toml sed i e "s/^pruning = /pruning = \\"custom\\"/" $home/ 0gchain/config/app toml sed i e "s/^pruning keep recent = /pruning keep recent = \\"100\\"/" $home/ 0gchain/config/app toml sed i e "s/^pruning interval = /pruning interval = \\"50\\"/" $home/ 0gchain/config/app toml sed i 's|minimum gas prices = |minimum gas prices = "0 00025ua0gi"|g' $home/ 0gchain/config/app toml sed i e "s/prometheus = false/prometheus = true/" $home/ 0gchain/config/config toml sed i e "s/^indexer = /indexer = \\"kv"/" $home/ 0gchain/config/config toml sed i 's|^\s #\\?\s laddr\s =\s "tcp\ //127 0 0 1 26657"|laddr = "tcp\ //0 0 0 0 26657"|' $home/ 0gchain/config/config toml sed i 's|^\s #\\?\s api\s = |api = "eth,txpool,personal,net,debug,web3"|' $home/ 0gchain/config/app toml sed i 's|^\s #\\?\s address\s =\s "127 0 0 1 8545"|address = "0 0 0 0 8545"|' $home/ 0gchain/config/app toml sed i 's|^\s #\\?\s ws address\s =\s "127 0 0 1 8546"|ws address = "0 0 0 0 8546"|' $home/ 0gchain/config/app toml 0gchain service create sudo tee /etc/systemd/system/0gd service > /dev/null <\<eof \[unit] description=0g 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 snapshot download sudo systemctl stop 0gd cp $home/ 0gchain/data/priv validator state json $home/ 0gchain/priv validator state json backup rm rf $home/ 0gchain/data 0gchaind tendermint unsafe reset all home / 0gchain/ keep addr book curl https //snapshot validatorvn com/0g/data tar lz4 | lz4 dc | tar xf c $home/ 0gchain mv $home/ 0gchain/priv validator state json backup $home/ 0gchain/data/priv validator state json sudo systemctl restart 0gd && sudo journalctl u 0gd f o cat this is a service provided by validatorvn thank you again addrbook download wget o $home/ 0gchain/config/addrbook json https //server 5 itrocket net/testnet/og/addrbook json 0gd service restart sudo systemctl daemon reload && \\ sudo systemctl enable 0gd && \\ sudo systemctl restart 0gd && sudo systemctl status 0gd log check tail f /root/ 0gchain/log/chain log block sync check 0gchaind status home / 0gchain | jq '{ latest block height sync info latest block height, catching up sync info catching up }'