From 3c189d8b43abf9c3d879cafdb6201156272e8c12 Mon Sep 17 00:00:00 2001 From: redwest88 Date: Wed, 11 Sep 2024 19:06:07 +0200 Subject: [PATCH] update sync page for Story Protocol --- docs/story-protocol/_category_.json | 2 +- docs/story-protocol/sync/_category_.json | 4 ++ docs/story-protocol/sync/addrbook.mdx | 29 ++++++++++++ docs/story-protocol/sync/peers-seeds.mdx | 20 +++++++++ docs/story-protocol/sync/snapshot.md | 57 ++++++++++++++++++++++++ 5 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 docs/story-protocol/sync/_category_.json create mode 100644 docs/story-protocol/sync/addrbook.mdx create mode 100644 docs/story-protocol/sync/peers-seeds.mdx create mode 100644 docs/story-protocol/sync/snapshot.md diff --git a/docs/story-protocol/_category_.json b/docs/story-protocol/_category_.json index 9047f90e..7817fb2d 100644 --- a/docs/story-protocol/_category_.json +++ b/docs/story-protocol/_category_.json @@ -1,4 +1,4 @@ { - "label": "Story", + "label": "Story Protocol", "position": 17 } diff --git a/docs/story-protocol/sync/_category_.json b/docs/story-protocol/sync/_category_.json new file mode 100644 index 00000000..37f5b67d --- /dev/null +++ b/docs/story-protocol/sync/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Sync", + "position": 2 +} diff --git a/docs/story-protocol/sync/addrbook.mdx b/docs/story-protocol/sync/addrbook.mdx new file mode 100644 index 00000000..9f34727a --- /dev/null +++ b/docs/story-protocol/sync/addrbook.mdx @@ -0,0 +1,29 @@ +--- +sidebar_position: 4 +description: AddrBook +--- + +# AddrBook + +> Address book refers to a local database or record that a node maintains of all the peers it has come into contact with or learned about. This helps in the peer discovery process. + +import SelectPaste from '@site/src/components/SelectPaste'; + +import { addrBook } from '@site/src/components/SelectPaste/addrBook.ts'; + +export let endpoints = [ + 'https://server-5.itrocket.net/testnet/story/addrbook.json', + 'https://snapshots.kjnodes.com/story-testnet/addrbook.json', + 'https://snapshots.lavenderfive.com/testnet-addrbooks/story/addrbook.json', + 'https://share102.utsa.tech/story/addrbook.json', + 'https://raw.githubusercontent.com/McDaan/general/main/story/addrbook.json', + 'https://ss-t.story.nodestake.org/addrbook.json', + 'https://snapshots.polkachu.com/testnet-addrbook/story/addrbook.json', + 'https://support.synergynodes.com/addrbook/story_testnet/addrbook.json', +]; + +export let home = 'story/story'; + +export let binary = 'story'; + + diff --git a/docs/story-protocol/sync/peers-seeds.mdx b/docs/story-protocol/sync/peers-seeds.mdx new file mode 100644 index 00000000..8cdaf697 --- /dev/null +++ b/docs/story-protocol/sync/peers-seeds.mdx @@ -0,0 +1,20 @@ +--- +sidebar_position: 3 +description: Live Peers / Seeds +--- + +# Live Peers / Seeds + +> When you start a node, you often need to connect to the network. This requires you to connect to one or more peers to start downloading the blockchain and receiving new blocks and transactions. Seeding nodes or bootstrap nodes help in this initial connection process. + +:::info +Copy and run the commands below to add your peers into `config.toml`. +::: + +import LivePeers from '@site/src/components/LivePeers'; + +export let home = 'story/story'; + +export let binary = 'story'; + + diff --git a/docs/story-protocol/sync/snapshot.md b/docs/story-protocol/sync/snapshot.md new file mode 100644 index 00000000..e9147e54 --- /dev/null +++ b/docs/story-protocol/sync/snapshot.md @@ -0,0 +1,57 @@ +--- +sidebar_position: 1 +description: Snapshot +--- + +# Snapshot + +> When a new node joins a network, it can use a snapshot — a compressed backup of the chain's data — to quickly synchronize with the current state. Snapshots expedite the process, reducing the need to download and verify every transaction from the beginning. + +import Snapshots from '@site/src/components/Snapshots'; + + + +:::info +Snapshots are taken every 2 hours. +::: + + +```bash +sudo systemctl stop story && sudo systemctl stop story-geth + +# make a backup of the validator state +cp $HOME/.story/story/data/priv_validator_state.json $HOME/.story/priv_validator_state.json.backup + +# delete data folders +rm -rf $HOME/.story/story/data +rm -rf $HOME/.story/geth/iliad/geth/chaindata + +# download and decompress snapshots +story_snapshot_url=$(curl -sL 'https://story-testnet-snapshots.f5nodes.com' | grep -Eo '>iliad-0_story.*\.tar\.lz4' | sed 's/^>//' | head -n1) +geth_snapshot_url=$(curl -sL 'https://story-testnet-snapshots.f5nodes.com' | grep -Eo '>iliad-0_geth.*\.tar\.lz4' | sed 's/^>//' | head -n1) + +wget "https://story-testnet-snapshots.f5nodes.com/${story_snapshot_url}" -O - | lz4 -dc - | tar -xf - -C $HOME/.story +wget "https://story-testnet-snapshots.f5nodes.com/${geth_snapshot_url}" -O - | lz4 -dc - | tar -xf - -C $HOME/.story/geth/iliad/geth + + +# replace the priv_validator_state.json you have backed up +cp $HOME/.story/priv_validator_state.json.backup $HOME/.story/story/data/priv_validator_state.json + +# restart your services +sudo systemctl restart story && sudo systemctl restart story-geth +``` + +You can also use snapshots from other providers: + +#### kjnodes: +```bash +https://snapshots.kjnodes.com/story-testnet/snapshot_latest.tar.lz4 # story snapshot +https://snapshots.kjnodes.com/story-testnet/snapshot_latest_geth.tar.lz4 # geth snapshot +``` + +#### Mandragora: +```bash +https://snapshots.mandragora.io/story_snapshot.lz4 # story snapshot +https://snapshots.mandragora.io/geth_snapshot.lz4 # geth snapshot +``` +