Skip to content

Install

Website | Twitter | Discord | Explorer


Public Endpoints | Genesis | Addrbook

Chain ID: berberis-1 | Latest Version: v0.1.0 | Custom Port: 126
Specify the name of your “MONIKER” (validator) which will be visible in the explorer
MONIKER="YOUR_MONIKER_NAME"

Update system and install tools

sudo apt update && sudo apt upgrade -y
sudo apt install curl build-essential git jq lz4 ncdu bashtop -y

Install GO

cd $HOME
version="1.22.5"
wget "https://golang.org/dl/go$version.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$version.linux-amd64.tar.gz"
rm "go$version.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile

Install Cosmovisor

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0

Download and install

cd $HOME
# Install CosmWasm library
rm -rf /usr/lib/libwasmvm.x86_64.so
wget -P /usr/lib https://github.com/CosmWasm/wasmvm/releases/download/v1.3.0/libwasmvm.x86_64.so
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/hedged
hedged version --long | grep -e commit -e version

Config and Init node

# Set node configuration
hedged config chain-id berberis-1
hedged config keyring-backend test
hedged config node tcp://localhost:12657
# Initialize node
hedged init $MONIKER --chain-id berberis-1
# Download genesis and addrbook
curl -Ls https://snapshots.moonbridge.team/testnet/hedge/genesis.json > $HOME/.hedge/config/genesis.json
curl -Ls https://snapshots.moonbridge.team/testnet/hedge/addrbook.json > $HOME/.hedge/config/addrbook.json
# Set seeds and peers
SEEDS=""
PEERS=""
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.hedge/config/config.toml
# Setting minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.0025uhedge\"|" $HOME/.hedge/config/app.toml
# Setting pruning
sed -i -e 's|^pruning *=.*|pruning = "custom"|' $HOME/.hedge/config/app.toml
sed -i -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' $HOME/.hedge/config/app.toml
sed -i -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' $HOME/.hedge/config/app.toml
sed -i -e 's|^pruning-interval *=.*|pruning-interval = "10"|' $HOME/.hedge/config/app.toml
# Disable indexer
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.hedge/config/config.toml
# Enable Prometheus
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.hedge/config/config.toml
# Setting custom ports
sed -i -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:12658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://0.0.0.0:12657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:12660\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:12656\"%; s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):12656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":12666\"%" $HOME/.hedge/config/config.toml
sed -i -e "s%:1317%:12617%g; s%:8080%:12680%g; s%:9090%:12690%g; s%:9091%:12691%g; s%:8545%:12645%g; s%:8546%:12646%g; s%:6065%:12665%g" $HOME/.hedge/config/app.toml

Configure Cosmovisor

mkdir -p $HOME/.hedge/cosmovisor/genesis/bin
mkdir -p $HOME/.hedge/cosmovisor/upgrades
cp $HOME/go/bin/hedged $HOME/.hedge/cosmovisor/genesis/bin/

Create service

sudo tee /etc/systemd/system/hedged.service > /dev/null << EOF
[Unit]
Description=Hedge Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=always
RestartSec=5
LimitNOFILE=65535
Environment="DAEMON_NAME=hedged"
Environment="DAEMON_HOME=$HOME/.hedge"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable hedged

Download latest snapshot

curl -o - -L https://snapshots.moonbridge.team/testnet/hedge/snapshot_latest.tar.lz4 | lz4 -dc - | tar -x -C $HOME/.hedge
[[ -f $HOME/.hedge/data/upgrade-info.json ]] && cp $HOME/.hedge/data/upgrade-info.json $HOME/.hedge/cosmovisor/genesis/upgrade-info.json

Start service and check the logs

sudo systemctl start hedged && sudo journalctl -u hedged -f --no-hostname -o cat

Create wallet

hedged keys add wallet

Check wallet 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 "YOUR_MONIKER_NAME" \
--identity "YOUR_KEYBASE_ID" \
--details "YOUR_DETAILS" \
--website "YOUR_WEBSITE_URL" \
--security-contact "YOUR_EMAIL_ADDRESS" \
--chain-id berberis-1 \
--commission-rate 0.10 \
--commission-max-rate 0.20 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--from wallet \
--gas-adjustment 1.4 \
--gas auto \
--gas-prices 0.0025uhedge \
-y

Delete node

sudo systemctl stop hedged
sudo systemctl disable hedged
sudo rm -rf /etc/systemd/system/hedged.service
sudo systemctl daemon-reload
sudo rm -f $(which hedged)
sudo rm -rf $HOME/.hedge