diff --git a/docs/zetachain/sync/state sync.md b/docs/zetachain/sync/state sync.md deleted file mode 100644 index 778e85fe..00000000 --- a/docs/zetachain/sync/state sync.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -sidebar_position: 2 -description: State Sync ---- - -# State Sync - -> State Sync allows new nodes to join a blockchain network by downloading a recent snapshot of the application state instead of processing all historical blocks. This approach is typically faster and requires less data, as the application state is usually more concise than the entire block history. - -### State Sync by: - -
- F5 Nodes -
-
Stop the node
- sudo systemctl stop zetacored -
-
- diff --git a/docs/zetachain/sync/state-sync.mdx b/docs/zetachain/sync/state-sync.mdx new file mode 100644 index 00000000..e78798f1 --- /dev/null +++ b/docs/zetachain/sync/state-sync.mdx @@ -0,0 +1,23 @@ +--- +sidebar_position: 2 +description: State Sync +--- + +# State Sync + +> State Sync allows new nodes to join a blockchain network by downloading a recent snapshot of the application state instead of processing all historical blocks. This approach is typically faster and requires less data, as the application state is usually more concise than the entire block history. + +import SelectPaste from '@site/src/components/SelectPaste'; + +explore let rpc = [ + 'https://rpc1.node1111.test9999999.com', + 'https://rpc2.node2222.test9999999.com', + 'https://rpc3.node3333.test9999999.com', + 'https://rpc4.node4444.test9999999.com', + 'https://rpc5.node5555.test9999999.com', + 'https://rpc6.node6666.test9999999.com', + 'https://rpc7.node7777.test9999999.com', + 'https://rpc8.node8888.test9999999.com', +]; + + \ No newline at end of file diff --git a/src/components/SelectPaste/index.tsx b/src/components/SelectPaste/index.tsx new file mode 100644 index 00000000..a64524ee --- /dev/null +++ b/src/components/SelectPaste/index.tsx @@ -0,0 +1,55 @@ +import React, { useState } from "react"; +import CodeBlock from "@theme/CodeBlock"; +import Admonition from "@theme/Admonition"; + +interface SelectPasteProps { + rpc: string[]; +} + +const SelectPaste: React.FC = ({ rpc }) => { + const [selectedRpc, setSelectedRpc] = useState(rpc[0]); + + return ( +
+ +

Click on any RPC to paste it into the code block.

+
+ + + {`sudo systemctl stop zetacored + +cp $HOME/.zetacored/data/priv_validator_state.json $HOME/.zetacored/priv_validator_state.json.backup +zetacored tendermint unsafe-reset-all --home $HOME/.zetacored --keep-addr-book + +CUSTOM_RPC="${selectedRpc}" + +LATEST_HEIGHT=$(curl -s $CUSTOM_RPC/block | jq -r .result.block.header.height) +BLOCK_HEIGHT=$((LATEST_HEIGHT - 1500)) +TRUST_HASH=$(curl -s "$CUSTOM_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) + +echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH + +sed -i 's|^enable *=.*|enable = true|' $HOME/.zetacored/config/config.toml +sed -i 's|^rpc_servers *=.*|rpc_servers = "'$CUSTOM_RPC,$CUSTOM_RPC'"|' $HOME/.zetacored/config/config.toml +sed -i 's|^trust_height *=.*|trust_height = '$BLOCK_HEIGHT'|' $HOME/.zetacored/config/config.toml +sed -i 's|^trust_hash *=.*|trust_hash = "'$TRUST_HASH'"|' $HOME/.zetacored/config/config.toml + +mv $HOME/.zetacored/priv_validator_state.json.backup $HOME/.zetacored/data/priv_validator_state.json + +sudo systemctl restart zetacored +sudo journalctl -u zetacored -f --no-hostname -o cat + `} + + +
+ {rpc.map((item, index) => ( + + ))} +
+
+ ); +}; + +export default SelectPaste; diff --git a/static/img/undraw1.svg b/static/img/undraw1.svg index 5abf6ed5..9273f7fe 100644 --- a/static/img/undraw1.svg +++ b/static/img/undraw1.svg @@ -1,3 +1,3 @@ - + diff --git a/static/img/undraw2.svg b/static/img/undraw2.svg index e0b7f02f..47190c77 100644 --- a/static/img/undraw2.svg +++ b/static/img/undraw2.svg @@ -1,3 +1,3 @@ - + diff --git a/static/img/undraw3.svg b/static/img/undraw3.svg index 2beca4cb..b70a6ff3 100644 --- a/static/img/undraw3.svg +++ b/static/img/undraw3.svg @@ -1,4 +1,4 @@ - +