# Installation

| Hardware | Minimum requirement |
| -------- | ------------------- |
| CPU      | 4                   |
| RAM      | 8+ GB               |
| Storage  | 250 GB SSD          |

{% embed url="<https://docs.celestia.org/nodes/overview>" %}
Official Documentation&#x20;
{% endembed %}

#### Install dependencies <a href="#install-dependencies" id="install-dependencies"></a>

```
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** <a href="#install-go" id="install-go"></a>

```
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.21.10.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)
```

#### Download and build binaries <a href="#install-node" id="install-node"></a>

```
# set vars
echo "export WALLET="wallet_celstia"" >> $HOME/.bash_profile
echo "export MONIKER="validator"" >> $HOME/.bash_profile
echo "export CELESTIA_CHAIN_ID="mocha-4"" >> $HOME/.bash_profile
echo "export CELESTIA_PORT="112"" >> $HOME/.bash_profile
source $HOME/.bash_profile

# download binary
cd $HOME 
rm -rf celestia-app 
git clone https://github.com/celestiaorg/celestia-app.git 
cd celestia-app/ 
APP_VERSION=v1.9.0
git checkout tags/$APP_VERSION -b $APP_VERSION 
make install
cd $HOME
rm -rf networks
git clone https://github.com/celestiaorg/networks.git
celestia-appd init $MONIKER --chain-id $CELESTIA_CHAIN_ID

# config and init app
celestia-appd config node tcp://localhost:${CELESTIA_PORT}57
celestia-appd config keyring-backend os
celestia-appd config chain-id $CELESTIA_CHAIN_ID

# download genesis and addrbook
wget -O $HOME/.celestia-app/config/genesis.json  https://testnet-files.suntzu.dev/download/testnet/celestia/genesis.json
wget -O $HOME/.celestia-app/config/addrbook.json https://testnet-files.suntzu.dev/download/testnet/celestia/addrbook.json

# set seeds and peers
SEEDS=$(curl -sL https://raw.githubusercontent.com/celestiaorg/networks/master/celestia/seeds.txt | tr '\n' ',')
PEERS=$(curl -sL https://raw.githubusercontent.com/celestiaorg/networks/master/celestia/peers.txt | tr '\n' ',')
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.celestia-app/config/config.toml

# set custom ports in app.toml
sed -i \
  -e "s|^proxy_app = \"tcp://127.0.0.1:26658\"|proxy_app = \"tcp://127.0.0.1:${CELESTIA_PORT}58\"|" \
  -e "s|^laddr = \"tcp://127.0.0.1:26657\"|laddr = \"tcp://127.0.0.1:${CELESTIA_PORT}57\"|" \
  -e "s|^laddr = \"tcp://0.0.0.0:26656\"|laddr = \"tcp://0.0.0.0:${CELESTIA_PORT}56\"|" \
  -e "s|^prometheus_listen_addr = \":26660\"|prometheus_listen_addr = \":${CELESTIA_PORT}66\"|" \
  -e "s|^pprof_laddr = \"localhost:6060\"|pprof_laddr = \"localhost:${CELESTIA_PORT}60\"|" \
  $HOME/.celestia-app/config/config.toml

sed -i \
  -e "s|^address = \"tcp://0.0.0.0:1317\"|address = \"tcp://127.0.0.1:${CELESTIA_PORT}17\"|" \
  -e "s|^address = \"0.0.0.0:9090\"|address = \"0.0.0.0:${CELESTIA_PORT}90\"|" \
  -e "s|^address = \":8080\"|address = \":${CELESTIA_PORT}80\"|" \
  -e "s|^address = \"0.0.0.0:9091\"|address = \"0.0.0.0:${CELESTIA_PORT}91\"|" \
  $HOME/.celestia-app/config/app.toml

# config pruning
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.celestia-app/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.celestia-app/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.celestia-app/config/app.toml

# set minimum gas price, enable prometheus and disable indexing
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.005utia"|g' $HOME/.celestia-app/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.celestia-app/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.celestia-app/config/config.toml

# create service file
sudo tee /etc/systemd/system/celestia-appd.service > /dev/null <<EOF
[Unit]
Description=Celestia node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.celestia-app
ExecStart=$(which celestia-appd) start --home $HOME/.celestia-app
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

# reset and download snapshot
celestia-appd tendermint unsafe-reset-all --home $HOME/.celestia-app
if curl -s --head curl https://testnet-files.suntzu.dev/download/testnet/celestia/celestia-snapshot.tar.lz4 | head -n 1 | grep "200" > /dev/null; then
  curl https://testnet-files.suntzu.dev/download/testnet/celestia/celestia-snapshot.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.celestia-app
    else
  echo no have snap
fi

# enable and start service
sudo systemctl daemon-reload
sudo systemctl enable celestia-appd
sudo systemctl restart celestia-appd && sudo journalctl -u celestia-appd -f
```


---

# 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://services.suntzu.dev/testnet/celestia/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.
