Skip to content

Commit

Permalink
Create readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
defrisk0 authored Dec 5, 2023
1 parent a404a25 commit 8a94f70
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions UNION/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# UNION
[RPC](http://union.srgts.xyz:21657) | [API](http://union.srgts.xyz:1337) | [STATESYNC](#title1)

### <a id="title1">State Sync</a>
````
seeds="[email protected]:27656,8a07752a234bb16471dbb577180de7805ba6b5d9@union.testnet.4.seed.poisonphang.com:26656"
peers="[email protected]:21656"
sed -i -e 's|^seeds *=.*|seeds = "'$seeds'"|; s|^persistent_peers *=.*|persistent_peers = "'$peers'"|' $HOME/.union/config/config.toml
sudo systemctl stop uniond
cp $HOME/.union/data/priv_validator_state.json $HOME/.union/priv_validator_state.json.backup
uniond tendermint unsafe-reset-all --home $HOME/.union --keep-addr-book
SNAP_RPC="http://union.srgts.xyz:21657"
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH
sed -i -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.union/config/config.toml
mv $HOME/.union/priv_validator_state.json.backup $HOME/.union/data/priv_validator_state.json
sudo systemctl restart uniond && sudo journalctl -u uniond -f -o cat
````

0 comments on commit 8a94f70

Please sign in to comment.