# ⚙️  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>8</td><td>32GB</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.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
wget -O story-geth https://github.com/piplabs/story-geth/releases/download/v1.2.0/geth-linux-amd64
chmod +x story-geth
mv story-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 
mv $HOME/story/story $HOME/go/bin/
```

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

***Setup config***

```bash
# set seeds and peers
SEEDS="249de5c0085eb175da6ad7031f96bfc3ad751e33@story-mainnet-seed.validexis.com:35656"
PEERS="607f17f8be461d5b204361df8d18a06d2c7b66c9@story-mainnet-peer.validexis.com:35656,e605032fb4320e1d753abf9eda6df11569367ed3@34.126.123.46:26656,503f17f8be461d5b204361df8d18a06d2c7b66c9@160.202.131.55:26656,773ca1c46d7f4f7311aa84b03295e4b9ea5e77cc@51.159.20.50:26656,327de5c0085eb175da6ad7031f96bfc3ad751e33@79.137.98.193:26656,9e1591134891a711091a2a0aec861113f76ad0db@95.217.196.166:26656,cd7c6eb0fab7c1aa249cd68d055e3fc5b1cc6ae9@51.222.42.212:26656,a2a794dc81a98e47366ab3fa3b5f5663388b371e@188.40.102.137:58656,5ad60885838e30ac8801ae22217ff287ff16c0c8@64.110.106.33:26656,f8eeca47cb53dc205d38097263d5d856250f6c62@79.127.227.195:59456,0205ecba87c7bab90042c5a5c848c2aabe0bfdcc@35.228.67.149:26656,ed3f837119a7f1dbde9e7272c65f1366f294593b@5.199.164.81:27656"
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=35 To any other ports

```bash
STORY_PORT=35
```

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

***Create a service***

```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=$(which story-geth) --story --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 \
--port ${STORY_PORT}303
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
```

***Download latest chain snapshot***

```bash
# 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-mainnet/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/story/geth/chaindata
mkdir -p $HOME/.story/geth/story/geth
curl https://snapshots1.validexis.com/story-mainnet/geth_story_snap.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.story/geth/story/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 1514 --unlocked=false
```

#### *Create validator, unlocked*

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

Remember to backup your validator priv\_key from here:

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