# Node Installation

## [TELEMETRY](https://telemetry.avail.so/#list/0xb91746b45e0346cc2f815a520b9c6cb4d5c0902af848db0a80f85932d2e8276a)

* **Minimum hardware requirements**:

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

#### 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 28.07.25

```bash
cd $HOME
mkdir -p $HOME/.avail_mainnet && cd $HOME/.avail_mainnet
chmod 755 $HOME/.avail_mainnet
wget https://github.com/availproject/avail/releases/download/v2.3.2.0/x86_64-ubuntu-2204-avail-node.tar.gz
tar -xvf x86_64-ubuntu-2204-avail-node.tar.gz
mv avail-node /usr/bin/avail
rm -rf x86_64-ubuntu-2204-avail-node.tar.gz
```

`avail --version`

* avail 2.3.2-5b22f419256

## Create a service file

```
yourname=<name>
```

```bash
tee /etc/systemd/system/avail.service > /dev/null << EOF
[Unit]
Description=Avail mainnet
After=network-online.target
StartLimitIntervalSec=0
[Service]
User=$USER
Restart=always
RestartSec=3
LimitNOFILE=65535
ExecStart=/usr/bin/avail \
  --base-path $HOME/.avail_mainnet/data/ \
  --chain mainnet \
  --port 40333 \
  --rpc-port 8933\
  --prometheus-port 9615 \
  --validator \
  --name '$yourname'
[Install]
WantedBy=multi-user.target
EOF
```

### Start

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

* After launch, we wait for our node to synchronize. You can track our condition using telemetry

## [TELEMETRY](https://telemetry.avail.so/#list/0xb91746b45e0346cc2f815a520b9c6cb4d5c0902af848db0a80f85932d2e8276a)

* After the node has synchronized, we pull out the key from our node by entering the command

```python
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:8933
```

### Creating a validator

* Go to the [website](https://explorer.avail.so/#/accounts) and first create a wallet
* We create a validator. To do this, select `Network - Staking - Accounts - Validator`

## SnapShot Mainnet - updated every 12 hours <a href="#snapshot-mainnet-updated-every-5-hours" id="snapshot-mainnet-updated-every-5-hours"></a>

{% hint style="success" %}
<https://server-5.stavr.tech/Mainnet/Avail>
{% endhint %}

```bash
cd $HOME
apt install lz4
sudo systemctl stop avail
rm -r $HOME/.avail_mainnet/data/chains/avail_da_mainnet/paritydb/
curl -o - -L https://server-5.stavr.tech/Mainnet/Avail/avail-snap-1.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.avail_mainnet/data/chains/avail_da_mainnet/
systemctl restart avail && journalctl -fu avail -n100 -o cat
```

## [🧩Services and Tools🧩](https://stavr-team.gitbook.io/nodes-guides/mainnets/avail/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)

`logs`

```python
journalctl -fu avail -n100 -o cat
```

`restart`

```
systemctl restart avail && journalctl -fu avail -n100 -o cat
```

`delete node`

```bash
systemctl stop avail
systemctl disable avail
rm /etc/systemd/system/avail.service
systemctl daemon-reload
cd && rm -rf .avail_mainnet
```
