sudo apt install curl jq -y2. Stop the node
systemctl stop bitsong.service3. Remove old data
4. Configure state-sync# Always backup priv_validator_state.json on validator node, to avoid double-sign
cp $HOME/.bitsongd/data/priv_validator_state.json $HOME/.bitsongd/priv_validator_state.json.backupIf possible, keep this backup until your node is running
mv $HOME/.bitsongd/data $HOME/.bitsongd/data.backup mkdir $HOME/.bitsongd/data cp $HOME/.bitsongd/priv_validator_state.json.backup $HOME/.bitsongd/data/priv_validator_state.json
RPC1=https://bitsong-rpc.bluestake.net:443 RPC2=https://rpc.cosmos.directory:443/bitsong LATEST_HEIGHT=$(curl -s $RPC1/block | jq -r .result.block.header.height); \ BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \ TRUST_HASH=$(curl -s "$RPC1/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\"$RPC1,$RPC2\"| ; \ s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.bitsongd/config/config.toml5. Start the node
systemctl start bitsong.service6. Monitor your node
journalctl -u bitsong
# Is your node catching up?
curl http://localhost:26657/status | jq .result.sync_info
BlueStake contribute to Bitsong by offering several tools and services,
tailored for users, developers, and node operators.