# Node Installation

<figure><img src="https://pbs.twimg.com/profile_images/1404775608798699522/ohhSUimj_400x400.jpg" alt="" width="188"><figcaption></figcaption></figure>

***

| Version | Chain-id      | Wasm    |
| ------- | ------------- | ------- |
| v2.5.3  | laozi-mainnet | ENABLED |

### Setup Server

```shell
# Update Packages
sudo apt update && apt upgrade -y
sudo apt install curl git jq lz4 build-essential unzip fail2ban ufw -y

# Set Firewall
sudo apt install -y ufw
sudo ufw default allow outgoing
sudo ufw default deny incoming
sudo ufw allow ssh
sudo ufw allow 9100

# Enable Firewall
sudo ufw enable

# Install Go
ver="1.20.8"
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"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version

# Install Cosmovisor (OPTIONAL If you are using Cosmovisor)
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.5.0
```

### Node Installation

There is 2 ways to install node , using Cosmovisor or Run the binary directly, you can choose whats you prefer

{% tabs %}
{% tab title="Cosmovisor (Recommended)" %}
{% code fullWidth="true" %}

```sh
# Download and install binary
cd $HOME
rm -rf band
git clone https://github.com/bandprotocol/chain band
cd band
git checkout v2.5.3
make install


# Setup Cosmovisor Symlinks
mkdir -p $HOME/.band/cosmovisor/genesis/bin
mv $HOME/go/bin/bandd $HOME/.band/cosmovisor/genesis/bin/

sudo ln -s $HOME/.band/cosmovisor/genesis $HOME/.band/cosmovisor/current
sudo ln -s $HOME/.band/cosmovisor/current/bin/bandd /usr/local/bin/bandd


# Set Configuration for your node
bandd config chain-id laozi-mainnet
bandd config keyring-backend file


# Init your node
# You can change "MyNode" to anything you like
bandd init MyNode --chain-id laozi-mainnet


# Add Genesis File and Addrbook
curl -Ls https://snapshots.indonode.net/band/genesis.json > $HOME/.band/config/genesis.json
curl -Ls https://snapshots.indonode.net/band/addrbook.json > $HOME/.band/config/addrbook.json


#Configure Seeds and Peers
PEERS="$(curl -sS https://rpc.band.indonode.net/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}' | sed -z 's|\n|,|g;s|.$||')"
sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" $HOME/.band/config/config.toml

# Set Pruning, Enable Prometheus
PRUNING="custom"
PRUNING_KEEP_RECENT="100"
PRUNING_INTERVAL="19"

sed -i -e "s/^pruning *=.*/pruning = \"$PRUNING\"/" $HOME/.band/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \
\"$PRUNING_KEEP_RECENT\"/" $HOME/.band/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \
\"$PRUNING_INTERVAL\"/" $HOME/.band/config/app.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.band/config/config.toml

# Set Service file
sudo tee /etc/systemd/system/bandd.service > /dev/null << EOF
[Unit]
Description=bandd testnet node service
After=network-online.target

[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.band"
Environment="DAEMON_NAME=bandd"
Environment="UNSAFE_SKIP_BACKUP=true"

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable bandd

# Download Latest Snapshot
curl -L https://snapshots.indonode.net/band/band-snapshot.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.band
[[ -f $HOME/.band/data/upgrade-info.json ]] && cp $HOME/.band/data/upgrade-info.json $HOME/.band/cosmovisor/genesis/upgrade-info.json

# Start the Node
sudo systemctl restart bandd
sudo journalctl -fu bandd -o cat
```

{% endcode %}
{% endtab %}

{% tab title="Non-Cosmovisor" %}

```sh
# Download and install binary
cd $HOME
rm -rf band
git clone https://github.com/bandprotocol/chain band
cd band
git checkout v2.5.3
make install


# Set Configuration for your node
bandd config chain-id laozi-mainnet
bandd config keyring-backend file


# Init your node
# You can change "MyNode" to anything you like
bandd init MyNode --chain-in laozi-mainnet


# Add Genesis File and Addrbook
curl -Ls https://snapshots.indonode.net/band/genesis.json > $HOME/.band/config/genesis.json
curl -Ls https://snapshots.indonode.net/band/addrbook.json > $HOME/.band/config/addrbook.json

#Configure Seeds and Peers
PEERS="$(curl -sS https://rpc.band.indonode.net/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}' | sed -z 's|\n|,|g;s|.$||')"
sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" $HOME/.band/config/config.toml


# Set Pruning, Enable Prometheus, Gas Prices, and Indexer
PRUNING="custom"
PRUNING_KEEP_RECENT="100"
PRUNING_INTERVAL="19"

sed -i -e "s/^pruning *=.*/pruning = \"$PRUNING\"/" $HOME/.band/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \
\"$PRUNING_KEEP_RECENT\"/" $HOME/.band/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \
\"$PRUNING_INTERVAL\"/" $HOME/.band/config/app.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.band/config/config.toml


# Set Service file
sudo tee /etc/systemd/system/bandd.service > /dev/null <<EOF
[Unit]
Description=band testnet node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which bandd) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable bandd

# Download Latest Snapshot
curl -L https://snapshots.indonode.net/band/band-snapshot.tar.lz4 | tar -Ilz4 -xf - -C $HOME/.band
[[ -f $HOME/.band/data/upgrade-info.json ]] && cp $HOME/.band/data/upgrade-info.json $HOME/.band/cosmovisor/genesis/upgrade-info.json

# Start the Node
sudo systemctl restart bandd
sudo journalctl -fu bandd -o cat
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.indonode.net/mainnet/band/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
