# Installation

1. **Update packages and install useful tools.**

```
sudo apt update && sudo apt upgrade --yes && \
sudo apt install git build-essential ufw curl jq snapd screen ncdu nano fuse ufw --yes
```

2. **Install `go` using `snap`**.

```
sudo snap install go --classic && \
echo 'export GOPATH="$HOME/go"' >> ~/.profile && \
echo 'export GOBIN="$GOPATH/bin"' >> ~/.profile && \
echo 'export PATH="$GOBIN:$PATH"' >> ~/.profile && \
source ~/.profile && \
go version
```

3. **Install `npm`**&#x20;

```
sudo apt-get install nodejs
sudo apt install npm --yes
```

4. **Build the binary from source.**

```
git clone https://github.com/AltheaFoundation/althea-L1
cd althea-L1
git checkout v1.4.0
make install
althea version
```

5. **Initialize your node.**

```
althea init <node_name> --chain-id althea_417834-4
```

6. **Download genesis.**

```
wget -O $HOME/.althea/config/genesis.json "https://github.com/AltheaFoundation/althea-L1-docs/raw/main/althea-l1-mainnet-genesis.json"
```

7. **Add persistent peers to `config.toml`.**

```
seeds="46ad21a616527181ea3d992339268a5a25c771fa@95.216.38.96:14656"
peers="4d9c73a9e541453b56add8fadf0839fd1442d979@15.235.115.155:17200,a0eca501485cc74e0568973ef502d05023f6500d@158.247.226.255:17200,ab9a9e6ea747839652dfe4480e66a5eb78a385e8@51.81.167.60:17200"
sed -i.bak -e "s/^seeds *=.*/seeds = \"$seeds\"/; s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.althea/config/config.toml
```

8. **Set up minimum gas price.**

```
sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0aalthea\"/;" $HOME/.althea/config/app.toml
```

9. **Set up pruning (optional).**

```
pruning="custom"
pruning_keep_recent="100"
pruning_keep_every="0"
pruning_interval="10"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.althea/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.althea/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.althea/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.althea/config/app.toml
```

10. **Create service file.**

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

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

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

11. **Enable and start service.**

```
systemctl daemon-reload
systemctl enable althea
systemctl restart althea
journalctl -u althea -f -o cat
```

{% hint style="info" %}
If you would like to speed up the sync process, you may try using State Sync.
{% endhint %}


---

# 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.stakeangle.com/mainnets/althea/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.
