# Node Installation

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

* **6 or more physical CPU cores**
* **At least 1TB of SSD disk storage**
* **At least 16GB of memory (RAM)**
* **At least 500mbps network bandwidth**

## Manual Installation

```bash
# Update & install dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq htop tmux chrony liblz4-tool -y

# Install Go
cd $HOME
VER="1.21.13"
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
go version


# Set Vars
MONIKER=<YOUR_MONIKER_NAME_GOES_HERE>
echo "export MONIKER=$MONIKER" >> $HOME/.bash_profile
echo "export ATOMONE_T_CHAIN_ID="atomone-testnet-1"" >> $HOME/.bash_profile
echo "export ATOMONE_T_PORT="54"" >> $HOME/.bash_profile
source $HOME/.bash_profile


# Download Binary
cd $HOME
rm -rf atomone
git clone https://github.com/atomone-hub/atomone.git
cd atomone
git checkout v1.1.2
make install


# Config and Init App
atomoned config node tcp://localhost:${ATOMONE_T_PORT}657
atomoned config chain-id $ATOMONE_T_CHAIN_ID
atomoned config keyring-backend test
atomoned init $MONIKER --chain-id $ATOMONE_T_CHAIN_ID


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


#Configure Seeds and Peers
SEEDS=""
PEERS="5e9aec8259ea078d5e67c4021d815ff71ac86fbc@176.9.19.199:26656,ce191e4f5bbf8a88412b793fbb1e6ff7b0ba1912@134.17.6.22:26657,2231b2285c3ba2f0dec145633d5bc90b8cf782bd@161.97.77.219:26656,94013e2b8be18361f3091287681b63f132475808@218.155.161.169:30355,2a5bdacea9b9c9e107d54313826bae2bd3dc9a62@72.46.84.67:26273,69098dd6fa6ee56970d13c91ce8d8c0f3dee2425@65.109.62.115:36656,0afbd0be817f7d94bf1d3b73c2323f89dafb1b77@94.130.143.184:26656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.atomone/config/config.toml
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.001uatone\"/" $HOME/.atomone/config/app.toml
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.atomone/config/config.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.atomone/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/.atomone/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.atomone/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.atomone/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.atomone/config/app.toml


# Set Custom Port
sed -i.bak -e "s%:1317%:${ATOMONE_T_PORT}317%g;
s%:8080%:${ATOMONE_T_PORT}080%g;
s%:9090%:${ATOMONE_T_PORT}090%g;
s%:9091%:${ATOMONE_T_PORT}091%g;
s%:8545%:${ATOMONE_T_PORT}545%g;
s%:8546%:${ATOMONE_T_PORT}546%g;
s%:6065%:${ATOMONE_T_PORT}065%g" $HOME/.atomone/config/app.toml
sed -i.bak -e "s%:26658%:${ATOMONE_T_PORT}658%g;
s%:26657%:${ATOMONE_T_PORT}657%g;
s%:6060%:${ATOMONE_T_PORT}060%g;
s%:26656%:${ATOMONE_T_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${ATOMONE_T_PORT}656\"%;
s%:26660%:${ATOMONE_T_PORT}660%g" $HOME/.atomone/config/config.toml


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

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

[Install]
WantedBy=multi-user.target
EOF


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

## Auto Installation

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