# Node Installation

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

* **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


# Set Firewall
sudo apt install -y ufw
sudo ufw default allow outgoing
sudo ufw default deny incoming
sudo ufw allow ssh


# 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 BABYLOND_CHAIN_ID="bbn-test-2"" >> $HOME/.bash_profile
echo "export BABYLOND_PORT="15"" >> $HOME/.bash_profile
source $HOME/.bash_profile


# Download Binary
cd $HOME
rm -rf babylon
git clone https://github.com/babylonchain/babylon.git
cd babylon
git checkout v0.7.2
make install


# Config and Init App
babylond config node tcp://localhost:${BABYLOND_PORT}657
babylond config keyring-backend test
babylond config chain-id $BABYLOND_CHAIN_ID
babylond init $MONIKER --chain-id $BABYLOND_CHAIN_ID


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


#Configure Seeds and Peers
SEEDS=""
PEERS="603f5e1d2b796e125265b975135e1780e080e8fd@138.201.204.5:37656,07d1b69e4dc56d46dabe8f5eb277fcde0c6c9d1e@23.88.5.169:17656,0a0d7d245ea67cfeec7d000085260fbe695544f4@207.180.251.220:11656,924632d809935a2ba6035df0dd3a787dde7b788c@144.76.201.43:26356,1016bb6d890ffafe49eb8b2264937bdbcd775135@46.4.5.45:20656,4c4a3cffbbad5e12c2f4d1ee85f6a94eb271ae21@65.109.90.171:32656,d5519e378247dfb61dfe90652d1fe3e2b3005a5b@65.109.68.190:16456,37896797924b1cb18bce9b9542ba3da915a85038@18.218.71.198:26656,ec92965f98006978a470642a9e02f971fb4a70c6@18.119.146.153:26656,0de44b3d4380004838d38797a1aee10392b68420@3.18.176.128:26656,"
sed -i.bak -e "s/^seed *=.*/seed = \"$seed\"/" ~/.artelad/config/config.toml
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" ~/.babylond/config/config.toml
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0ubbn\"/" $HOME/.babylond/config/app.toml
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.babylond/config/config.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.babylond/config/config.toml


# Set Custom Port
sed -i.bak -e "s%^proxy_app = \"tcp://127.0.0.1:26658\"%proxy_app = \"tcp://127.0.0.1:${BABYLOND_PORT}658\"%; s%^laddr = \"tcp://127.0.0.1:26657\"%laddr = \"tcp://127.0.0.1:${BABYLOND_PORT}657\"%; s%^pprof_laddr = \"localhost:6060\"%pprof_laddr = \"localhost:${BABYLOND_PORT}060\"%; s%^laddr = \"tcp://0.0.0.0:26656\"%laddr = \"tcp://0.0.0.0:${BABYLOND_PORT}656\"%; s%^prometheus_listen_addr = \":26660\"%prometheus_listen_addr = \":${BABYLOND_PORT}660\"%" $HOME/.babylond/config/config.toml
sed -i.bak -e "s%^address = \"tcp://0.0.0.0:1317\"%address = \"tcp://0.0.0.0:${BABYLOND_PORT}317\"%; s%^address = \":8080\"%address = \":${BABYLOND_PORT}080\"%; s%^address = \"0.0.0.0:9090\"%address = \"0.0.0.0:${BABYLOND_PORT}090\"%; s%^address = \"0.0.0.0:9091\"%address = \"0.0.0.0:${BABYLOND_PORT}091\"%" $HOME/.babylond/config/app.toml


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

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

[Install]
WantedBy=multi-user.target
EOF


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