# Node Installation

### Hardware requirements The following requirements are recommended for running ALIGNEDLAYER:

* **4 or more physical CPU cores**
* **At least 1TB of SSD disk storage**
* **At least 8GB of memory (RAM)**
* **At least 100mbps network bandwidth**

## Manual Installation

```bash
# Update & install dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install clang pkg-config libssl-dev curl git wget htop tmux build-essential jq make lz4 gcc unzip -y


# Install Go
cd $HOME
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.21.4.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
eval $(echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh)
eval $(echo 'export PATH=$PATH:$HOME/go/bin' | tee -a $HOME/.profile)
go version


# Set Vars
MONIKER=<YOUR_MONIKER_NAME_GOES_HERE>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export ALIGNEDLAYER_CHAIN_ID="alignedlayer"" >> $HOME/.bash_profile
echo "export ALIGNEDLAYER_PORT="35"" >> $HOME/.bash_profile
source $HOME/.bash_profile


# Download Binary
cd $HOME
rm -rf $HOME/aligned_layer_tendermint && wget https://github.com/yetanotherco/aligned_layer_tendermint/releases/download/v0.1.0/alignedlayerd && chmod +x alignedlayerd
mv $HOME/alignedlayerd $HOME/go/bin
alignedlayerd version

# Config and Init App
alignedlayerd init $MONIKER --chain-id $ALIGNEDLAYER_CHAIN_ID


# Add Genesis File and Addrbook
wget -O $HOME/.alignedlayer/config/genesis.json https://testnet-files.syanodes.my.id/alignedlayer-genesis.json
wget -O $HOME/.alignedlayer/config/addrbook.json https://testnet-files.syanodes.my.id/alignedlayer-addrbook.json

#Configure Seeds and Peers
SEEDS=""
PEERS="9f7c7a0acd6aa8e2d6b77ddad506fb1c6b9edc5f@37.27.20.41:26656,dc2011a64fc5f888a3e575f84ecb680194307b56@148.251.235.130:20656,a1a98d9caf27c3363fab07a8e57ee0927d8c7eec@128.140.3.188:26656,1beca410dba8907a61552554b242b4200788201c@91.107.239.79:26656,f9000461b5f535f0c13a543898cc7ac1cd10f945@88.99.174.203:26656, 32fbefec592ac2ff9ecb3cad69bafaaad01e771a@148.251.235.130:20656,81138177a67195791bbe782fe1ed49f25e582bac@91.107.239.79:26656,c5d0498e345725365c1016795eecff4a67e4c4c9@88.99.174.203:26656,14af04afc663427604e8dd53f4023f7963a255cb@116.203.81.174:26656,9c89e77d51561c8b23957eee85a81ccc99fa7d6b@128.140.3.188:26656,144c2d4fbbaf54dda837bfbc88b688fb2f02c92f@alignedlayer-testnet-peer.itrocket.net:50656,2567ea5aed4bba4e3062a1072a8f1e7fb4e4497c@65.109.85.36:26656,ee72ae2006b86e409ab014e9cc5f26b52c6aa72d@5.189.144.242:26656,f3edb2d04e4dfcfe04918c92108a96bb7c077750@167.86.97.83:26656,af9ea4de452555c82fa31c1057b3f622d361f4cc@86.48.17.209:24256,4aadf13668b6fcb33f0e5b4a6e5bc267712c7dac@64.226.93.215:26656,7292de855372480ae23dbcaf94d36ead187cf6a8@194.163.143.206:50656,98247c9db728d28e095629e5786679630d8348f8@20.172.44.251:5456,afeea4cd47aa80504adbdaa8aa019864e291de55@[2a03:cfc0:8000:13::b910:277f]:13356,8509d4935357ae5dde2f172160dcf2cd10ef29a0@84.247.170.45:24256,dff0ad7bb3aa28f393b3281853353b53f32a2ef7@65.21.109.243:26656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.alignedlayer/config/config.toml
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0stake\"/" $HOME/.alignedlayer/config/app.toml
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.alignedlayer/config/config.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.alignedlayer/config/config.toml


# Config Pruning
pruning="custom"
pruning_keep_recent="100"
pruning_keep_every="0"
pruning_interval="19"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.alignedlayer/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.alignedlayer/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.alignedlayer/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.alignedlayer/config/app.toml


# Set Custom Port
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${ALIGNEDLAYER_PORT}658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${ALIGNEDLAYER_PORT}657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${ALIGNEDLAYER_PORT}060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${ALIGNEDLAYER_PORT}656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${ALIGNEDLAYER_PORT}660\"%" $HOME/.alignedlayer/config/config.toml
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${ALIGNEDLAYER_PORT}317\"%; s%^address = \":8080\"%address = \":${ALIGNEDLAYER_PORT}080\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${ALIGNEDLAYER_PORT}090\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${ALIGNEDLAYER_PORT}091\"%" $HOME/.alignedlayer/config/app.toml
sed -i \
  -e 's|^chain-id *=.*|chain-id = "alignedlayer"|' \
  -e 's|^keyring-backend *=.*|keyring-backend = "test"|' \
  -e 's|^node *=.*|node = "tcp://localhost:35657"|' \
  $HOME/.alignedlayer/config/client.toml


# Set Service File
sudo tee /etc/systemd/system/alignedlayerd.service > /dev/null <<EOF
[Unit]
Description=hedge-testnet
After=network-online.target

[Service]
User=$USER
ExecStart=$(which alignedlayerd) start --home $HOME/.alignedlayer
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF


# Enable and Start Service
sudo systemctl daemon-reload
sudo systemctl enable alignedlayerd
sudo systemctl start alignedlayerd
sudo journalctl -fu alignedlayerd -o cat
```
