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
  1. Testnet
  2. Cross Finance

Statesync

PreviousSnapshotNextTool and Services

Last updated 1 year ago

Network: Testnet | Chain ID: crossfi-evm-testnet-1 | Version: v.0.46.13

State Synchronization allows a new node to join the network by retrieving a snapshot of the application state at its current height, instead of retrieving and replaying all historical blocks. Since application states are generally much smaller than blocks, and recovering them is much faster than replaying blocks, it can reduce the time to synchronize with the network from several days to a few minutes.

Stop the service and reset the data

sudo systemctl stop crossfid
cp $HOME/.mineplex-chain/data/priv_validator_state.json $HOME/.mineplex-chain/priv_validator_state.json.backup
empowerd tendermint unsafe-reset-all --home $HOME/.empowerchain

Get and configure the state sync information

STATE_SYNC_RPC=https://rpc-crossfi-testnet.dexanode.com:443
STATE_SYNC_PEER=0835b028b7532599dd95fe97d1c01ea420b5bd0b@https://rpc-crossfi-testnet.dexanode.com/
LATEST_HEIGHT=$(curl -s $STATE_SYNC_RPC/block | jq -r .result.block.header.height)
SYNC_BLOCK_HEIGHT=$(($LATEST_HEIGHT - 2000))
SYNC_BLOCK_HASH=$(curl -s "$STATE_SYNC_RPC/block?height=$SYNC_BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i \
  -e "s|^enable *=.*|enable = true|" \
  -e "s|^rpc_servers *=.*|rpc_servers = \"$STATE_SYNC_RPC,$STATE_SYNC_RPC\"|" \
  -e "s|^trust_height *=.*|trust_height = $SYNC_BLOCK_HEIGHT|" \
  -e "s|^trust_hash *=.*|trust_hash = \"$SYNC_BLOCK_HASH\"|" \
  -e "s|^persistent_peers *=.*|persistent_peers = \"$STATE_SYNC_PEER\"|" \
  $HOME/.empowerchain/config/config.toml

mv $HOME/.empowerchain/priv_validator_state.json.backup $HOME/.mineplex-chain/data/priv_validator_state.json