#!/bin/bash # Install dependencies sudo apt update sudo apt upgrade -y sudo apt install curl git make jq build-essential gcc unzip wget lz4 pv -y #Install Go cd $HOME VER="1.22.3" 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" >> ~/.bash_profile source ~/.bash_profile go version # Install Story-Geth binaries cd $HOME wget https://github.com/piplabs/story-geth/releases/download/v0.11.0/geth-linux-amd64 sudo cp geth-linux-amd64 $HOME/go/bin/story-geth sudo chmod +x $HOME/go/bin/story-geth mkdir -p "$HOME/.story/story" mkdir -p "$HOME/.story/geth" # Install Story cd $HOME git clone https://github.com/piplabs/story cd story git checkout v0.13.0 go build -o story ./client mv $HOME/story/story $HOME/go/bin/ # Initialize Story story init --network odyssey # Add peers PEERS=$(curl -sS https://story-testnet-rpc.shachopra.com/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}' | paste -sd, -) echo $PEERS sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.story/story/config/config.toml # Enable indexer sed -i -e 's/^indexer = "null"/indexer = "kv"/' $HOME/.story/story/config/config.toml # Install Cosmovisor cd $HOME go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.7.0 # Cosmovisor setup echo "export DAEMON_NAME=story" >> $HOME/.bash_profile echo "export DAEMON_HOME=/root/.story/story" >> $HOME/.bash_profile echo "export DAEMON_DATA_BACKUP_DIR=/root/.story/story/data" >> $HOME/.bash_profile source $HOME/.bash_profile mkdir -p $HOME/.story/story/cosmovisor/genesis/bin mkdir -p $HOME/.story/story/cosmovisor/backup mkdir -p $HOME/.story/story/cosmovisor/upgrades cp $HOME/go/bin/story $HOME/.story/story/cosmovisor/genesis/bin/ # Create service files # Geth service file sudo tee /etc/systemd/system/story-geth.service > /dev/null < /dev/null <