# Installation

## H**ardware Requirements**

<table><thead><tr><th>Node Type</th><th width="155">CPU</th><th width="160">RAM</th><th>Storage</th></tr></thead><tbody><tr><td>Mainnet</td><td>4</td><td>8 GB</td><td>200GB (SSD or NVME)</td></tr></tbody></table>

## Server preparation

1. **Update your system packages:**

```
sudo apt update && sudo apt upgrade -y
```

2. **Install essential dependencies**:.

```
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
```

3. **Install Go** 1.23.1 (required for building Stargaze):

```
ver="1.23.1"
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 Stargaze Node

1. **Clone Stargaze Git repository**:

```
cd $HOME
git clone https://github.com/public-awesome/stargaze stargaze
cd stargaze
```

2. **Checkout the desired version**:

```
git checkout v15.0.0-beta.3-testnet
```

3. **Build the Stargaze node**:

```
make install
```

4. **Check the version**:

```
starsd version --long | grep -e commit -e version
```

> Expected output:
>
> * **version:** 15.0.0-beta.3-testnet
> * **commit:** d69fb6b0d47c4b4c03906880375c03b51fbb44cb

***

## Node Initialization

1. **Set your moniker** (validator name) by replacing `<moniker>` with your desired name:

```
starsd init <moniker> --chain-id elgafar-1
```

2. **Configure the chain ID**:

```
starsd config chain-id elgafar-1
```

***

## Create / recover wallet

1. **Create a new wallet**:

```
starsd keys add <walletname>
```

2. **Or recover an existing wallet**:

```
starsd keys add <walletname> --recover
```

***

## Download genesis and addrbook

1. **Download Genesis and Addrbook files**:

```
```

2. **Verify the integrity of the Genesis file**:

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

> **Expected output**:
>
> * 3b6b974f3b882b0ff94366169c4e598810ba4774f389c2816d9acb2fb71200b4

***

## Setup Peers

1. **Edit the configuration to include a peer** (use the BlockPro peer in this example):

```
```

***

## Pruning (optional)

Pruning helps reduce the storage size of the node. You can set it up as follows:

1. **Enable pruning and set values**:

<pre><code><strong>pruning="custom"
</strong>pruning_keep_recent="100"
pruning_keep_every="0"
pruning_interval="10"

sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.starsd/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.starsd/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.starsd/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.starsd/config/app.toml
</code></pre>

***

## Create a Systemd Service File

1. **Create and configure the systemd service** to run Stargaze as a service:

```
sudo tee /etc/systemd/system/starsd.service > /dev/null <<EOF
[Unit]
Description=stargaze testnet
After=network-online.target

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

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

2. **Reload and start the Stargaze service**:

```
sudo systemctl daemon-reload
sudo systemctl enable starsd
sudo systemctl restart starsd && sudo journalctl -fu starsd -o cat
```

***

## Create validator

1. **Create your validator** by replacing the placeholders with your values:

```
starsd tx staking create-validator \
  --amount 1000000ustars \
  --from <walletName> \
  --commission-max-change-rate "0.01" \
  --commission-max-rate "0.20" \
  --commission-rate "0.05" \
  --min-self-delegation "1" \
  --pubkey $(starsd tendermint show-validator) \
  --moniker <YOUR_MONIKER_NAME> \
  --chain-id stargaze-1 \
  --identity="<YOUR_KEYBASE_ID>" \
  --details="<YOUR_DETAILS>" \
  --website="<YOUR_WEBSITE_URL>" \
  --fees 200000ustars \
  --gas-adjustment 1.5 \
  -y

```

## Delete node

1. **Stop the Stargaze service**:

```
sudo systemctl stop starsd
sudo systemctl disable starsd
```

2. **Remove systemd service**:

```
rm /etc/systemd/system/starsd.service
sudo systemctl daemon-reload
```

3. **Remove the Stargaze node and data**:

```
cd $HOME
rm -rf stargaze
rm -rf .starsd
rm -rf $(which starsd)
```


---

# 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://service.block-pro.net/testnet/stargaze/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.
