InuX Dev
  • 🤝Introduction
  • Getting started
    • Blockchain Node
    • Prerequisites
  • Artela
    • Installation
    • State Sync
    • Useful Commands
  • 0g
    • Installation
    • Sync
    • Public
Powered by GitBook
On this page
  • Reset blockchain data
  • Configure state sync
  • Start artelad service & monitor logs
  1. Artela

State Sync

Catching up to the latest block like a magic!

Reset blockchain data

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

Configure state sync

SYNC_RPC="https://artela-testnet-rpc.inux.dev"
SYNC_PEER="1372cede4225ae557f9809562e7440a002c0a420@84.247.162.188:26656"
LATEST_HEIGHT=$(curl -s $SYNC_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
TRUST_HASH=$(curl -s "$SYNC_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

sed -i \
  -e "s|^enable *=.*|enable = true|" \
  -e "s|^rpc_servers *=.*|rpc_servers = \"$SYNC_RPC,$SYNC_RPC\"|" \
  -e "s|^trust_height *=.*|trust_height = $BLOCK_HEIGHT|" \
  -e "s|^trust_hash *=.*|trust_hash = \"$TRUST_HASH\"|" \
  -e "s|^persistent_peers *=.*|persistent_peers = \"$SYNC_PEER\"|" \
  $HOME/.artelad/config/config.toml

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

Start artelad service & monitor logs

sudo systemctl restart artelad && \
sudo journalctl -u artelad -f --output cat
PreviousInstallationNextUseful Commands

Last updated 1 year ago