Copy 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 chrony liblz4-tool -y
Copy ver="1.22.2"
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"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version
Copy cd $HOME && mkdir -p go/bin/
wget -O geth https://github.com/piplabs/story-geth/releases/download/v0.10.1/geth-linux-amd64
chmod +x geth
mv ~/geth ~/go/bin/geth
git clone https://github.com/piplabs/story
cd $HOME/story
git checkout v0.12.1
go build -o story ./client
sudo mv $HOME/story/story $HOME/go/bin/
mkdir -p ~/.story/story
mkdir -p ~/.story/geth
Copy story init --network odyssey --moniker <moniker>
Copy wget -O $HOME/.story/story/config/genesis.json https://raw.githubusercontent.com/Shoni-O/files/refs/heads/main/testnet-files/story/genesis.json
Copy sha256sum $HOME/.story/story/config/genesis.json
Copy wget -O $HOME/.story/story/config/addrbook.json https://raw.githubusercontent.com/Shoni-O/files/refs/heads/main/testnet-files/story/addrbook.json
Enable prometheus and disable indexing
Copy 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
Copy sudo tee /etc/systemd/system/story-geth.service > /dev/null <<EOF
[Unit]
Description=Story Geth Client
After=network.target
[Service]
User=$USER
ExecStart=$HOME/go/bin/geth --odyssey --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=4096
[Install]
WantedBy=multi-user.target
EOF
Create story service file
Copy sudo tee /etc/systemd/system/story.service > /dev/null <<EOF
[Unit]
Description=Story Consensus Client
After=network.target
[Service]
User=$USER
WorkingDirectory=$HOME/.story/story
ExecStart=$HOME/go/bin/story run
Restart=on-failure
RestartSec=3
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
EOF
Copy sudo systemctl daemon-reload
sudo systemctl enable story-geth
sudo systemctl enable story
sudo systemctl restart story-geth && sudo journalctl -fu story-geth -o cat
sudo systemctl restart story && sudo journalctl -fu story -o cat
Copy story validator create --stake 1500000000000000000000 --moniker STAVR_Guide --private-key $(cat $HOME/.story/story/config/private_key.txt | grep "PRIVATE_KEY" | awk -F'=' '{print $2}')
Copy curl localhost:26657/status | jq
or
story status
Copy curl -s http://localhost:26657/status | jq .result.sync_info
Copy sudo systemctl stop story-geth story
sudo systemctl disable story-geth story
rm /etc/systemd/system/story-geth.service /etc/systemd/system/story.service
sudo systemctl daemon-reload
cd $HOME
rm -rf .story story
rm -rf $(which story)
rm -rf $(which geth)