πŸ“ Installation

Manual Installation

Official DocumentationRecommended Hardware: 4 Cores, 8GB RAM, 200GB of storage (NVME)

# install dependencies, if needed
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y

no

# install go, if needed
cd $HOME
VER="1.21.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"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin

# set vars
echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="test"" >> $HOME/.bash_profile
echo "export HEDGE_CHAIN_ID="berberis-1"" >> $HOME/.bash_profile
echo "export HEDGE_PORT="58"" >> $HOME/.bash_profile
source $HOME/.bash_profile

# download binary
cd $HOME
mkdir -p $HOME/hedge && cd hedge
wget -O hedged https://github.com/hedgeblock/testnets/releases/download/v0.1.0/hedged_linux_amd64_v0.1.0
chmod +x hedge
cp hedged $HOME/go/bin/hedged

# config and init app
hedged config node tcp://localhost:${HEDGE_PORT}657
hedged config keyring-backend os
hedged config chain-id berberis-1
hedged init "test" --chain-id berberis-1

# download genesis and addrbook
wget -O $HOME/.hedge/config/genesis.json https://testnet-files.bonynode.online/hedge/genesis.json
wget -O $HOME/.hedge/config/addrbook.json https://testnet-files.bonynode.online/hedge/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

# set custom ports in app.toml
sed -i.bak -e "s%:1317%:${HEDGE_PORT}317%g;
s%:8080%:${HEDGE_PORT}080%g;
s%:9090%:${HEDGE_PORT}090%g;
s%:9091%:${HEDGE_PORT}091%g;
s%:8545%:${HEDGE_PORT}545%g;
s%:8546%:${HEDGE_PORT}546%g;
s%:6065%:${HEDGE_PORT}065%g" $HOME/.hedge/config/app.toml

# set custom ports in config.toml file
sed -i.bak -e "s%:26658%:${HEDGE_PORT}658%g;
s%:26657%:${HEDGE_PORT}657%g;
s%:6060%:${HEDGE_PORT}060%g;
s%:26656%:${HEDGE_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${HEDGE_PORT}656\"%;
s%:26660%:${HEDGE_PORT}660%g" $HOME/.hedge/config/config.toml

# config 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-interval *=.*/pruning-interval = \"50\"/" $HOME/.hedge/config/app.toml

# set minimum gas price, enable prometheus and disable indexing
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.01uhedge"|g' $HOME/.hedge/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.hedge/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.hedge/config/config.toml

# create service file
sudo tee /etc/systemd/system/hedged.service > /dev/null <<EOF
[Unit]
Description=Hedge node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.hedge
ExecStart=$(which hedged) start --home $HOME/.hedge
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

# reset and download snapshot
hedged tendermint unsafe-reset-all --home $HOME/.hedge
if curl -s --head curl https://testnet-files.bonynode.online/hedge/snap_hedge.tar.lz4 | head -n 1 | grep "200" > /dev/null; then
  curl https://testnet-files.bonynode.online/hedge/snap_hedge.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.hedge
    else
  echo no have snap
fi

# enable and start service
sudo systemctl daemon-reload
sudo systemctl enable hedged
sudo systemctl restart hedged && sudo journalctl -u hedged -f

Automatic Installation

pruning: custom: 100/0/10 | indexer:

source <(curl -s https://main.bonynode.online/api/testnet/hedge/autoinstall/)

Create wallet

# to create a new wallet, use the following command. don’t forget toΒ save the mnemonic
hedged keys add $WALLET

# to restore exexuting wallet, use the following command
hedged keys add $WALLET --recover

# save wallet and validator address
WALLET_ADDRESS_hedge=$(hedged keys show $WALLET -a)
VALOPER_ADDRESS_hedge=$(hedged keys show $WALLET --bech val -a)
echo "export WALLET_ADDRESS_hedge="$WALLET_ADDRESS_hedge >> $HOME/.bash_profile
echo "export VALOPER_ADDRESS_hedge="$VALOPER_ADDRESS_hedge >> $HOME/.bash_profile
source $HOME/.bash_profile

# check sync status, once your node is fully synced, the output from above will print "false"
hedged status 2>&1 | jq 

# before creating a validator, you need to fund your wallet and check balance
hedged query bank balances $WALLET_ADDRESS_hedge 

Create validator

MonikerIdentityDetailsAmount, uhedgeCommission rateCommission max rateCommission max change rateWebsite

hedged tx staking create-validator \
--amount 1000000uhedge \
--from $WALLET \
--commission-rate 0.1 \
--commission-max-rate 0.2 \
--commission-max-change-rate 0.01 \
--min-self-delegation 1 \
--pubkey $(hedged tendermint show-validator) \
--moniker "test" \
--identity "" \
--website "" \
--details "I love blockchain πŸ’š" \
--chain-id berberis-1 \
--gas 200000 --gas-prices 10000uhedge \
-y

Security

To protect you keys please don`t share your privkey, mnemonic and follow a basic security rules

Set up ssh keys for authentication

You can use this guide to configure ssh authentication and disable password authentication on your server

Firewall security

Set the default to allow outgoing connections, deny all incoming, allow ssh and node p2p port

sudo ufw default allow outgoing 
sudo ufw default deny incoming 
sudo ufw allow ssh/tcp 
sudo ufw allow ${HEDGE_PORT}656/tcp
sudo ufw enable

Delete node

sudo systemctl stop hedged
sudo systemctl disable hedged
sudo rm -rf /etc/systemd/system/hedged.service
sudo rm $(which hedged)
sudo rm -rf $HOME/.hedge
sed -i "/HEDGE_/d" $HOME/.bash_profile

Last updated