> For the complete documentation index, see [llms.txt](https://nodersua.gitbook.io/about-nodersua/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nodersua.gitbook.io/about-nodersua/archive/tangle/installation.md).

# Installation

## ***Automatic Installation***

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

## ***Manual Installation***

```bash
# Update the repositories
apt update && apt upgrade -y
apt install curl iptables build-essential git wget jq make gcc nano tmux htop nvme-cli pkg-config libssl-dev libleveldb-dev libgmp3-dev tar clang bsdmainutils ncdu unzip llvm libudev-dev make protobuf-compiler -y
```

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

```bash
cd $HOME
git clone https://github.com/webb-tools/tangle.git
cd tangle/
git checkout v0.6.1
cargo build --release
cp target/release/tangle /usr/local/bin/
tangle --version
```

```bash
# Open ports
ufw allow 43333
ufw allow 9943
```

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

```bash
sudo tee /etc/systemd/system/tangle.service > /dev/null << EOF
[Unit]
Description=Tangle Validator Node
After=network-online.target
StartLimitIntervalSec=0
 
[Service]
User=$USER
Restart=always
RestartSec=3
ExecStart=/usr/local/bin/tangle \
  --base-path $HOME/.tangle/data/ \
  --name $MONIKER \
  --chain tangle-testnet \
  --node-key-file "$HOME/.tangle/node-key" \
  --port 43333 \
  --rpc-port 9943 \
  --validator \
  --no-mdns \
  --auto-insert-keys \
  --rpc-cors all \
  --pruning archive \
  --telemetry-url "wss://telemetry.polkadot.io/submit/ 0"
 
[Install]
WantedBy=multi-user.target
EOF
```

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

Check your node in [telemetry](https://telemetry.polkadot.io/#list/0x3d22af97d919611e03bbcbda96f65988758865423e89b2d99547a6bb61452db3)

<figure><img src="https://4087347316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Iou0VSI3wEaJMZZ5MDk%2Fuploads%2F6oFQgVHqLMKbNBWQQVo1%2Fimage.png?alt=media&amp;token=1b6d57c0-3a0f-47df-b853-836a9c5ce03b" alt=""><figcaption></figcaption></figure>

## Validator

1. Create [polkadot.js](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Ftestnet-rpc.tangle.tools#/accounts) account or connect your subwallet
2. Set on-chain identity<br>

   <figure><img src="https://4087347316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Iou0VSI3wEaJMZZ5MDk%2Fuploads%2Fv0l9vdEFQhHrsTwAQ52p%2Fimage.png?alt=media&amp;token=5c743416-6472-4d8c-b76e-27f33dfcee65" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://4087347316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Iou0VSI3wEaJMZZ5MDk%2Fuploads%2FSCHcD8cMg98tulSGaLpm%2Fimage.png?alt=media&amp;token=0cc99064-1e40-4d24-a7b2-2627a55d8d40" alt=""><figcaption></figcaption></figure>
3. Join to [discord](https://discord.com/invite/cv8EfJu3Tn)&#x20;
4. Go to [#](https://discord.com/channels/833784453251596298/1106624706813112351)[-faucet](https://discord.com/channels/833784453251596298/1183826417625075753) channel and send message with your address (!send 5FejFZ55......) for request tokens<br>

   <figure><img src="https://4087347316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Iou0VSI3wEaJMZZ5MDk%2Fuploads%2FzxiEfGGk9Mx5lthlahyy%2Fimage.png?alt=media&amp;token=42ae780c-e7d5-4756-b184-83407dc20b12" alt=""><figcaption></figcaption></figure>

* 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%2FMP6cOk8IEbf6qdvamkWV%2Fimage.png?alt=media&amp;token=3a8949b2-c171-4286-9f45-7cefdfc275d5" 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%2FO4P6lwNZ1MRHAjMS28rb%2Fimage.png?alt=media&amp;token=030cb679-cec0-4688-8144-14ebd09fd952" 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:9943
```

Paste key from terminal to browser

* Active validator<br>

  <figure><img src="https://4087347316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Iou0VSI3wEaJMZZ5MDk%2Fuploads%2FFXVpYwPQeYX3YLuxVFC6%2Fimage.png?alt=media&amp;token=373a8e5c-c429-469a-b750-027fbdb64cd5" alt=""><figcaption></figcaption></figure>
* Check your validator<br>

  <figure><img src="https://4087347316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7Iou0VSI3wEaJMZZ5MDk%2Fuploads%2FnT4V3dpZrXJbwlzoDMIg%2Fimage.png?alt=media&amp;token=cfc08ab7-a499-4f29-acee-057a48bc14b7" alt=""><figcaption></figcaption></figure>
