Install dependencies
Update system and install build tools
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential
sudo apt -qy upgrade
Install Go
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.21.10.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)
Download and build binary
Clone project repository
cd $HOME
wget -O uniond https://snapshots.tienthuattoan.com/testnet/union/uniond
chmod +x uniond
cp -r uniond $HOME/go/bin/
uniond version --home "/root/.union"
Initialize the node
Set node configuration
uniond config chain-id soarchaintestnet --home "/root/.union"
Initialize the node
uniond init you-node-name --chain-id soarchaintestnet --home "/root/.union"
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 = \"fd3d2c74c0d0d865d7e7160c4666bff9cc552b8b@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 's/pruning = "default"/pruning = "custom"/g' \
$HOME/.union/config/app.toml
sed -i 's/pruning-keep-recent = "0"/pruning-keep-recent = "100"/g' \
$HOME/.union/config/app.toml
sed -i 's/pruning-interval = "0"/pruning-interval = "10"/g' \
$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.lzd https://snapshots.tienthuattoan.com/union/initia/union_latest.tar.lz4 && lz4 -c -d union_latest.tar.lz4 | tar -x -C $HOME/.union
Create service
sudo tee </dev/null /etc/systemd/system/uniond.service
[Unit]
Description=Union node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which uniond) start --home "/root/.union"
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