# Installation (Validator)

## ***Automatic Installation***

```bash
source <(curl -s https://raw.githubusercontent.com/NodersUA/Scripts/main/avail)
```

## ***Manual Installation***

```bash
# Update, upgrade and install requirements
sudo apt-get update && \
sudo apt-get upgrade -y
# Update or install rust
if command -v rustup &> /dev/null; then
    rustup update
else
    curl https://sh.rustup.rs -sSf | sh
    source $HOME/.cargo/env
fi
rustc --version
sudo apt-get install build-essential cmake clang pkg-config libssl-dev protobuf-compiler git-lfs g++ -y && \
cargo install sccache
```

```bash
cd $HOME
git clone https://github.com/availproject/avail
cd avail/
git checkout v1.8.0.4
cargo build --release -p data-avail
cp target/release/data-avail /usr/local/bin/avail
avail --version
```

```bash
# Open ports
ufw allow 45333
ufw allow 9944
```

```bash
# Enter your moniker
MONIKER=<your_moniker>
```

```bash
sudo bash -c "cat > /etc/systemd/system/availd.service" <<EOF
[Unit]
Description=Avail Validator
After=network.target
StartLimitIntervalSec=0

[Service]
User=$USER
Type=simple
Restart=always
RestartSec=120
ExecStart=$(which avail) \
  --base-path $HOME/.avail/data/ \
  --node-key-file "$HOME/.avail/node-key" \
  --port 45333 \
  --rpc-port 9945 \
  --chain goldberg \
  --validator \
  --name $MONIKER \
  --telemetry-url 'ws://telemetry.avail.tools:8001/submit/ 0'

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

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

Check your node in [telemetry](https://telemetry.avail.tools/#list/0x6f09966420b2608d1947ccfb0f2a362450d1fc7fd902c29b67c906eaa965a7ae)

<figure><img src="https://4087347316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Iou0VSI3wEaJMZZ5MDk%2Fuploads%2FrGvWNWezabDMPu55kh7z%2Fimage.png?alt=media&#x26;token=9c17df66-5080-49c7-889b-6f1fa7918bf3" alt=""><figcaption></figcaption></figure>

## Validator

* Create [polkadot.js](https://goldberg.avail.tools/#/accounts) account
* Join to [discord](https://discord.gg/6Uy9jK8r)&#x20;
* Go to [#goldberg-faucet](https://discord.com/channels/1065831819154563132/1171414018028740698) channel and send message with your address (5Cyi4FQ........) for request tokens

```bash
/deposit <address>
```

* Go to **Network - Staking - Accounts** and add stash<br>

  <figure><img src="https://4087347316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Iou0VSI3wEaJMZZ5MDk%2Fuploads%2Fiy2wZIXZD1kOfgCB7RRm%2Fimage.png?alt=media&#x26;token=588859e2-1fee-4686-9fb3-2ef6c676638e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4087347316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Iou0VSI3wEaJMZZ5MDk%2Fuploads%2FKu2GGihJ5azbhmWSjwQ7%2Fimage.png?alt=media&#x26;token=f9307f55-3d48-45ab-ab19-c592fbccb094" alt=""><figcaption></figcaption></figure>

* Connect your stash account with your node<br>

  <figure><img src="https://4087347316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Iou0VSI3wEaJMZZ5MDk%2Fuploads%2FWzmCJWr3qxYfGBKszjnf%2Fimage.png?alt=media&#x26;token=904cb3f9-9bdb-4173-b7cb-189eaf4f67a2" alt=""><figcaption></figcaption></figure>

```bash
# Check your session-key
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:9945
```

Paste key from terminal to browser

<figure><img src="https://4087347316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Iou0VSI3wEaJMZZ5MDk%2Fuploads%2FjR7KTeRjI7QVzAtMF1a6%2Fimage.png?alt=media&#x26;token=295cf7f5-68d7-4fcb-819e-91ff58607c3b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4087347316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Iou0VSI3wEaJMZZ5MDk%2Fuploads%2FhlkYgQnZEgRJljgsVIvV%2Fimage.png?alt=media&#x26;token=84f13344-eb0a-4eea-9f21-b17005bbbea4" alt=""><figcaption></figcaption></figure>

Submit google [form](https://docs.google.com/forms/d/e/1FAIpQLScvgXjSUmwPpUxf1s-MR2C2o5V79TSoud1dLPKVgeLiLFuyGQ/viewform) and wait for the letter
