# Node Installation

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

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

# Install Go
cd $HOME
VER="1.22.3"
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 STORY_CHAIN_ID="odyssey"" >> $HOME/.bash_profile
echo "export STORY_PORT="52"" >> $HOME/.bash_profile
source $HOME/.bash_profile


# Download Binary
cd $HOME
wget -O geth https://github.com/piplabs/story-geth/releases/download/v0.10.0/geth-linux-amd64
chmod +x $HOME/geth
mv $HOME/geth ~/go/bin/
[ ! -d "$HOME/.story/story" ] && mkdir -p "$HOME/.story/story"
[ ! -d "$HOME/.story/geth" ] && mkdir -p "$HOME/.story/geth"


# install Story
cd $HOME
rm -rf story
git clone https://github.com/piplabs/story
cd story
git checkout v0.12.1
go build -o story ./client 
mv $HOME/story/story $HOME/go/bin/


# Config and Init App
story init --moniker $MONIKER --network $STORY_CHAIN_ID


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


#Configure Seeds and Peers
SEEDS=""
PEERS="02e9fac0fab468724db00e5e3328b2cbca258fdc@95.217.193.182:26656,75ac7b193e93e928d6c83c273397517cb60603c0@3.142.16.95:26656,5c001659b68370e7198e9c6c72bfc4c3c15dba41@211.218.55.32:50656,e1245ea24138ff16ca144962f72146d6afcbfe15@221.148.45.118:26656,29d7d1d203ccf8c9afe593eab7bee485f1e6bbfa@37.252.186.234:26656,bf975933a1169221e3bd04164a7ba9abc5d164c8@3.16.175.31:26656,04e5734295da362f09a61dd0a9999449448a0e5c@52.14.39.177:26656,046909534c2849ff8dccc15ee43ee63d2c60b21c@54.190.123.194:26656,9e2fabda41e3c3317c25f5ef6c604c1d78370aba@50.112.252.101:26656,7cc415203fc4c1a6e534e5fed8292467cf14d291@65.21.29.250:3610,ab3ea2b0628e45fbff219519ad34b26ec1bf0704@157.173.121.3:656,bd58bf29180f476bd250af22d6026559d7eff289@146.59.118.198:26656,0ae60326fa7f01500a94dd7f0d2571fbba46cd10@167.235.39.5:17656,dfcc85577f77f3c312fd6e803be84b09919ead59@157.173.204.15:26656,8b241f57d1375205aa4a17d038f9825a516ccbc5@88.99.252.213:36656,ed27db8cbb711f8d3e7f204e39405f8b19531889@46.4.52.158:26656,39ef8bba040a71d6914359ba0f6f8490f7716c35@45.61.156.53:26656,73aafbaefe85e64a3eb0c6e23b3935bc308d77db@142.132.135.125:20656,a8a2e0e0d5875741419a8c5a73b41ba265e1e895@37.27.69.177:26656,8ff41ff3354241f608ba15ccd224ff6fb7393dd7@135.181.60.149:26656,fa294c4091379f84d0fc4a27e6163c956fc08e73@65.108.103.184:26656,356847ca14f13b9b38d13bfaf7751ae74cc2919b@65.21.210.147:26656,443896c7ec4c695234467da5e503c78fcd75c18e@80.241.215.215:26656,7f811d3160086e1cdfe1ea01823f7b90df98a7ab@37.60.234.139:656,f5746b45e50f5b8ee4dd87c216e66c6ea4ba1e05@95.217.74.22:26656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.story/story/config/config.toml
sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/.story/story/config/config.toml
sed -i 's|^prometheus *=.*|prometheus = true|' $HOME/.story/story/config/config.toml


# Set Custom Port
sed -i.bak -e "s%:1317%:${STORY_PORT}317%g;
s%:8551%:${STORY_PORT}551%g" $HOME/.story/story/config/story.toml
sed -i.bak -e "s%:26658%:${STORY_PORT}658%g;
s%:26657%:${STORY_PORT}657%g;
s%:26656%:${STORY_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${STORY_PORT}656\"%;
s%:26660%:${STORY_PORT}660%g" $HOME/.story/story/config/config.toml


# Set Geth Servie File
sudo tee /etc/systemd/system/story-geth.service > /dev/null <<EOF
[Unit]
Description=story-geth-daemon
After=network-online.target

[Service]
User=$USER
ExecStart=$HOME/go/bin/geth --odyssey --syncmode full --http --http.api eth,net,web3,engine --http.vhosts '*' --http.addr 0.0.0.0 --http.port ${STORY_PORT}545 --authrpc.port ${STORY_PORT}551 --ws --ws.api eth,web3,net,txpool --ws.addr 0.0.0.0 --ws.port ${STORY_PORT}546
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

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

[Service]
User=$USER
WorkingDirectory=$HOME/.story/story
ExecStart=$(which story) run

Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF


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

## Auto Installation

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