☑️Hedge-Tesnet

Recommended Hardware: 8 Cores, 64GB RAM, 500GB of storage (NVME)

Installation

Install dependencies, if needed

sudo apt update && sudo apt upgrade -y
sudo apt install curl git jq build-essential gcc unzip wget lz4 -y
sudo apt-get install wget liblz4-tool aria2 -y

Install go, if needed

cd $HOME && \
ver="1.22.0" && \
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" >> ~/.bash_profile && \
source ~/.bash_profile && \
go version

Dowload ibwasmvm.x86_64.so

set -eux; \
  wget -O /lib/libwasmvm.x86_64.so https://github.com/CosmWasm/wasmvm/releases/download/v1.3.0/libwasmvm.x86_64.so

Dowload Hedged

mkdir -p $HOME/go/bin
sudo wget -O hedged https://github.com/hedgeblock/testnets/releases/download/v0.1.0/hedged_linux_amd64_v0.1.0
chmod +x hedged
sudo mv hedged $HOME/go/bin

Config Node

hedged config chain-id berberis-1
hedged config keyring-backend test
hedged init "Moniker" --chain-id berberis-1
sudo wget -O $HOME/.hedge/config/genesis.json "https://raw.githubusercontent.com/dongqn/GuideNode/main/Hedge/genesis.json"
sudo wget -O $HOME/.hedge/config/addrbook.json "https://raw.githubusercontent.com/dongqn/GuideNode/main/Hedge/addrbook.json"
sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.025uhedge\"/;" ~/.hedge/config/app.toml
peers="[email protected]:11856,[email protected]:26856,[email protected]:26856,[email protected]:11856,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:2656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:24056,[email protected]:26656,[email protected]:11856,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:12656,[email protected]:55656,[email protected]:11856,[email protected]:12656,[email protected]:34656,[email protected]:26656,[email protected]:14656,[email protected]:31056,[email protected]:12656,[email protected]:26656,[email protected]:26656,[email protected]:12656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:27656,[email protected]:11856,[email protected]:26656,[email protected]:11856,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:11856,[email protected]:26656,[email protected]:27656,[email protected]:11856,[email protected]:26656,[email protected]:26656,[email protected]:11856,[email protected]:26556,[email protected]:11856,[email protected]:26995,[email protected]:11856,[email protected]:26656,[email protected]:26650,[email protected]:26656,[email protected]:12656,[email protected]:26656,[email protected]:11656,[email protected]:44456"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.hedge/config/config.toml
seeds="[email protected]:26656,b52d56d1d6b653be8e5215b85846fe65ee55af19@testnet-seeds.genznodes.dev:2656"
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.hedge/config/config.toml
sed -i 's/max_num_inbound_peers =.*/max_num_inbound_peers = 50/g' $HOME/.hedge/config/config.toml
sed -i 's/max_num_outbound_peers =.*/max_num_outbound_peers = 50/g' $HOME/.hedge/config/config.toml
sed -i "s/^indexer *=.*/indexer = \"null\"/" $HOME/.hedge/config/config.toml

Pruning and indexer

pruning="custom" && \
pruning_keep_recent="100" && \
pruning_keep_every="0" && \
pruning_interval="10" && \
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.hedge/config/app.toml && \
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.hedge/config/app.toml && \
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.hedge/config/app.toml && \
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.hedge/config/app.toml

Create hedged service for your node to run in the background

sudo tee /etc/systemd/system/hedged.service > /dev/null <<EOF
[Unit]
Description=Hedged Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which hedged) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Start node

sudo systemctl daemon-reload && \
sudo systemctl enable hedged && \
sudo systemctl restart hedged && \
sudo journalctl -u hedged -f -o cat

Check for your syncing progress

hedged status 2>&1 | jq

Create wallet

hedged keys add wallet

# DO NO 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

Check Balance

hedged q bank balances $(hedged keys show wallet -a)

Create validator

hedged tx staking create-validator \
--amount=1000000uhedge \
--pubkey=$(hedged tendermint show-validator) \
--moniker="Moniker" \
--chain-id=berberis-1 \
--commission-rate=0.10 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.1 \
--min-self-delegation=1 --from=wallet \
--gas-prices=0.025uhedge \
--gas-adjustment=1.5 \
--gas=auto \
-y

Delegate to your self

hedged tx staking delegate $(hedged keys show wallet --bech val -a) 1000000uhedge --from wallet --chain-id berberis-1 --gas-prices=0.025uhedge --gas-adjustment=1.5 --gas=auto -y

Unjail

hedged tx slashing unjail --from wallet --chain-id=berberis-1 --gas-prices=0.025uhedge --gas-adjustment=1.5 --gas=auto -y 

Get Validator Info

hedged status 2>&1 | jq -r '.ValidatorInfo // .validator_info'

Node Snapshot Testnet Hedgeblock

Install requirement if don't have:

sudo apt install lz4 -y

Stop node

sudo systemctl stop hedged

Back up priv_validator_state.json

cp $HOME/.hedge/data/priv_validator_state.json $HOME/.hedge/priv_validator_state.json.bak

Reset chain data

hedged tendermint unsafe-reset-all --home $HOME/.hedge --keep-addr-book

Download Snapshot Data

aria2c -x 16 -s 16 https://snapshot-de-1.genznodes.dev/hedgeblock/hedge-testnet-2422536.tar.lz4
lz4 -c -d hedge-testnet-2422536.tar.lz4 | tar -x -C $HOME/.hedge/

Validator node move priv_validator_state.json that was backed up earlier

mv $HOME/.hedge/priv_validator_state.json.bak $HOME/.hedge/data/priv_validator_state.json

Restart node

sudo systemctl restart hedged
journalctl -fu hedged -o cat

Congratulation!!

Now you have completed your node for 0gchain and we will move on to creating your storage node next.

Last updated