Node installation

Story Protocol node installation

Install dependencies

sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y

Install Go if nedeed

cd $HOME
VER="1.21.1"
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

Set variables

You can change the variables here as you want.

echo "export STORY_MONIKER="MyNodes"" >> $HOME/.bash_profile
echo "export STORY_PORT="23"" >> $HOME/.bash_profile

source $HOME/.bash_profile

Download binary

cd $HOME
rm -rf bin
mkdir bin
cd bin
wget https://story-geth-binaries.s3.us-west-1.amazonaws.com/geth-public/geth-linux-amd64-0.9.2-ea9f0d2.tar.gz
wget https://story-geth-binaries.s3.us-west-1.amazonaws.com/story-public/story-linux-amd64-0.9.11-2a25df1.tar.gz
tar -xvf geth-linux-amd64-0.9.2-ea9f0d2.tar.gz && tar -xvf story-linux-amd64-0.9.11-2a25df1.tar.gz
mv ~/bin/geth-linux-amd64-0.9.2-ea9f0d2/geth ~/go/bin/ && mv ~/bin/story-linux-amd64-0.9.11-2a25df1/story ~/go/bin/
mkdir -p ~/.story/story && mkdir -p ~/.story/geth

Initialize Story Client

story init --moniker $STORY_MONIKER --network iliad

Set custom ports (optional)

for config.toml
sed -i.bak -e "s%:26658%:${STORY_PORT}58%g;
s%:26657%:${STORY_PORT}57%g;
s%:26656%:${STORY_PORT}56%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${STORY_PORT}56\"%;
s%:26660%:${STORY_PORT}60%g" $HOME/.story/story/config/config.toml
for story.toml
sed -i.bak -e "s%:1317%:${STORY_PORT}17%g;" $HOME/.story/story/config/story.toml

Create geth service file

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

[Service]
User=$USER
ExecStart=$HOME/go/bin/geth --iliad --syncmode full --http --http.api eth,net,web3,engine --http.vhosts '*' --http.addr 127.0.0.1 --http.port 8545 --ws --ws.api eth,web3,net,txpool --ws.addr 127.0.0.1 --ws.port 8546
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

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=$HOME/go/bin/story run

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

Enable and start services

# enable and start geth
sudo systemctl daemon-reload
sudo systemctl enable geth
sudo systemctl restart geth && sudo journalctl -u geth -f

# enable and start story
sudo systemctl daemon-reload
sudo systemctl enable story
sudo systemctl restart story && sudo journalctl -u story -f

Check status

PORT=$(awk -F'[/:]' '/[rpc]/{flag=1; next} /laddr/ && flag{gsub(/"/, "", $NF); print $NF; exit}' $HOME/.story/story/config/config.toml)
curl localhost:$PORT/status | jq

Create validator (optional)

# export validator private key
story validator export --export-evm-key

# copy your privkey and import it on metamask.
sudo cat /root/.story/story/config/private_key.txt
# then faucet your wallet https://faucet.story.foundation/
# make sure your wallet balance is more than 1IP 

# create validator
story validator create --stake 1000000000000000000 --private-key "your_private_key_here"

Last updated