Story labs

Node installation

Start a codespace from a template and get to developing with the power of a virtual machine in the cloud.

Recommended Hardware

ubuntu-20.04

ubuntu-22.04

CPU:

RAM:

8 cores

32GB

Storage:

500GB

Version

v0.8.9+commit.e5eed63a

Binary:

v1.3.1

Peers:

11

Node consumption

realtime

Cpu_cores

0.08 Core

1%

Ram

1.43 GB

4.47%

Storage

write | read

333.73 GB

40

kb/s

|

0

kb/s

Earliest block / Latest block

Node name

Port

Manual upgrade

### Install dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install git gcc make jq curl lz4
### Install go
cd $HOME
VER=1.22.11
wget -qO go.tar.gz "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go.tar.gz
rm go.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bashrc
source ~/.bashrc
mkdir -p ~/go/bin
### Download binary and build story
cd $HOME
rm -rf story
git clone https://github.com/piplabs/story story
cd story
APP_VERSION=v1.3.1
git checkout tags/$APP_VERSION -b $APP_VERSION
go build -o story ./client
mv $HOME/story/story $HOME/go/bin/.
### Download binary and build geth
cd $HOME
rm -rf geth
git clone https://github.com/piplabs/story-geth geth
cd geth
APP_VERSION=v1.1.1
git checkout tags/$APP_VERSION -b $APP_VERSION
go build -v ./cmd/geth
mv ./geth $HOME/go/bin/geth
### Config and init app
story init --network story
wget -O $HOME/.story/story/config/genesis.json https://st-snap-1.stakeme.pro/story/archive/genesis.json
wget -O $HOME/.story/story/config/addrbook.json https://st-snap-1.stakeme.pro/story/archive/addrbook.json
### Set seeds and peers
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*seeds *=.*/seeds = \"$SEEDS\"/}" -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.story/story/config/config.toml
### Set custom ports in story.toml and config.toml
sed -i.bak -e "s%:1317%:317%g;
s%:8080%:080%g;
s%:9090%:090%g;
s%:9091%:091%g;
s%:8551%:551%g;
s%:8545%:545%g;
s%:8546%:546%g;
s%:6065%:065%g" $HOME/.story/story/config/story.toml
sed -i.bak -e "s%:26658%:658%g;
s%:26657%:657%g;
s%:6060%:060%g;
s%:26656%:656%g;
s%:26660%:660%g" $HOME/.story/story/config/config.toml
### Disable indexing if needed
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.story/story/config/config.toml
### Create service file story
sudo tee /etc/systemd/system/story.service > /dev/null <<EOF
[Unit]
Description=Story is a purpose-built Layer 1 blockchain designed to revolutionize intellectual property (IP) management
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
### Create service file geth
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 --story --syncmode full --http --http.api eth,net,web3,engine --http.vhosts '*' --http.addr 0.0.0.0 --http.port 545 --authrpc.port 551 --ws --ws.api eth,web3,net,txpool --ws.addr 0.0.0.0 --ws.port 546
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
### Reset and state sync
story tendermint unsafe-reset-all --home $HOME/.story
STATYSYNC_RPC=https://story-rpc.stakeme.pro:443
LATEST_HEIGHT=$(curl -s $STATYSYNC_RPC/block | jq -r .result.block.header.height);
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000));
TRUST_HASH=$(curl -s "$STATYSYNC_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ;
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$STATYSYNC_RPC,$STATYSYNC_RPC\"| ;
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ;
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ;
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.story/story/config/config.toml
### Enable and start service
sudo systemctl daemon-reload
sudo systemctl enable story.service story-geth.service
sudo systemctl restart story-geth.service story.service && sudo journalctl -u story -f -o cat