> For the complete documentation index, see [llms.txt](https://stavr-team.gitbook.io/nodes-guides/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stavr-team.gitbook.io/nodes-guides/archive/band-t-halt/node-installation.md).

# Node Installation

## [**EXPLORER**](https://laozi-testnet6.cosmoscan.io/validators)

* **Minimum hardware requirements**:

| Node Type | CPU | RAM | Storage |
| --------- | --- | --- | ------- |
| Testnet   | 4   | 8GB | 150GB   |

## 1) Auto\_install script

```bash
wget -O bandt https://raw.githubusercontent.com/111STAVR111/props/main/Band/Testnet/bandt && chmod +x bandt && ./bandt
```

## 2) Manual installation

#### Preparing the server

```bash
sudo apt update && sudo apt upgrade -y
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq chrony liblz4-tool -y
```

### GO 1.21.6

```bash
ver="1.21.6"
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
```

## Build 14.09.23

```bash
cd $HOME && mkdir -p $HOME/go/bin/
git clone https://github.com/bandprotocol/chain band
cd band
git checkout v2.5.4
make install
```

`bandd version --long | head`

* version: 2.5.4
* commit: e6548bbf4793829bb8e711e5ed89ba4afc710ded

## Initiation

```python
bandd init STAVR_guide --chain-id band-laozi-testnet6
bandd config chain-id band-laozi-testnet6
```

### Create/recover wallet

```bash
bandd keys add <walletname>
           OR
bandd keys add <walletname> --recover
```

### Download Genesis

```python
curl https://config-t.noders.services/band/genesis.json -o ~/.band/config/genesis.json
```

`sha256sum $HOME/.band/config/genesis.json`

*

### Set up the minimum gas price and Peers/Seeds/Filter peers/MaxPeers

```bash
sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0uband\"/;" ~/.band/config/app.toml
external_address=$(wget -qO- eth0.me) 
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.band/config/config.toml
peers=""
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.band/config/config.toml
seeds=""
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.band/config/config.toml
sed -i 's/max_num_inbound_peers =.*/max_num_inbound_peers = 50/g' $HOME/.band/config/config.toml
sed -i 's/max_num_outbound_peers =.*/max_num_outbound_peers = 50/g' $HOME/.band/config/config.toml

```

#### Pruning (optional)

```bash
pruning="custom"
pruning_keep_recent="1000"
pruning_keep_every="0"
pruning_interval="10"
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-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.band/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.band/config/app.toml
```

#### Indexer (optional)

```bash
indexer="null" &&
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.band/config/config.toml
```

### Download addrbook

```bash
curl https://config-t.noders.services/band/addrbook.json -o ~/.band/config/addrbook.json
```

## Create a service file

```bash
sudo tee /etc/systemd/system/bandd.service > /dev/null <<EOF
[Unit]
Description=band test
After=network-online.target

[Service]
User=$USER
ExecStart=$(which bandd) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF
```

## StateSync Testnet Mainnet

```bash
RPC=https://band.rpc.t.stavr.tech:443
peers=7f03c7f4a41300348afce4b51774ab3fab8ae3c2@band-t.peer.stavr.tech:11016
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.band/config/config.toml
LATEST_HEIGHT=$(curl -s $RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 100)); \
TRUST_HASH=$(curl -s "$RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$RPC,$RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.band/config/config.toml
sudo systemctl stop bandd && bandd tendermint unsafe-reset-all --keep-addr-book
curl -o - -L http://band-t.files.stavr.tech:1103/files-bandt.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.band --strip-components 2
sudo systemctl restart bandd && journalctl -u bandd -f -o cat
```

## SnapShot Testnet updated every 5 hours

```bash
cd $HOME
apt install lz4
sudo systemctl stop bandd
cp $HOME/.band/data/priv_validator_state.json $HOME/.band/priv_validator_state.json.backup
rm -rf $HOME/.band/data
curl -o - -L http://band-t.snapshot.stavr.tech:1025/bandt/bandt-snap.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.band --strip-components 2
curl -o - -L http://band-t.files.stavr.tech:1103/files-bandt.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.band --strip-components 2
mv $HOME/.band/priv_validator_state.json.backup $HOME/.band/data/priv_validator_state.json
curl https://config-t.noders.services/band/addrbook.json -o ~/.band/config/addrbook.json
sudo systemctl restart bandd && journalctl -u bandd -f -o cat
```

### Start

```bash
sudo systemctl daemon-reload
sudo systemctl enable bandd
sudo systemctl restart bandd && sudo journalctl -u bandd -f -o cat
```

#### Create validator

```python
bandd tx staking create-validator \
  --amount=1000000uband \
  --pubkey=$(bandd tendermint show-validator) \
  --moniker="STAVR_Guide" \
  --identity="" \
  --details="" \
  --website="" \
  --chain-id="band-laozi-testnet6" \
  --commission-rate="0.10" \
  --commission-max-rate="0.20" \
  --commission-max-change-rate="0.2" \
  --min-self-delegation="1" \
  --fees 500uband \
  --from=YourWallet -y
```

## [🧩Services and Tools🧩](https://stavr-team.gitbook.io/nodes-guides/testnets/band/statesync-snapshot)

## Monitoring

You can set up your node status alarm here - [Monitoring](https://stavr-team.gitbook.io/nodes-guides/monitoring)

## Security

You can create secure management of your wallet and your node by following this links.

[TMKMS](https://stavr-team.gitbook.io/nodes-guides/tmkms)               [Wallet Security](https://stavr-team.gitbook.io/nodes-guides/wallet-security)

### Delete node

```bash
sudo systemctl stop bandd
sudo systemctl disable bandd
rm /etc/systemd/system/bandd.service
sudo systemctl daemon-reload
cd $HOME
rm -rf band
rm -rf .band
rm -rf $(which bandd)
```
