Installation
Complete guide to install and configure Union validator node.
Installation
Install Go (if needed)
cd $HOME
VER="1.22.10"
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 Variables
echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="MONIKER"" >> $HOME/.bash_profile
echo "export UNION_CHAIN_ID="union-1"" >> $HOME/.bash_profile
echo "export UNION_PORT="14"" >> $HOME/.bash_profile
source $HOME/.bash_profile
Download Binary
Current Version: v1.0.0
cd $HOME
rm -rf union
git clone https://github.com/unionlabs/union
cd union
git checkout v1.0.0
make build
sudo mv $HOME/union/build/uniond $(which uniond)
Config and Init App
uniond init $MONIKER --chain-id $UNION_CHAIN_ID
sed -i \
-e "s/chain-id = .*/chain-id = \"union-1\"/" \
-e "s/keyring-backend = .*/keyring-backend = \"os\"/" \
-e "s/node = .*/node = \"tcp:\/\/localhost:${UNION_PORT}657\"/" $HOME/.union/config/client.toml
Download Genesis and Addrbook
wget -O $HOME/.union/config/genesis.json https://server-1.ruangnode.com/mainnet/union/genesis.json
wget -O $HOME/.union/config/addrbook.json https://server-1.ruangnode.com/mainnet/union/addrbook.json
Set Seeds and Peers
SEEDS="92e80e4f4d1103a7bcfe7258fb3a4cdf585def2d@seed.ruangnode.com:${UNION_PORT}656"
PEERS="92e80e4f4d1103a7bcfe7258fb3a4cdf585def2d@peer.ruangnode.com:${UNION_PORT}656"
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*seeds *=.*/seeds = \"$SEEDS\"/}" \
-e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.union/config/config.toml
Set Custom Ports
# Set custom ports in app.toml
sed -i.bak -e "s%:1317%:${UNION_PORT}317%g;
s%:8080%:${UNION_PORT}080%g;
s%:9090%:${UNION_PORT}090%g;
s%:9091%:${UNION_PORT}091%g;
s%:8545%:${UNION_PORT}545%g;
s%:8546%:${UNION_PORT}546%g;
s%:6065%:${UNION_PORT}065%g" $HOME/.union/config/app.toml
# Set custom ports in config.toml
sed -i.bak -e "s%:26658%:${UNION_PORT}658%g;
s%:26657%:${UNION_PORT}657%g;
s%:6060%:${UNION_PORT}060%g;
s%:26656%:${UNION_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${UNION_PORT}656\"%g;
s%:26660%:${UNION_PORT}660%g" $HOME/.union/config/config.toml
Config Pruning
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.union/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.union/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"19\"/" $HOME/.union/config/app.toml
Set Minimum Gas Price and Other Configs
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.001au"|g' $HOME/.union/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.union/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.union/config/config.toml
Create Service File
sudo tee /etc/systemd/system/uniond.service > /dev/null <<EOF
[Unit]
Description=Union node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.union
ExecStart=$(which uniond) start --home $HOME/.union
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Enable and Start Service
sudo systemctl daemon-reload
sudo systemctl enable uniond
sudo systemctl restart uniond && sudo journalctl -u uniond -fo cat