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.21.11.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.21.11.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.21.11.linux-amd64.tar.gz
Download and build binary
Clone project repository
cd $HOME
rm -rf chain
git clone https://github.com/bandprotocol/chain
cd chain
git checkout v2.5.4
make install
bandd version
which bandd
Or download directly binary
wget -O bandd https://snapshots.tienthuattoan.com/mainnet/band/bandd && mv bandd $HOME/go/bin
Initialize the node
Set node configuration
bandd config chain-id laozi-mainnet
Initialize the node
bandd init you-node-name --chain-id laozi-mainnet
Download genesis and addrbook
curl -Ls https://snapshots.tienthuattoan.com/mainnet/band/genesis.json > $HOME/.band/config/genesis.json
curl -Ls https://snapshots.tienthuattoan.com/mainnet/band/addrbook.json > $HOME/.band/config/addrbook.json
Add seed
sed -i -e "s|^seeds *=.*|seeds = \"09cf1a2ed0be728448bed15861d7f0eb18f2eb64@band-mainnet-rpc.tienthuattoan.com:34656\"|" $HOME/.band/config/config.toml
Set minimum gas price
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.0025uband\"|" $HOME/.band/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/.band/config/app.toml
sed -i 's/indexer = "kv"/indexer = "null"/g' $HOME/.band/config/config.toml
Download Snapshot
wget -O band_latest.tar.lz4 https://snapshots.tienthuattoan.com/mainnet/band/band_latest.tar.lz4 && lz4 -c -d band_latest.tar.lz4 | tar -x -C $HOME/.band
Create service
sudo tee /etc/systemd/system/bandd.service > /dev/null << EOF
[Unit]
Description=Band node service
After=network-online.target
[Service]
User=$USER
ExecStart=$(which bandd) 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 bandd
sudo systemctl restart bandd
sudo journalctl -u bandd -f