Services Dexanode
  • Mapping Networks
    • Mapping Networks
  • Mainnet
    • Planq Network
      • Installation
      • Upgrade
      • Snapshot
      • Statesync
      • CLI Cheat Sheet
    • Lambda Network
      • Installation
    • Ununifi
      • Installation
      • Manual Installation
    • Lambda Network
  • Testnet
    • CreditCoin (Polkadot)
    • BEVM Incentiviced Testnet Full Node
      • Binaries
      • Docker
    • Dymension Froopyland
      • Create Pull Request
      • Deploy NFT & Smart Contract
    • Noria
      • Installation
      • Manual Installation
      • Upgrade
      • Snapshot
      • Statesync
      • CLI Cheat Sheet
    • Artela
      • Installation
      • Manual Installation
      • Upgrade
      • Snapshot
      • Statesync
      • CLI Cheat Sheet
    • Empower
      • Installation
      • Manual Installation
      • Upgrade
      • Snapshot
      • Statesync
      • CLI Cheat Sheet
    • Cross Finance
      • Installation
      • Upgrade
      • Snapshot
      • Statesync
      • Tool and Services
    • Eclipse Testnet
      • Eclipse Testnet Bridge Quest
    • Polymer
      • Polymer With Docker
      • Polymer Challenge 4
      • Polymer Challenge 4 Gitpod
    • Risc Zero Contributed Phase 1
  • Page 2
  • Tooling Service
    • Create Custom Endpoint Cosmos
    • Create custom endpoint Initia Node
    • Create Snapshoot
  • Page
Powered by GitBook
On this page
  • Instruction
  • Our state-sync server setup
  1. Mainnet
  2. Planq Network

Statesync

Guide installation node validator

PreviousSnapshotNextCLI Cheat Sheet

Last updated 1 year ago

Network: Mainnet | Chain ID: planq_7070-2 | Version: v1.0.5

State Sync allows a new node to join the network by fetching a snapshot of the application state at a recent height instead of fetching and replaying all historical blocks. Since the application state is generally much smaller than the blocks, and restoring it is much faster than replaying blocks, this can reduce the time to sync with the network from days to minutes.

Instruction

Our state-sync server setup

Our app.toml settings related to state-sync is as follows. This is for you information only. You do not need to follow the same setup on your node

# Prune Type
pruning = "custom"

# Prune Strategy
pruning-keep-every = 0

# State-Sync Snapshot Strategy
snapshot-interval = 2000
snapshot-keep-recent = 5

Our state-sync RPC server for planq is :

https://rpc-planq.dexanode.com:443

Stop the service and reset the data

sudo systemctl stop planqd
cp $HOME/.planqd/data/priv_validator_state.json $HOME/.planqd/priv_validator_state.json.backup
planqd tendermint unsafe-reset-all --home $HOME/.planqd --keep-addr-book

Configure state sync information

SNAP_RPC="https://rpc-planq.dexanode.com:443"
STATESYNC_PEERS="b611a4058ac5caf8b56c1012c695afc75aea4217@peers-planq.sxlzptprjkt.xyz:18656"

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)

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\"|" $HOME/.planqd/config/config.toml
sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$STATESYNC_PEERS\"|" $HOME/.planqd/config/config.toml

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

Start service and check logs

sudo systemctl start planqd && sudo journalctl -fu planqd -o cat