Loading...

Install dependencies

Update system and install build tools
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y
Install Go
cd $HOME
sudo rm -rf /usr/local/go
wget https://go.dev/dl/go1.23.6.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.23.6.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source ~/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
go version
which go
rm -rf go1.23.6.linux-amd64.tar.gz

Download and build binary

Clone project repository
cd $HOME
rm -rf N/A
git clone 
cd N/A
git checkout v0.25.0
make install
uniond version
which uniond
Or download directly binary
wget -O uniond https://snapshots.tienthuattoan.com/testnet/union/uniond && mv uniond $HOME/go/bin

Initialize the node

Set node configuration
uniond config chain-id union-testnet-9
Initialize the node
uniond init you-node-name --chain-id union-testnet-9
Download genesis and addrbook
curl -Ls https://snapshots.tienthuattoan.com/testnet/union/genesis.json > $HOME/.union/config/genesis.json
curl -Ls https://snapshots.tienthuattoan.com/testnet/union/addrbook.json > $HOME/.union/config/addrbook.json
Add seed
sed -i -e "s|^seeds *=.*|seeds = \"3c7a29b62a48cc31b3049dff565c59308d9bfe8c@union-testnet-rpc.tienthuattoan.com:17156\"|" $HOME/.union/config/config.toml
Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0muno\"|" $HOME/.union/config/app.toml
Update pruning and disable indexer to save disk space
sed -i \
  -e 's|^pruning *=.*|pruning = "custom"|' \
  -e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
  -e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
  -e 's|^pruning-interval *=.*|pruning-interval = "10"|' \
  $HOME/.union/config/app.toml

sed -i 's/indexer = "kv"/indexer = "null"/g' $HOME/.union/config/config.toml

Download Snapshot

wget -O union_latest.tar.lz4 https://snapshots.tienthuattoan.com/testnet/union/union_latest.tar.lz4 && lz4 -c -d union_latest.tar.lz4 | tar -x -C $HOME/.union

Create service

sudo tee /etc/systemd/system/uniond.service > /dev/null << EOF
[Unit]
Description=Union node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which uniond) start
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Start the service and check the logs
sudo systemctl daemon-reload
sudo systemctl enable uniond
sudo systemctl restart uniond
sudo journalctl -u uniond -f