Monkey Labs Services
  • Services Mainnet
    • Mantra
  • Services Testnet
    • Fiamma
      • 🌪️Installation
      • Upgrade
      • Snapshot
      • Useful commands
    • Mantra
      • Installation
      • Upgrade
      • Snapshot
      • State sync
      • Useful commands
      • Peers -> Seeds -> Addrbook
    • Nillion
      • Installation
      • Upgrade
      • Snapshot
      • State sync
      • Peers -> Seeds -> Addrbook
      • Useful commands
    • Prysm
      • Installation
      • Upgrade
      • Snapshot
      • State sync
      • Peers -> Seeds -> Addrbook
      • Useful commands
    • Pryzm
      • Installation
      • Upgrade
      • Snapshot
      • State sync
      • Useful commands
    • Titan Network
      • Installation
      • Upgrade
      • Snapshot
      • State sync
      • Peers -> Seeds -> Addrbook
      • Useful commands
    • Zenrock
      • Installation
      • Upgrade
      • Snapshot
      • State sync
      • Peers -> Seeds -> Addrbook
      • Useful commands
    • Xrpd
      • Installation
      • Upgrade
      • Snapshot
      • State sync
      • Peers -> Seeds -> Addrbook
      • Useful commands
Powered by GitBook
On this page
  1. Services Testnet
  2. Prysm

State sync

State Sync

If you don't want to wait for a long synchronization you can use:

sudo systemctl stop prysmd

cp $HOME/.prysm/data/priv_validator_state.json $HOME/.prysm/priv_validator_state.json.backup
prysmd tendermint unsafe-reset-all --home $HOME/.prysm

peers="bc0f324931f609be479ce6579f159e5d0bebc929@prysm-testnet-peer.monkeylabs.me:34656,bc0f324931f609be479ce6579f159e5d0bebc929@88.99.57.73:34656,ff15df83487e4aa8d2819452063f336269958d09@prysm-testnet-peer.itrocket.net:25657,fb04a6f5dbddefca240d0821e25ec219737bc6cb@65.109.27.148:29656,df2ca03803f969b6f14bb88bd4af4dcfb0e61701@65.109.111.234:25656,aea4d8e0b0036a435d49920c9e1fadc9f02278ca@65.108.203.61:44656,a53a6c4abbd4e4e212639dbff72e2c7295fd8cd8@213.199.43.242:29656,0b4b6be062055f913933597fe7d84c65286d444b@144.76.70.103:32656,cb36b0bf594bbb205827efd65fb2be0c82b4f854@176.9.126.78:20656,f3dd019aafbee0483de1d5133f03e880d96cde6a@65.108.234.158:23656,e89a44eb3d9100a312f435b274921f7d7a958d7e@95.216.73.182:26656,22b6d4f817ed345b7ac4e736715a985d8ee75004@193.34.212.80:33656,2e36231490438bf5ecd8b32e2f36b70c7dd9b035@157.173.105.31:29656"  
SNAP_RPC="https://prysm-testnet-rpc.monkeylabs.me:443"

sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.prysm/config/config.toml 

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 && sleep 2

sed -i.bak -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\"| ;
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.prysm/config/config.toml

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

sudo systemctl restart prysmd && sudo journalctl -u prysmd -fo cat
PreviousSnapshotNextPeers -> Seeds -> Addrbook

Last updated 1 month ago