# Node Installation

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

* **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 SOAR_CHAIN_ID="soarchaintestnet-1"" >> $HOME/.bash_profile
echo "export SOARCHAIN_PORT="37"" >> $HOME/.bash_profile
source $HOME/.bash_profile


# Download Binary
cd $HOME
rm -rf mainnet-rehearsal
git clone https://github.com/soar-robotics/mainnet-rehearsal.git 
cd $HOME/mainnet-rehearsal/binary/ubuntu22.04
tar -xvf soarchaind.tar.gz
chmod +x soarchaind
mv soarchaind $HOME/go/bin/

# Config and Init App
soarchaind config node tcp://localhost:${SOARCHAIN_PORT}657
soarchaind config keyring-backend test
soarchaind config chain-id $SOAR_CHAIN_ID
soarchaind init $MONIKER --chain-id $SOAR_CHAIN_ID


# Add Genesis File and Addrbook
wget -O $HOME/.soarchain/config/genesis.json https://raw.githubusercontent.com/soar-robotics/mainnet-rehearsal/main/network/genesis.json
wget -O $HOME/.soarchain/config/addrbook.json https://testnet-files.syanodes.my.id/soarchain-addrbook.json

#Configure Seeds and Peers
SEEDS=""
PEERS="9d60c08fea34e062f662ec2238e01323f8a55eb9@95.217.150.122:26656,b2fcd16e1dfb5f24b90c1f3151419bd8e5dbb099@131.153.164.17:26656,b12be774f0ae7698d1fdc46680a749c93c89e45b@194.45.36.87:26656,d470dbf348ab7f12326d4e4095502ccc169f9907@66.42.65.92:26656,0810665f8f7aa39ae607835ebfc6418292b8e2ba@77.247.178.83:46656,56c1faecf7218cc773d975128e5c7f786d70d4ed@136.38.55.33:15026,9708c91a018f37b892505eb12f41a9eb7e2773a5@34.141.178.93:26656,bc9244d69f14e73fa9e0c1d80e8a90e276b0ea3d@65.108.233.28:26656,43d612a6b71148f42543a1056ac9a1af7ab2b021@85.237.193.116:26656,ae60b8ae5383500854e74a37e657eaa03bc82452@160.202.128.199:56226"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.soarchain/config/config.toml
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0001utsoar\"/" $HOME/.soarchain/config/app.toml
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.soarchain/config/config.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.soarchain/config/config.toml


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


# Set Custom Port
sed -i.bak -e "s%:1317%:${SOARCHAIN_PORT}317%g;
s%:8080%:${SOARCHAIN_PORT}080%g;
s%:9090%:${SOARCHAIN_PORT}090%g;
s%:9091%:${SOARCHAIN_PORT}091%g;
s%:8545%:${SOARCHAIN_PORT}545%g;
s%:8546%:${SOARCHAIN_PORT}546%g;
s%:6065%:${SOARCHAIN_PORT}065%g" $HOME/.soarchain/config/app.toml
sed -i.bak -e "s%:26658%:${SOARCHAIN_PORT}658%g;
s%:26657%:${SOARCHAIN_PORT}657%g;
s%:6060%:${SOARCHAIN_PORT}060%g;
s%:26656%:${SOARCHAIN_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${SOARCHAIN_PORT}656\"%;
s%:26660%:${SOARCHAIN_PORT}660%g" $HOME/.soarchain/config/config.toml
sed -i \
  -e 's|^chain-id *=.*|chain-id = "soarchaintestnet-1"|' \
  -e 's|^keyring-backend *=.*|keyring-backend = "test"|' \
  -e 's|^node *=.*|node = "tcp://localhost:37657"|' \
  $HOME/.soarchain/config/client.toml


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

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

[Install]
WantedBy=multi-user.target
EOF


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

## Auto Installation

```bash
wget https://snapshot.syanodes.my.id/auto/testnet/soarchain_auto && chmod +x soarchain_auto && ./soarchain_auto 
```
