# ⚙️  Installation

Recommended Hardware:

<table><thead><tr><th>Node Type</th><th width="184">CPU</th><th>RAM</th><th>Storage</th></tr></thead><tbody><tr><td>Mainnet</td><td>6</td><td>16GB</td><td>400GB </td></tr></tbody></table>

&#x20;***Install dependencies***

<pre class="language-bash"><code class="lang-bash"># Update the repositories
<strong>sudo apt update &#x26;&#x26; apt upgrade -y
</strong></code></pre>

```bash
# Install developer packages
sudo apt install -y curl git jq lz4 build-essential
```

```bash
# Install Go
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go1.23.5.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)
echo "export PATH=$PATH:/usr/local/go/bin:/usr/local/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version
```

## ***Automatic Installation***

```bash
source <(curl -s https://raw.githubusercontent.com/validexisinfra/Story/main/install_testnet.sh)
```

## ***Manual Installation***

```bash
# Come up with the name of your node and replace it instead <your_moniker>
MONIKER=<your_moniker>
```

```bash
# Download binary files
cd $HOME
rm -rf story-geth
git clone https://github.com/piplabs/story-geth.git
cd story-geth
git checkout v1.2.0
make geth
mv build/bin/geth  $HOME/go/bin/

# install Story
cd $HOME
rm -rf story
git clone https://github.com/piplabs/story
cd story
git checkout v1.4.2
go build -o story ./client 
mkdir -p $HOME/go/bin/
mv $HOME/story/story $HOME/go/bin/
```

```bash
# Initialize the node
story init $MONIKER --network aeneid
```

***Setup config***

```bash
# set seeds and peers
SEEDS="dfb96be7e47cd76762c1dd45a5f76e536be47faa@story-testnet-seed.validexis.com:36656"
PEERS="5713c7da1e80c938643ea4aa99957bb0aadde9c1@story-testnet-peer.validexis.com:36656,bbdc5d760daa758d294f6305d5df4e9560762ca1@188.40.102.137:55656,5812d193191d98dbd732f6266192aa401c839a16@65.21.88.99:14656,2d0585ca77f128723f80f70d1c2c3f71e2e02372@65.21.130.42:26656,4240c286741a402f9bd3dede9144c41de6c1079a@142.132.209.236:29256,1851180d526f7a4cfc5e391263869ba9d24bb8e7@35.207.39.228:26656,6734c7da1e80c938643ea4aa99957bb0aadde9c1@65.108.128.251:2656,84f26098dc3736c501de372c85bb8794a1bd50e5@65.109.69.188:26656,72f98a2835bc5094522fc117af6830d678c0e562@35.211.62.101:26656,cfa96be7e47cd76762c1dd45a5f76e536be47faa@65.108.45.34:32655,9d34ab3819aa8baa75589f99138318acfa0045f5@95.217.119.251:30900"
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*seeds *=.*/seeds = \"$SEEDS\"/}" \
       -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.story/story/config/config.toml

# enable prometheus and disable indexing
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.story/story/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.story/story/config/config.toml

```

#### ***Set custom ports***

You can change value STORY\_PORT=36 To any other ports

```bash
STORY_PORT=36
```

```bash
# set custom ports in story.toml file
sed -i.bak -e "s%:1317%:${STORY_PORT}317%g;
s%:8551%:${STORY_PORT}551%g" $HOME/.story/story/config/story.toml
```

```bash
# set custom ports in config.toml file
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
```

```bash
# create 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 --aeneid --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
```

```shellscript
# create story service file
sudo tee /etc/systemd/system/story.service > /dev/null <<EOF
[Unit]
Description=Story Service
After=network.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
```

```bash
# download snapshots
# backup priv_validator_state.json
cp $HOME/.story/story/data/priv_validator_state.json $HOME/.story/story/priv_validator_state.json.backup

# remove old data and unpack Story snapshot
rm -rf $HOME/.story/story/data
curl https://snapshots1.validexis.com/story-testnet/snap_story.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.story/story

# restore priv_validator_state.json
mv $HOME/.story/story/priv_validator_state.json.backup $HOME/.story/story/data/priv_validator_state.json

# delete geth data and unpack Geth snapshot
rm -rf $HOME/.story/geth/aeneid/geth/chaindata
mkdir -p $HOME/.story/geth/aeneid/geth
curl https://snapshots1.validexis.com/story-testnet/geth_story_snap.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.story/geth/aeneid/geth

```

```bash
# enable and start geth, story
sudo systemctl daemon-reload
sudo systemctl enable story story-geth
sudo systemctl restart story-geth && sleep 5 && sudo systemctl restart story
```

```bash
# check logs
journalctl -u story -u story-geth -f
```

### *Create validator* <a href="#create-validator" id="create-validator"></a>

View your validator key

```bash
story validator export
```

Export EVM private key

```bash
story validator export --export-evm-key
```

View EVM private key and make a key backup

```bash
cat $HOME/.story/story/config/private_key.txt
```

{% hint style="info" %}

#### Before creating a validator, wait for your node to get fully synced. Once "catching\_up" is "false", move on to the next step

{% endhint %}

```bash
curl localhost:$(sed -n '/\[rpc\]/,/laddr/ { /laddr/ {s/.*://; s/".*//; p} }' $HOME/.story/story/config/config.toml)/status | jq
```

#### *Create validator, locked*

```bash
story validator create --stake 1024000000000000000000 --moniker $MONIKER --chain-id 1315 --unlocked=false
```

#### *Create validator, unlocked*

```bash
story validator create --stake 1024000000000000000000 --moniker $MONIKER --chain-id 1315 --unlocked=true
```

Remember to backup your validator priv\_key from here:

```bash
cat $HOME/.story/story/config/priv_validator_key.json
```
