# Story Protocol

## Public Endpoints

```
RPC: https://story-rpc.validatorvn.com/
API: https://story-api.validatorvn.com/
EVM-RPC: https://story-rpc-evm.validatorvn.com/
```

## Snapshots (Daily at 2AM UTC)

```
sudo systemctl stop story story-geth #or equivalent to your service names

mv $HOME/.story/story/data/priv_validator_state.json $HOME/.story/priv_validator_state.json.backup

rm -rf $HOME/.story/story/data
rm -rf $HOME/.story/geth/iliad/geth/chaindata

curl -L https://tools.validatorvn.com/Story/story.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.story/story
curl -L https://tools.validatorvn.com/Story/geth.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.story/geth/iliad/geth

mv $HOME/.story/priv_validator_state.json.backup $HOME/.story/story/data/priv_validator_state.json

sudo systemctl start story story-geth #or equivalent to your service names
```

## Genesis & Addrbook files

```
curl -L https://snapshot.validatorvn.com/story/addrbook.json > $HOME/.story/story/config/addrbook.json
curl -L https://snapshot.validatorvn.com/story/genesis.json > $HOME/.story/story/config/genesis.json
```

## Live Peers

```
URL="https://story-rpc.validatorvn.com/net_info"
# Fetch data from the endpoint
response=$(curl -s $URL)
# Parse JSON and construct PEERS string using jq
PEERS=$(echo $response | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):" + (.node_info.listen_addr | capture("(?<ip>.+):(?<port>[0-9]+)$").port)' | paste -sd "," -)
# Display the PEERS string
echo "PEERS=\"$PEERS\""
# Set the peers
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$PEERS'"|' $HOME/.story/story/config/config.toml
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://services.validatorvn.com/story-protocol.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
