Union labs

Node installation

Start a codespace from a template and get to developing with the power of a virtual machine in the cloud.

Recommended Hardware

ubuntu-20.04

ubuntu-22.04

CPU:

RAM:

16 cores

64GB

Storage:

500GB

Node consumption

realtime

Cpu_cores

0.07 Core

0.44%

Ram

487 MB

0.74%

Storage

write | read

31.73 GB

0

kb/s

|

0

kb/s

Earliest block / Latest block

Node name

Port

Pruning

Pruning keep recent

Pruning interval

Manual upgrade

### Install dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install git gcc make jq curl lz4
### Install go
cd $HOME
VER=1.23.5
wget -qO go.tar.gz "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go.tar.gz
rm go.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bashrc
source ~/.bashrc
mkdir -p ~/go/bin
### Download binary and build
cd $HOME
rm -rf uniond
git clone https://github.com/unionlabs/union uniond
cd uniond
APP_VERSION=uniond/v1.1.1-rc1.alpha1
git checkout tags/$APP_VERSION -b $APP_VERSION
cd uniond && go build -o uniond ./cmd/uniond && mv uniond ../../go/bin/.
### Config and init app
uniond init --chain-id union-testnet-10
wget -O $HOME/.union/config/genesis.json https://st-snap-1.stakeme.pro/union/testnet/pruned/genesis.json
wget -O $HOME/.union/config/addrbook.json https://st-snap-1.stakeme.pro/union/testnet/pruned/addrbook.json
### Set seeds and peers
SEED=26a6eaf0494a269ec5b68610e61d8a73bb80198f@union-testnet-seed.stakeme.pro:17156
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 in app.toml and config.toml
sed -i.bak -e "s%:1317%:317%g;
s%:8080%:080%g;
s%:9090%:090%g;
s%:9091%:091%g;
s%:8545%:545%g;
s%:8546%:546%g;
s%:6065%:065%g" $HOME/.union/config/app.toml
sed -i.bak -e "s%:26658%:658%g;
s%:26657%:657%g;
s%:6060%:060%g;
s%:26656%:656%g;
s%:26660%: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 = \"\"/" $HOME/.union/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"\"/" $HOME/.union/config/app.toml
### Set minimum gas price
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0muno"|g' $HOME/.union/config/app.toml
### Disable indexing if needed
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=Uniond Daemon
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.union
ExecStart=$(which uniond) start
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
### Reset and state sync
uniond tendermint unsafe-reset-all --home $HOME/.union
STATYSYNC_RPC=https://union-testnet-rpc.stakeme.pro:443
LATEST_HEIGHT=$(curl -s $STATYSYNC_RPC/block | jq -r .result.block.header.height);
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000));
TRUST_HASH=$(curl -s "$STATYSYNC_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ;
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$STATYSYNC_RPC,$STATYSYNC_RPC\"| ;
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ;
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ;
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.union/config/config.toml
### Enable and start service
sudo systemctl daemon-reload
sudo systemctl enable uniond.service
sudo systemctl restart uniond.service && sudo journalctl -u uniond.service -f -o cat