# Aligned Layer

Website: <https://alignedlayer.com/>

Twitter: <https://twitter.com/alignedlayer>

Explorer: <https://explorer.nodesync.top/Alignedlayer-Testnet/staking>

<mark style="color:red;">**Faucet:**</mark> <https://faucet.alignedlayer.com/>

## **1. Minimum hardware requirement**

4 Cores, 16G Ram,  160G SSD, <mark style="color:red;">**Ubuntu 22.04**</mark>

## 2. Auto Install

**Use snapshot:**

```
sudo apt install curl -y && wget https://nodesync.top/alignedlayer_auto && chmod +x alignedlayer_auto && ./alignedlayer_auto
```

### 2.1 Wallet

Add New Wallet Key - <mark style="color:red;">**Save seed**</mark>

```
alignedlayerd keys add wallet
```

Recover existing key

```
alignedlayerd keys add wallet --recover
```

List All Keys

```
alignedlayerd keys list
```

### 2.2 Query Wallet Balance

```
alignedlayerd q bank balances $(alignedlayerd keys show wallet -a)
```

### 2.3 Check sync status

<mark style="color:red;">**False is synced**</mark>

```
alignedlayerd status 2>&1 | jq .sync_info
```

### 2.4 Create Validator

**Obtain your validator public key by running the following command:**

```
alignedlayerd comet show-validator
```

**The output will be similar to this (with a different key):**

{"@type":"/cosmos.crypto.ed25519.PubKey","key":"lR1d7YBVK5jYijOfWVKRFoWCsS4dg3kagT7LB9GnG8I="}

**Then, create a file named** `validator.json` **with the following content:**

```
nano $HOME/validator.json
```

Change your info, from "pubkey" to "details"  and Save them

```
{    
    "pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"lR1d7YBVK5jYijOfWVKRFoWCsS4dg3kagT7LB9GnG8I="},
    "amount": "1000000stake",
    "moniker": "your-node-moniker",
    "identity": "eqlab testnet validator",
    "website": "optional website for your validator",
    "security": "optional security contact for your validator",
    "details": "optional details for your validator",
    "commission-rate": "0.1",
    "commission-max-rate": "0.2",
    "commission-max-change-rate": "0.01",
    "min-self-delegation": "1"
}
```

**Finally, we're ready to submit the transaction to create the validator:**

```
alignedlayerd tx staking create-validator $HOME/validator.json \
--from wallet --chain-id alignedlayer \
--fees 50stake
```

### 2.5 Delegate Token to your own validator

```
alignedlayerd tx staking delegate $(alignedlayerd keys show wallet --bech val -a)  1000000stake \
--from wallet --chain-id alignedlayer \
--fees 50stake
```

### 2.6 Withdraw rewards and commission from your validator

```
alignedlayerd tx distribution withdraw-rewards $(alignedlayerd keys show wallet --bech val -a) \
--from wallet --chain-id alignedlayer \
--fees 50stake
```

### 2.7 Unjail validator

<pre><code><strong>alignedlayerd tx slashing unjail --from wallet --chain-id alignedlayer --fees=50stake -y
</strong></code></pre>

### 2.8 Services Management

```
# Reload Service
sudo systemctl daemon-reload

# Enable Service
sudo systemctl enable alignedlayerd

# Disable Service
sudo systemctl disable alignedlayerd

# Start Service
sudo systemctl start alignedlayerd

# Stop Service
sudo systemctl stop alignedlayerd

# Restart Service
sudo systemctl restart alignedlayerd

# Check Service Status
sudo systemctl status alignedlayerd

# Check Service Logs
sudo journalctl -u alignedlayerd -f --no-hostname -o cat
```

## 3. Backup Validator

<mark style="color:red;">**Important**</mark>

```
cat $HOME/.alignedlayer/config/priv_validator_key.json
```

## 4. Remove node

```
cd $HOME
sudo systemctl stop alignedlayerd
sudo systemctl disable alignedlayerd
sudo rm /etc/systemd/system/alignedlayerd.service
sudo systemctl daemon-reload
sudo rm -f /usr/local/bin/alignedlayerd
sudo rm -f $(which alignedlayerd)
sudo rm -rf $HOME/.alignedlayer
sudo rm -rf alignedlayer_auto
sudo rm -rf $HOME/aligned_layer_tendermint

```

## 5. Change Port

**You can change&#x20;**<mark style="color:red;">**16**</mark>**&#x20;number is random port**

```
port=16
echo "export $port" >> $HOME/.bash_profile
alignedlayerd config set config rpc.laddr "tcp://0.0.0.0:${port}657" --skip-validate
sed -i.bak -e "s%:1317%:${port}317%g; s%:8080%:${port}080%g; s%:9090%:${port}090%g; s%:9091%:${port}091%g; s%:8545%:${port}545%g; s%:8546%:${port}546%g; s%:6065%:${port}065%g" $HOME/.alignedlayer/config/app.toml
sed -i.bak -e "s%:26658%:${port}658%g; s%:26657%:${port}657%g; s%:6060%:${port}060%g; s%:26656%:${port}656%g; s%:26660%:${port}660%g" $HOME/.alignedlayer/config/config.toml
sed -i.bak -e "s%:26657%:${port}657%g" $HOME/.alignedlayer/config/client.toml
sudo systemctl daemon-reload
sudo systemctl restart alignedlayerd && sudo journalctl -u alignedlayerd -f --no-hostname -o cat
```


---

# 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.nodesync.top/cosmos-testnet/aligned-layer.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.
